Building applications often requires pulling various dependencies. Issues such as long pull times or unstable networks may arise during this process, potentially leading to build failures. To provide a more reliable and stable environment, you can configure nodes or node groups specifically for Continuous Integration (CI) and accelerate the build process by using caching.

This document demonstrates how to set up CI nodes so that KubeSphere schedules pipeline tasks to these nodes.

Prerequisites

You need to have Cluster Management permissions on the KubeSphere platform.

Label CI Nodes

  1. Log in to the KubeSphere web console with an account that has Cluster Management permissions.

  2. Click Cluster Management and enter a cluster.

  3. In the left navigation pane, select Cluster Nodes under Nodes to view the existing nodes in the current cluster.

  4. Select a node from the list to run CI tasks. Click the node name to go to its details page, then click Operation > Edit Labels.

  5. In the dialog box that appears, after the key node-role.kubernetes.io/worker, enter ci as the value for this label, and click OK.

Add Taints to CI Nodes

Pipelines typically determine whether to schedule tasks to a node based on node affinity. If you want to dedicate a node to CI tasks, meaning you do not want other workloads scheduled to this node, you can add a taint to the node.

  1. Click Operation > Edit Taints.

  2. Click Add, enter the key node.kubernetes.io/ci without specifying a value. Select Prefer No Schedule, No Schedule, or No Execute as needed.

  3. Click OK. KubeSphere will schedule tasks based on the taint you set.