LoginSignup
1
0

More than 3 years have passed since last update.

KubernetesのSecretsから特定の値が入っている場所を探す

Posted at
export VALUE=hoge
kubectl get secret --all-namespaces -o json | \
jq '
.
| [
    .
    | .items[]
    | {
        key: "\(.metadata.namespace)/\(.metadata.name)",
        value: [
          .
          | (.data // {})
          | to_entries[]
          | select(.value | @base64d | contains($ENV.VALUE))
          | .key
        ]
      }
    | select(.value | length > 0)
  ]
| from_entries
'
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0