File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
content/zh-cn/docs/reference/kubectl Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,9 @@ kubectl get pods --selector=app=cassandra -o \
334
334
kubectl get configmap myconfig \
335
335
-o jsonpath='{.data.ca\.crt}'
336
336
337
+ # Retrieve a base64 encoded value with dashes instead of underscores.
338
+ kubectl get secret my-secret --template='{{index .data "key-name-with-dashes"}}'
339
+
337
340
# Get all worker nodes (use a selector to exclude results that have a label
338
341
# named 'node-role.kubernetes.io/control-plane')
339
342
kubectl get node --selector='!node-role.kubernetes.io/control-plane'
@@ -417,6 +420,9 @@ kubectl get pods --selector=app=cassandra -o \
417
420
kubectl get configmap myconfig \
418
421
-o jsonpath=' {.data.ca\.crt}'
419
422
423
+ # 检索一个 base64 编码的值,其中的键名应该包含减号而不是下划线。
424
+ kubectl get secret my-secret --template=' {{index .data "key-name-with-dashes"}}'
425
+
420
426
# 获取所有工作节点(使用选择器以排除标签名称为 'node-role.kubernetes.io/control-plane' 的结果)
421
427
kubectl get node --selector=' !node-role.kubernetes.io/control-plane'
422
428
You can’t perform that action at this time.
0 commit comments