我正在以下 URL 学习 Kubernetes Label Selector。
\nhttps://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
\n\n\n基于集合的标签要求允许根据一组值过滤键。支持三种运算符:in、notin 和exists(仅限键标识符)。例如:
\n
! partition\nRun Code Online (Sandbox Code Playgroud)\n\n\n第四个(这个)示例选择所有没有带有键分区标签的资源;未检查值 \xe2\x80\x8b\xe2\x80\x8bar。
\n
我的假设是,如果我指定“!test”,则所有 pod 都会输出,\n我认为指定“!app”时不会输出任何内容。
\n我想排除此处描述的示例中的密钥和输出,但未获得预期结果。
\nMy @ Pc: ~ / Understanding-K8s / chap04 $ kubectl get pod -l! app\nMy@Pc:~/Understanding-K8s/chap04$ kubectl get pod -l !app\n-bash: !app: event not found\nMy@Pc:~/Understanding-K8s/chap04$ kubectl get pod -l "!app"\n-bash: !app: event not found\nMy@Pc:~/Understanding-K8s/chap04$ kubectl get pod -l "!test"\n-bash: !test: event not found\nMy@Pc:~/Understanding-K8s/chap04$ kubectl get pod -l !test\n-bash: !test: event not found\n\n …Run Code Online (Sandbox Code Playgroud)