Skip to content

Commit 9543385

Browse files
eddieesquivelkimoonkim
authored andcommitted
Update node affinity to K8s 1.6 spec (#12)
I'm proposing and edit to this file that is inline with the K8s 1.6 affinity spec.
1 parent 66a2138 commit 9543385

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,6 @@ spec:
2424
metadata:
2525
labels:
2626
name: hdfs-datanode
27-
annotations:
28-
# TODO: The following uses annotation to express affinity
29-
# because Kubernetes 1.5 supports affinity only in annotation as alpha
30-
# feature. In Kubernetes 1.6, this is now beta and supports regular
31-
# YAML construct. Switch to the official syntax when we support 1.6.
32-
scheduler.alpha.kubernetes.io/affinity: >
33-
{
34-
"nodeAffinity": {
35-
"requiredDuringSchedulingIgnoredDuringExecution": {
36-
"nodeSelectorTerms": [
37-
{
38-
"matchExpressions": [
39-
{
40-
"key": "hdfs-datanode-exclude",
41-
"operator": "DoesNotExist"
42-
}
43-
]
44-
}
45-
]
46-
}
47-
}
48-
}
4927
spec:
5028
hostNetwork: true
5129
hostPID: true
@@ -89,6 +67,13 @@ spec:
8967
- name: resolv-conf-volume
9068
mountPath: /etc/resolv.conf
9169
subPath: resolv.conf
70+
affinity:
71+
nodeAffinity:
72+
requiredDuringSchedulingIgnoredDuringExecution:
73+
nodeSelectorTerms:
74+
- matchExpressions:
75+
- key: hdfs-datanode-exclude
76+
operator: DoesNotExist
9277
restartPolicy: Always
9378
volumes:
9479
{{- range $index, $path := .Values.dataNodeHostPath }}

0 commit comments

Comments
 (0)