你可以通过下面的命令编辑现有的 Secret:
kubectl edit secrets mysecret
这一命令会打开默认的编辑器,允许你更新 data 字段中包含的 base64 编码的 Secret 值:
# Please edit the object below. Lines beginning with a '#' will be ignored,# and an empty file will abort the edit. If an error occurs while saving this file will be# reopened with the relevant failures.#apiVersion: v1data:username: YWRtaW4=password: MWYyZDFlMmU2N2Rmkind: Secretmetadata:annotations:kubectl.kubernetes.io/last-applied-configuration: { ... }creationTimestamp: 2016-01-22T18:41:56Zname: mysecretnamespace: defaultresourceVersion: "164619"uid: cfee02d6-c137-11e5-8d73-42010af00002type: Opaque
