freegroup / kube-s3

Kubernetes pods used shared S3 storage
MIT License
208 stars 67 forks source link

Indentation issue in the daemonset YAML file #13

Closed virendrasuryavanshi closed 3 years ago

virendrasuryavanshi commented 3 years ago

There is an indentation issue in the daemonset.yaml file which results in the following errors

error: error validating "daemonset.yaml": error validating data: [ValidationError(DaemonSet.spec): unknown field "matchLabels" in io.k8s.api.apps.v1.DaemonSetSpec, 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

So, if we try to ignore these errors it results in following error

kubectl apply -f daemonset.yaml --validate=false

The DaemonSet "s3-provider" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"app":"s3-provider"}: `selector` does not match template `labels`

Just update the snippet before the spec in daemonset.yaml file with the below snippet to resolve it

apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    app: s3-provider
  name: s3-provider
spec:
  selector:
    matchLabels:
      app: s3-provider
  template:
    metadata:
      labels:
        app: s3-provider
freegroup commented 3 years ago

fixed. Thanks for your bug report