Lab Q? I'm doing Practice Test - Node Affinity, not able to complet q6

Sreedhar B Narayanaswamy:
Lab Q? I’m doing Practice Test - Node Affinity, not able to complet q6.

Sreedhar B Narayanaswamy:

Sreedhar B Narayanaswamy:
let me know if I’m doing any mistake.

Vasu P:
Please check the indentation. affinity should be child of specs. In your config it is added inside container

Mohamed Ayman:
Try this please

apiVersion: apps/v1
kind: Deployment
metadata:
name: blue
spec:
replicas: 3
selector:
matchLabels:
run: nginx
template:
metadata:
labels:
run: nginx
spec:
containers:
- image: nginx
imagePullPolicy: Always
name: nginx
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: color
operator: In
values:
- blue