Skip to content

Commit a3ba071

Browse files
committed
Put podAntiAffinity in PodSpec.
1 parent e504d4f commit a3ba071

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

cockroachdb/cockroachdb-statefulset.yaml

+12-16
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,6 @@ spec:
7878
labels:
7979
app: cockroachdb
8080
annotations:
81-
scheduler.alpha.kubernetes.io/affinity: >
82-
{
83-
"podAntiAffinity": {
84-
"preferredDuringSchedulingIgnoredDuringExecution": [{
85-
"weight": 100,
86-
"labelSelector": {
87-
"matchExpressions": [{
88-
"key": "app",
89-
"operator": "In",
90-
"values": ["cockroachdb"]
91-
}]
92-
},
93-
"topologyKey": "kubernetes.io/hostname"
94-
}]
95-
}
96-
}
9781
# Init containers are run only once in the lifetime of a pod, before
9882
# it's started up for the first time. It has to exit successfully
9983
# before the pod's main containers are allowed to start.
@@ -133,6 +117,18 @@ spec:
133117
}
134118
]'
135119
spec:
120+
affinity:
121+
podAntiAffinity:
122+
preferredDuringSchedulingIgnoredDuringExecution:
123+
- weight: 100
124+
podAffinityTerm:
125+
labelSelector:
126+
matchExpress:
127+
- key: app
128+
operator: In
129+
values:
130+
- cockroachdb
131+
topologyKey: kubernetes.io/hostname
136132
containers:
137133
- name: cockroachdb
138134
# Runs the master branch. Not recommended for production, but since

0 commit comments

Comments
 (0)