mjhea0 / efk-kubernetes

logging in kubernetes
51 stars 51 forks source link

fluentd-daemonset Selector missing in Kubernetes v1.16.0 #2

Open bailur opened 5 years ago

bailur commented 5 years ago

I get the following errors when running the yaml. C:\Program Files\Kubernetes\kubectl>kubectl create -f c:\Users\vikram\Documents\fluentd-daemonset.yaml error: unable to recognize "c:\Users\vikram\Documents\fluentd-daemonset.yaml": no matches for kind "DaemonSet" in version "extensions/v1beta1"

I tried updating the extensions/v1beta1 with apps/v1, but then get further errors

C:\Program Files\Kubernetes\kubectl>kubectl create -f c:\Users\vikram\Documents\fluentd-daemonset.yaml error: error validating "c:\Users\vikram\Documents\fluentd-daemonset.yaml": error validating data: ValidationError(DaemonSet.spec): missing required field "selector" in io.k8s.api.apps.v1.DaemonSetSpec; if you choose to ignore these errors, turn validation off with --validate=false

C:\Program Files\Kubernetes\kubectl>kubectl create -f c:\Users\vikram\Documents\fluentd-daemonset.yaml --validate=false The DaemonSet "fluentd" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"k8s-app":"fluentd-logging", "kubernetes.io/cluster-service":"true", "version":"v1"}: selector does not match template labels

anchalchaudhary commented 4 years ago

You'll need to add a selector under DaemonSet.spec as it is required if you've not turned off validation. In your fluentd-daemonset.yaml, under spec , add:

selector:
    matchLabels:
      k8s-app: fluentd-logging
ms-prasanth commented 4 years ago

Thanks anchalchaudhary Adding selector under DaemonSet.spec in the fluentd-daemonset.yaml, under spec solved the issue. Its worked. selector: matchLabels: k8s-app: fluentd-logging

yassine-jocker commented 3 years ago

You'll need to add a selector under DaemonSet.spec as it is required if you've not turned off validation. In your fluentd-daemonset.yaml, under spec , add:

selector:
    matchLabels:
      k8s-app: fluentd-logging

thank you very much