In the pods definition, we add the nodeSelector as a child of spec. But I'm not sure how to add this in deployment yaml file
are we supposed to add it in the template's spec-
apiVersion: apps/v1
kind: Deployment
metadata:
name: first-deployment
labels:
app: first
spec:
replicas: 1
template:
metadata:
name: first-deployment-pod
label:
app: first
spec:
containers:
- name: test
image: test/test
nodeSelector:
testkey: testvalue
or do we need to add it in the spec of the deplyment -
apiVersion: apps/v1
kind: Deployment
metadata:
name: first-deployment
labels:
app: first
spec:
replicas: 1
nodeSelector:
testkey: testvalue
template:
metadata:
name: first-deployment-pod
label:
app: first
spec:
containers:
- name: test
image: test/test
It should be at the same level than your containers array: