How To Decode Base64 Encoded Secrets With Kubectl And Base64
Decode a secret using base64: `k get secrets database-data -n database-ns -o jsonpath='{.data.*}' | base64 -d
5. How to decode the secret Previous we see how to create a secret, now let’s use the base64 encode secret to decode the secret Let’s first get the secret creating yaml file, k get secrets database-data -o yaml > secret.yaml let’s use an simple opaque example, and we can see the file apiVersion: v1 data: DB_PASSWORD: c2VjcmV0 kind: Secret metadata: creationTimestamp: "2024-12-29T20:17:39Z" name: database-data namespace: database-ns resourceVersion: "5076" uid: a7c50ba3-8945-4ba2-b40e-27e2ecb86f2b type: Opaque And the data is b...