Skip to content

Commit fe11368

Browse files
authored
Merge pull request #32491 from stemid/patch-1
Cheatsheet syntax to retrieve Secret values with dashes (-) in their key names
2 parents 4e1461d + dd9061e commit fe11368

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

content/en/docs/reference/kubectl/cheatsheet.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ kubectl get pods --selector=app=cassandra -o \
187187
kubectl get configmap myconfig \
188188
-o jsonpath='{.data.ca\.crt}'
189189

190+
# Retrieve a base64 encoded value with dashes instead of underscores.
191+
kubectl get secret my-secret --template='{{index .data "key-name-with-dashes"}}'
192+
190193
# Get all worker nodes (use a selector to exclude results that have a label
191194
# named 'node-role.kubernetes.io/control-plane')
192195
kubectl get node --selector='!node-role.kubernetes.io/control-plane'

0 commit comments

Comments
 (0)