# Before applying manifest, labeling to nodes with kubectl, since manifests for node might cause unschedulable cluster
#   kubectl label node/FIRST_NODE_NAME node=primary-node
#   kubectl label node/SECOND_NODE_NAME node=secondary-node
#   kubectl label node/THIRD_NODE_NAME node=third-node
#   kubectl get nodes -L node

---
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - image: nginx
    name: nginx
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: node
            operator: In
            values: ["secondary-node"]

# After applying manifest with kubectl: 
#   kubectl get pods -o wide
# and conifrm nginx pod is running on the nodes with node=secondary label
