We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To use kubectl with merged config,
kubectl
below two commands can be used:
KUBECONFIG=~/.kube/config:/path/to/another/config.yml kubectl config view --flatten > ~/.kube/config-new.yaml
and then
cp ~/.kube/config-new.yaml ~/.kube/config
~/.kube/config will have merged config after running above two commands
~/.kube/config
In our case(to talk to kubernetes api-server), instead of kubectl, we are planning for a GoLang tool that uses client-go library.
api-server
GoLang tool maintains kubeconfig retrieved from MongoDB(every 10 minutes) and stored in Go slice of structs(shown below):
[ { "name" : "cluster-1-in-gcp", "kubernetes-version": "1.16", "server": "https://192.168.10.190:6443", "user": "kubernetes-admin-1", "client-certificate": "sadfhdsjfkhsdjfklhsdjfkassdfsd", "client-key": "sahgjkshfgjkdf" }, { "name" : "cluster-1-in-aws", "kubernetes-version": "1.17", "server": "https://192.168.11.191:6443", "user": "kubernetes-admin-2", "client-certificate": "ssssshdsjfkhsdjfklhsdjfkassdfsd", "client-key": "pppppsahgjkshfgjkdf" }, { "name" : "cluster-1-in-aks", "kubernetes-version": "1.18", "server": "https://192.168.11.192:6443", "user": "kubernetes-admin-3", "client-certificate": "oooossssshdsjfkhsdjfklhsdjfkassdfsd", "client-key": "tttttpppppsahgjkshfgjkdf" }, ]
client-certificate & client-key are PEM format certificates(stored as string)
client-certificate
client-key
string
Seeking a Go package to merge this kubeConfig(Go slice of structs) to ~/.kube/config?
Does cliendcmd package of client-go library support this merge functionality?
client-go
The text was updated successfully, but these errors were encountered:
Resolved
Sorry, something went wrong.
No branches or pull requests
To use
kubectl
with merged config,below two commands can be used:
KUBECONFIG=~/.kube/config:/path/to/another/config.yml kubectl config view --flatten > ~/.kube/config-new.yaml
and then
cp ~/.kube/config-new.yaml ~/.kube/config
~/.kube/config
will have merged config after running above two commandsIn our case(to talk to kubernetes
api-server
), instead ofkubectl
, we are planning for a GoLang tool that uses client-go library.GoLang tool maintains kubeconfig retrieved from MongoDB(every 10 minutes) and stored in Go slice of structs(shown below):
client-certificate
&client-key
are PEM format certificates(stored asstring
)Seeking a Go package to merge this kubeConfig(Go slice of structs) to
~/.kube/config
?Does cliendcmd package of
client-go
library support this merge functionality?The text was updated successfully, but these errors were encountered: