k8s error spec.selector: Required value, spec.template.metadata.labels:
This is a quite common error that i bump into while trying to use istioctl kube-inject cli to parse my deployment with envoy sidecar.
Error from server (Invalid): error when creating ".\\app-ready.yaml": Deployment.apps "service-one" is invalid: [spec.selector: Required value, spec.template.metadata.labels: Invalid value: map[string]string{"app":"service-one", "security.istio.io/tlsMode":"istio", "service.istio.io/canonical-name":"service-one", "service.istio.io/canonical-revision":"latest"}: `selector` does not match template `labels`]
Found out that my Deployment -> Spec -> selector is null
To resolve this i simply had to add it back in as shown below:-
For the record my original yaml does have this value. It just that istioctl has a weird way of parsing my yaml.
Comments