pires / kubernetes-elasticsearch-cluster

Elasticsearch cluster on top of Kubernetes made easy.
Apache License 2.0
1.51k stars 690 forks source link

Missing required field "selector" in io.k8s.api.apps.v1.StatefulSetSpec #220

Closed paulavijit closed 6 years ago

paulavijit commented 6 years ago

Executing: kubectl apply -f es-master-stateful.yaml

Results in error: error: error validating "es-master-stateful.yaml": error validating data: [ValidationError(StatefulSet.spec): missing required field "selector" in io.k8s.api.apps.v1.StatefulSetSpec, ValidationError(StatefulSet.spec): missing required field "serviceName" in io.k8s.api.apps.v1.StatefulSetSpec]; if you choose to ignore these errors, turn validation off with --validate=false

pires commented 6 years ago

Please, open a PR with a fix ;)

charlenezheng commented 5 years ago

It can be solved when you add these labels into your yaml file. For example: for "missing required field 'selector' ": you can add selector with matchLabels, like: (sorry I dont know how to indent, please assume there are 2 spaces each line) selector: matchLabels: app: something