Skip to content

[ACS] The Kubernetes get-credentials command overwrites local kubeconfig file #1311

@lostintangent

Description

@lostintangent

The az acs kubernetes get-credentials command is really useful, however, I noticed that it seems to overwrite the local kube config file (e.g. ~/.kube/config), and I can't seem to find a way to have it simply add the new cluster/context/user info to my existing kube config file (unless I choose to do it myself and not use this command). It would be cool if there was a way for me to do something along the lines of any of the following:

  1. Have the get-credentials command add to the default config file. This behavior is similar to how minikube seems to work when you initialize a development cluster. It auto-adds the cluster details to your config in a non-invasive way.

  2. Provide a mode that simply outputs the necessary shell commands (e.g. kubectl config set-cluster) in order to augment the default config file, which allows you to eval it yourself, similarly to how docker-machine env works. Code bootstrap #1 would presumably be an automated version of this.

  3. Write the ACS-specific config file to a specified location on disk, so I could update my KUBECONFIG env var and merge together the multiple config files, or explicitly use the --kubeconfig flag when using the k8s CLI. Maybe the existing behavior could default to the global config path, but you could override it with a flag.

Maybe the existing behavior is fine in practice, so I'm just throwing this out there for conversation, but it would be cool to have the same simple experience of creating an ACS cluster and connecting to it, without affecting a user's existing config settings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ACSaz acs/aks/openshiftService AttentionThis issue is responsible by Azure service team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions