Add selector to StatefulSet definition (#2011)

This adds the `selector` to the Patroni Kubernetes StatefulSet spec

Without it, one gets errors like
```
error: error validating "patroni_k8s.yaml": error validating data: ValidationError(StatefulSet.spec): missing required field "selector" in io.k8s.api.apps.v1.StatefulSetSpec; if you choose to ignore these errors, turn validation off with --validate=false
```
(as mentioned in #1867)
This commit is contained in:
Michael Banck
2021-07-21 08:35:51 +02:00
committed by GitHub
parent 9288ce066b
commit 415180048a
+4
View File
@@ -20,6 +20,10 @@ metadata:
spec: spec:
replicas: 3 replicas: 3
serviceName: *cluster_name serviceName: *cluster_name
selector:
matchLabels:
application: patroni
cluster-name: *cluster_name
template: template:
metadata: metadata:
labels: labels: