draios/sysdig-cloud-scripts

DaemonSet Labels Invalid Value

nyulawbrian opened this issue · 1 comments

kubectl returns the following error when trying to apply sysdig-agent-daemonset-v2.yaml.

The DaemonSet "sysdig-agent" is invalid:
spec.template.metadata.labels: Invalid value: map[string]string{"app":"sysdig-agent"}: selector does not match template labels
spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"sysdig-agent", "name":"sysdig-agent"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

According to Kubernetes documentation the Selector and Template labels should be name, as per below, but the file as provided uses app.

spec:
  selector:
    matchLabels:
      name: sysdig-agent
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: sysdig-agent

I experienced this on a fairly vanilla installation of Kubernetes v1.14.

Can you try with daemonset v1 for that k8s version? New ones should work with v2 but maybe 1.14 it's too old for the latest changes done there. Thanks!