Using Node Labels¶
Overview¶
Kubernetes labels enable you to manage cluster node workloads by scheduling Pods on specific sets of nodes. To ensure the Service Proxy Traffic Management Microkernel (TMM) Pods operate at optimal performance, apply a unique label to cluster nodes with high resource availability, and use the nodeSelector
parameter to select that set of nodes when installing the Ingress Controller.
This document guides you through applying a label to a set of cluster nodes, and using the nodeSelector
parameter to select the nodes.
Procedure¶
In this procedure, a unique label is applied to three cluster nodes, and the nodeSelector
parameter is added to the Ingress Controller Helm values file.
Label cluster nodes:
kubectl label nodes <node-1> <node-2> <node-3> <label>
In this example, the cluster nodes are labeled spk=tmm:
kubectl label nodes worker-1 worker-2 worker-3 spk=tmm
View the labeled nodes:
kubectl get nodes -l <label>
In this example, the nodes worker-1, worker-2, and worker-3 are list using the label spk=tmm:
kubectl get nodes -l spk=tmm
NAME STATUS ROLES AGE VERSION worker-1 Ready <none> 89d v1.20.4 worker-2 Ready <none> 89d v1.20.4 worker-3 Ready <none> 89d v1.20.4
Add the
nodeSelector
parameter to the Ingress Controller Helm values file:Note: Kubernetes labels are actually Key/Value pairs.
tmm: nodeSelector: key: "value"
In this example, the
nodeSelector
is configured to select the label spk: “tmm”:tmm: nodeSelector: spk: "tmm"
You can now deploy the Ingress Controller to the designated cluster nodes.
Verify the Service Proxy TMM has installed to the proper node:
oc get pods -n <project> -o wide
In this example, the TMM Pod is in the spk-ingress project, and has installed to proper cluster node:
kubectl get pods -n spk-ingress -o wide
NAME READY STATUS IP NODE f5-ingress-f5ingress-59cfd4dcdd-nwwpj 2/2 Running 10.244.3.110 worker-1 f5-tmm-7676db577f-725lx 5/5 Running 10.244.2.132 worker-2
Feedback¶
Provide feedback to improve this document by emailing spkdocs@f5.com.