Problem scenario
You run a kubectl command on a YAML (.yml) file. But you get “Expected X selector labels”. What do you do?
Solution
Go to the “labels” and “matchlabels” sections of corresponding YAML files. Do you see “app:” or “environment:” stanzas? Are these consistently used in your YAML files? This error can happen if the YAML files are inconsistent with their “app:” and “environment:” stanzas.
…
Continue reading “How Do You Troubleshoot “Expected x selector labels” with Kubernetes?”