Skip to content

Commit

Permalink
Update node affinity to K8s 1.6 spec (apache-spark-on-k8s#12)
Browse files Browse the repository at this point in the history
I'm proposing and edit to this file that is inline with the K8s 1.6 affinity spec.
  • Loading branch information
eddieesquivel authored and kimoonkim committed Jul 31, 2017
1 parent 66a2138 commit 9543385
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,6 @@ spec:
metadata:
labels:
name: hdfs-datanode
annotations:
# TODO: The following uses annotation to express affinity
# because Kubernetes 1.5 supports affinity only in annotation as alpha
# feature. In Kubernetes 1.6, this is now beta and supports regular
# YAML construct. Switch to the official syntax when we support 1.6.
scheduler.alpha.kubernetes.io/affinity: >
{
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "hdfs-datanode-exclude",
"operator": "DoesNotExist"
}
]
}
]
}
}
}
spec:
hostNetwork: true
hostPID: true
Expand Down Expand Up @@ -89,6 +67,13 @@ spec:
- name: resolv-conf-volume
mountPath: /etc/resolv.conf
subPath: resolv.conf
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: hdfs-datanode-exclude
operator: DoesNotExist
restartPolicy: Always
volumes:
{{- range $index, $path := .Values.dataNodeHostPath }}
Expand Down

0 comments on commit 9543385

Please sign in to comment.