How to add kube-config and use go-client in our go program

180 Views Asked by At

What the role of kube-Config and how to use this in our go program for simple operations?

1

There are 1 best solutions below

0
On

There is an example in client-go library you can use for learning. You can check the source, i am not including it here, as it a bit heavy.

But in general:

  • You read config from kubeconfig using kubernetes.NewForConfig
  • And using clientset returned by the previous command your app performing API requests.