Set CI Node for Dependency Cache
Introduction
Generally, applications often need to pull a lot of dependencies during the build process. It might cause some issues like long pulling time, or unstable network causing failure. In order to make build robust, and to speed up the build by using cache, we recommend you configure one or a set of CI nodes which the system schedules the task of CI/CD pipelines or S2I/B2I builds running on.
Label CI Nodes
- Log in KubeSphere with
admin
account, navigate to Platform → Infrastructure.
- Choose any of nodes as the CI running nodes, here we choose
node2
and enter its detailed page. Click More → Edit Labels.
- Click Add Labels, add a new label with key
node-role.kubernetes.io/worker
and valueci
, click Save.
Note the node may already have the key with empty value. You can just change the value to
ci
.
Set CI Nodes Dedicated
Basically, pipelines and S2I/B2I workflows will be scheduled to this node according to the Node affinity. If you want to make CI nodes as the dedicated ones, which means these nodes are not allowed other workloads to be scheduled to them, you can follow with the steps below to set Taint.
- Click More → Taint Management.
- Click Add Taint, enter a key
node.kubernetes.io/ci
without specifying value. You can chooseNoSchedule
orPreferNoSchedule
at your will.
- Click Save. At this point, you have completed the CI node settings. You can go back to work on your DevOps pipeline.