Kubernetes Lessons for today
Today’s Kubernetes learnings focused on scheduling as well as labels and selectors.
Every pod has a field called nodeName
that by default is not set. The scheduler looks at all pods. If it finds one that does not have this field property set, it will rely on the scheduling algorithm to find the right node for this pod. The scheduler will create a binding object and assign a node to the pod.
Labels are found under the metadata
section in a definition file. They are essential to configuring Kubernetes and we can setup configurations that leverage the labels. Here’s an example of how we might view pods with the label `app: App1’
kubectl get pods --selector app=App1