Skip to content

Latest commit

 

History

History
99 lines (70 loc) · 3.67 KB

edge-workload-prevent.md

File metadata and controls

99 lines (70 loc) · 3.67 KB
copyright lastupdated keywords subcollection
years
2024, 2024
2024-07-24
openshift, kubernetes, affinity, taint, edge node, edge
openshift

{{site.data.keyword.attribute-definition-list}}

Preventing app workloads from running on edge worker nodes

{: #edge-workload-prevent}

A benefit of edge worker nodes is that they can be specified to run networking services only. {: shortdesc}

You can prevent workloads from running on edge worker nodes and consuming worker node resources by using Kubernetes taints{: external}.

Before you begin

  1. Create a worker pool with the label dedicated=edge or add the label to one of your existing worker pools.

    • To create a Classic worker pool, you can use the worker-pool create classic command.

      ibmcloud oc worker-pool create classic --name POOL_NAME --cluster CLUSTER --flavor FLAVOR --size-per-zone WORKERS_PER_ZONE --hardware ISOLATION --label dedicated=edge

      {: pre}

    • To create a VPC worker pool, you can use the worker-pool create vpc-gen2 command.

      ibmcloud oc worker-pool create vpc-gen2 --name POOL_NAME --cluster CLUSTER --flavor FLAVOR --size-per-zone WORKERS_PER_ZONE --hardware ISOLATION --label dedicated=edge

      {: pre}

    • To label an existing worker pool, you can use the worker-pool label set command.

      ibmcloud oc worker-pool label set --cluster CLUSTER --worker-pool POOL --label dedicated=edge

      {: pre}

  2. Verify that the worker pool and worker nodes have the dedicated=edge label.

    • To check the worker pool, use the get command.

      ibmcloud oc worker-pool get --cluster <cluster_name_or_ID> --worker-pool <worker_pool_name_or_ID>

      {: pre}

    • To check individual worker nodes, review the Labels field of the output of the following command.

      oc describe node <worker_node_private_IP>

      {: pre}

  3. Apply a taint to the worker nodes with the dedicated=edge label. The taint prevents pods from running on the worker node and removes pods that don't have the dedicated=edge label from the worker node. The pods that are removed are redeployed to other worker nodes with capacity.

    To apply a taint to all existing and future worker nodes in a worker pool:

    ibmcloud oc worker-pool taint set -c <cluster_name_or_ID> --worker-pool <worker_pool_name_or_ID> --taint dedicated=edge:NoExecute

    {: pre}

    To apply a taint to individual worker nodes:

    oc adm taint node -l dedicated=edge dedicated=edge:NoExecute

    {: pre}

    Now, only pods with the dedicated=edge toleration are deployed to your edge worker nodes.

  4. Verify that your edge nodes are tainted.

    oc describe nodes -l dedicated=edge | egrep "Taints|Hostname"

    {: pre}

    Example output

    Taints:             dedicated=edge:NoExecute
        Hostname:    10.176.48.83
      Taints:             dedicated=edge:NoExecute
    Hostname:    10.184.58.7

    {: screen}