如何将Kubectl配置文件与〜/.kube/config合并? [英] How to merge kubectl config file with ~/.kube/config?

查看:67
本文介绍了如何将Kubectl配置文件与〜/.kube/config合并?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个简单的kubectl命令来获取一个kubeconfig文件(包含集群+上下文+用户)并将其合并到〜/.kube/config文件中作为附加上下文?

Is there a simple kubectl command to take a kubeconfig file (that contains a cluster+context+user) and merge it into the ~/.kube/config file as an additional context?

推荐答案

执行以下操作:

export KUBECONFIG=~/.kube/config:~/someotherconfig 
kubectl config view --flatten

然后,您可以根据需要将其通过管道传输到新文件.

You can then pipe that out to a new file if needed.

这篇关于如何将Kubectl配置文件与〜/.kube/config合并?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆