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.

  1. Label cluster nodes:

    kubectl label nodes <node-1> <node-2> <node-3> <label>
    

    In this example, the cluster nodes are labeled cnf=tmm:

    kubectl label nodes worker-1 worker-2 worker-3 cnf=tmm
    
  2. 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 cnf=tmm:

    kubectl get nodes -l cnf=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
    
  3. Add the nodeSelector parameter to the Ingress Controller Helm values file:

    _images/spk_info.png Note: Kubernetes labels are actually Key/Value pairs.

    tmm:
      nodeSelector:
        key: "value"
    

    In this example, the nodeSelector is configured to select the label cnf: “tmm”:

    tmm:
      nodeSelector:
        cnf: "tmm"
    
  4. You can now deploy the Ingress Controller to the designated cluster nodes.

  5. Verify the Service Proxy TMM has installed to the proper node:

    oc get get pods -n <project> -o wide
    

    In this example, the TMM Pod is in the cnf-gateway namespace, and has installed to proper cluster node:

    kubectl get pods -n cnf-gateway -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 cnfdocs@f5.com.