Kubernetes:使用kubectl修改秘密吗? [英] Kubernetes: modify a secret using kubectl?

查看:83
本文介绍了Kubernetes:使用kubectl修改秘密吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用kubectl修改Kubernetes secret中的值?

How can I modify the values in a Kubernetes secret using kubectl?

我使用kubernetes create secret generic创建了机密,但是似乎没有修改机密的方法.例如,向其中添加新的秘密值,或在其中更改秘密值.

I created the secret with kubernetes create secret generic, but there does not seem to be a way to modify a secret. For example, to add a new secret-value to it, or to change a secret-value in it.

我认为我可以进行低级"操作,并编写yaml文件并执行kubectl edit,但我希望有一种更简单的方法.

I assume i can go 'low-level', and write the yaml-file and do a kubectl edit but I hope there is a simpler way.

(我正在使用kubernetes 1.2.x)

推荐答案

最直接(和交互式)的方法应该是执行kubectl edit secret <my secret>.如果要查看Kubernetes管理的秘密列表,请运行kubectl get secrets.

The most direct (and interactive) way should be to execute kubectl edit secret <my secret>. Run kubectl get secrets if you'd like to see the list of secrets managed by Kubernetes.

这篇关于Kubernetes:使用kubectl修改秘密吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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