kuberneteskubectlkubernetes-helmkopskubernetes-cluster

Multiple kubernetes cluster


The requirement is, for each new build for QA should create a new kubernetes cluster (new enviroment altogether) and then it should be destroyed after QA is completed. So it is not a federated setup.

I am using kops in AWS to create cluster.

Do I need to create another 'bootstrap' instance for creating new cluster? The guess is I can change the name of cluster in command and it will create a new cluster. Like kops create cluster --zones=<zones> <some-other-name>.

So question is what does kubectl get all return - consolidated objects?

When I do kubectl apply -f ., how doest kubectl know which cluster to apply to?

How do I specify cluster name while installing things like helm?


Solution

  • You should be setting the context on your cluster something like this, once this is set then all your kubectl commands will be run in the context of that cluster.

    kubectl config use-context my-cluster-name

    Refer this link for more details