ad66a50f3a
In addition to a couple of k8s questions.
771 B
771 B
Node Selectors
Objectives
- Apply the label "hw=max" on one of the nodes in your cluster
- Create and run a Pod called
some-pod
with the imageredis
and configure it to use the selectorhw=max
- Explain why node selectors might be limited
Solution
Click here to view the solution
kubectl label nodes some-node hw=max
kubectl run some-pod --image=redis --dry-run=client -o yaml > pod.yaml
vi pod.yaml
spec:
nodeSelector:
hw: max
kubectl apply -f pod.yaml
- Assume you would like to run your Pod on all the nodes with with either
hw
set to max or to min, instead of just max. This is not possible with nodeSelectors which are quite simplified and this is where you might want to considernode affinity
.