1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-28 10:47:23 +00:00

Merge pull request #161 from marquiz/feature/job-affinity

Use pod anti-affinity in the worker Job template spec
This commit is contained in:
Kubernetes Prow Robot 2019-06-21 09:13:47 -07:00 committed by GitHub
commit 7d6049e4d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -26,8 +26,6 @@ fi
NumNodes=$(kubectl get nodes | grep -i ' ready ' | wc -l)
# We set the .spec.completions and .spec.parallelism to the node count
# We request a specific hostPort in the job spec to limit the number of pods
# that run on a node to one. As a result, one pod runs on each node in parallel
# We set the NODE_NAME environment variable to get the Kubernetes node object.
sed -e "s/completions:.*$/completions: $NumNodes/" \
-e "s/parallelism:.*$/parallelism: $NumNodes/" \

View file

@ -15,6 +15,16 @@ spec:
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- node-feature-discovery
containers:
- env:
- name: NODE_NAME
@ -28,9 +38,6 @@ spec:
args:
- "--oneshot"
- "--server=nfd-master:8080"
ports:
- containerPort: 7156
hostPort: 7156
volumeMounts:
- name: host-boot
mountPath: "/host-boot"