Hi team, From the lightning lab, last question, I am not able to get it pass. He . . .

Mayur Sharma:
Hi team, From the lightning lab, last question, I am not able to get it pass. Here is the redis.yaml. can someone please review and let me know where is the problem.
Also, deployments and pod are running good on master node only.
{code}
controlplane $ cat redis.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: redis
name: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
strategy: {}
template:
metadata:
labels:
app: redis
spec:
nodeName: controlplane
tolerations:
- key: “http://node-role.kubernetes.io/master|node-role.kubernetes.io/master
operator: “Exists”
effect: “NoSchedule”
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: http://node-role.kubernetes.io/master|node-role.kubernetes.io/master
operator: Exists
volumes:
- name: data
emptyDir: {}
- name: cm-vol
configMap:
name: redis-config
containers:
- image: redis:alpine
name: redis
volumeMounts:
- name: data
mountPath: /redis-master-data
- name: cm-vol
mountPath: /redis-master
ports:
- containerPort: 6379
resources:
requests:
cpu: .2
{code}

Thanks in advanc!

Mohamed Ayman:
You can check /var/answers Path to validate your answer.

Mohamed Ayman:
You need just to edit /var/answers/answer-5.yaml to use controlplane.

spec:
  nodeSelector:
    <http://kubernetes.io/hostname|kubernetes.io/hostname>: controlplane

Mohamed Ayman:
Then create the deployment:
kubectl create -f /var/answers/answer-5.yaml

Mayur Sharma:
Thanks @Mohamed Ayman for the response, For scheduling the pod, I am using tolerations and nodeaffinity and looks the pod is scheduled on master node as well.

am I doing something wrong or answer would be accepted only if I use nodeSelector.