题干
For this question, please set this context (In exam, diff cluster name)
kubectl config use-context kubernetes-admin@kubernetes
you have a script named pod-filter.sh . Update this script to include a command that filters and displays the label with the value application of a pod named nginx-pod using jsonpath only.
您有一个名为pod-filter.sh的脚本。更新此脚本以包含一个命令,该命令仅使用jsonpath过滤并显示名为
nginx-pod
的pod的值application
的标签。
解题思路
- 切换K8S集群环境ca
kubectl config use-context kubernetes-admin@kubernetes
- 按要求编写脚本
#!/bin/bash