Skip to content

Instantly share code, notes, and snippets.

@estahn
Last active August 15, 2023 07:48
Show Gist options
  • Save estahn/6b8cfac387ffacc8738cbe2ffb675932 to your computer and use it in GitHub Desktop.
Save estahn/6b8cfac387ffacc8738cbe2ffb675932 to your computer and use it in GitHub Desktop.

Revisions

  1. estahn renamed this gist Dec 23, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. estahn renamed this gist Dec 23, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. estahn renamed this gist Dec 23, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. estahn renamed this gist Dec 23, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. estahn created this gist Dec 23, 2020.
    3 changes: 3 additions & 0 deletions .shellfn
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    function kubectl-secrets () {
    kubectl get secrets $@ -ojson | jq '{name: .metadata.name, data: .data | map_values(@base64d)}'
    }
    14 changes: 14 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    Pop the function into your file where you keep your shell functions. Then run `source <shell function file>` to reload it into the shell.

    Now you're all set:

    ```
    $ kubectl-secrets -n foobar secret-sauce
    {
    "name": "secret-sauce",
    "data": {
    "ADMIN_PASSWORD": "53O...vg==",
    "ADMIN_USERNAME": "admin"
    }
    }
    ```