你可以通过下面的命令编辑现有的 Secret:

    1. kubectl edit secrets mysecret

    这一命令会打开默认的编辑器,允许你更新 data 字段中包含的 base64 编码的 Secret 值:

    1. # Please edit the object below. Lines beginning with a '#' will be ignored,
    2. # and an empty file will abort the edit. If an error occurs while saving this file will be
    3. # reopened with the relevant failures.
    4. #
    5. apiVersion: v1
    6. data:
    7. username: YWRtaW4=
    8. password: MWYyZDFlMmU2N2Rm
    9. kind: Secret
    10. metadata:
    11. annotations:
    12. kubectl.kubernetes.io/last-applied-configuration: { ... }
    13. creationTimestamp: 2016-01-22T18:41:56Z
    14. name: mysecret
    15. namespace: default
    16. resourceVersion: "164619"
    17. uid: cfee02d6-c137-11e5-8d73-42010af00002
    18. type: Opaque