From 7dae226a96f9cb3f8a91d67cf2d89e2ca7b45788 Mon Sep 17 00:00:00 2001 From: Eric Hu <676307+eric-hu@users.noreply.github.com> Date: Sun, 21 Jul 2019 10:32:53 +0700 Subject: [PATCH] secret.md: add an example of editing a secret (#15464) --- .../en/docs/concepts/configuration/secret.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/content/en/docs/concepts/configuration/secret.md b/content/en/docs/concepts/configuration/secret.md index d4774a9d6e..ac0fe54159 100644 --- a/content/en/docs/concepts/configuration/secret.md +++ b/content/en/docs/concepts/configuration/secret.md @@ -359,6 +359,38 @@ echo 'MWYyZDFlMmU2N2Rm' | base64 --decode 1f2d1e2e67df ``` +#### Editing a Secret + +An existing secret may be edited with the following command: + +```shell +kubectl edit secrets mysecret +``` + +This will open the default configured editor and allow for updating the base64 encoded secret values in the `data` field: + +``` +# 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: v1 +data: + username: YWRtaW4= + password: MWYyZDFlMmU2N2Rm +kind: Secret +metadata: + annotations: + kubectl.kubernetes.io/last-applied-configuration: { ... } + creationTimestamp: 2016-01-22T18:41:56Z + name: mysecret + namespace: default + resourceVersion: "164619" + selfLink: /api/v1/namespaces/default/secrets/mysecret + uid: cfee02d6-c137-11e5-8d73-42010af00002 +type: Opaque +``` + ## Using Secrets Secrets can be mounted as data volumes or be exposed as