diff --git a/examples/cockroachdb/cockroachdb-statefulset.yaml b/examples/cockroachdb/cockroachdb-statefulset.yaml index 7bb06e7d628..d3c1d856742 100644 --- a/examples/cockroachdb/cockroachdb-statefulset.yaml +++ b/examples/cockroachdb/cockroachdb-statefulset.yaml @@ -93,24 +93,23 @@ spec: image: cockroachdb/cockroach-k8s-init:0.1 imagePullPolicy: IfNotPresent args: - - "-on-start=/on-start.sh" - - "-service=cockroachdb" + - "-on-start=/on-start.sh" + - "-service=cockroachdb" env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - volumeMounts: - - name: datadir - mountPath: "/cockroach/cockroach-data" + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + volumeMounts: + - name: datadir + mountPath: "/cockroach/cockroach-data" affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: - matchExpress: + matchExpressions: - key: app operator: In values: diff --git a/test/e2e/testing-manifests/statefulset/cockroachdb/statefulset.yaml b/test/e2e/testing-manifests/statefulset/cockroachdb/statefulset.yaml index 4632fb165d6..e9843934df8 100644 --- a/test/e2e/testing-manifests/statefulset/cockroachdb/statefulset.yaml +++ b/test/e2e/testing-manifests/statefulset/cockroachdb/statefulset.yaml @@ -23,6 +23,7 @@ spec: initContainers: - name: bootstrap image: cockroachdb/cockroach-k8s-init:0.1 + imagePullPolicy: IfNotPresent args: - "-on-start=/on-start.sh" - "-service=cockroachdb" @@ -30,11 +31,22 @@ spec: - name: POD_NAMESPACE valueFrom: fieldRef: - apiVersion: v1 fieldPath: metadata.namespace volumeMounts: - name: datadir mountPath: "/cockroach/cockroach-data" + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - cockroachdb + topologyKey: kubernetes.io/hostname containers: - name: cockroachdb # Runs the master branch. Not recommended for production, but since