From 829fe9940c228607273b3a0ade6209a69b4765f8 Mon Sep 17 00:00:00 2001 From: Laura Hinson Date: Fri, 6 Sep 2024 14:26:00 -0400 Subject: [PATCH] Adding custom taints and tolerations docs to HCP --- .../hcp-prepare/hcp-distribute-workloads.adoc | 3 +- modules/hcp-virt-taints-tolerations.adoc | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 modules/hcp-virt-taints-tolerations.adoc diff --git a/hosted_control_planes/hcp-prepare/hcp-distribute-workloads.adoc b/hosted_control_planes/hcp-prepare/hcp-distribute-workloads.adoc index e776daaeeed9..fa054d68977d 100644 --- a/hosted_control_planes/hcp-prepare/hcp-distribute-workloads.adoc +++ b/hosted_control_planes/hcp-prepare/hcp-distribute-workloads.adoc @@ -22,4 +22,5 @@ Do not use the management cluster for your workload. Workloads must not run on n ==== include::modules/hcp-labels-taints.adoc[leveloffset=+1] -include::modules/hcp-priority-classes.adoc[leveloffset=+1] \ No newline at end of file +include::modules/hcp-priority-classes.adoc[leveloffset=+1] +include::modules/hcp-virt-taints-tolerations.adoc[leveloffset=+1] \ No newline at end of file diff --git a/modules/hcp-virt-taints-tolerations.adoc b/modules/hcp-virt-taints-tolerations.adoc new file mode 100644 index 000000000000..3f6d5367fe7c --- /dev/null +++ b/modules/hcp-virt-taints-tolerations.adoc @@ -0,0 +1,34 @@ +// Module included in the following assemblies: +// +// * hosted_control_planes/hcp-prepare/hcp-distribute-workloads.adoc + +:_mod-docs-content-type: CONCEPT +[id="hcp-virt-taints-tolerations_{context}"] += Custom taints and tolerations + +For {hcp} on {VirtProductName}, by default, pods for a hosted cluster tolerate the `control-plane` and `cluster` taints. However, you can also use custom taints on nodes so that hosted clusters can tolerate those taints on a per-hosted-cluster basis by setting `HostedCluster.spec.tolerations`. + +:FeatureName: Passing tolerations for a hosted cluster +include::snippets/technology-preview.adoc[] + +.Example configuration +[source,yaml] +---- + spec: + tolerations: + - effect: NoSchedule + key: kubernetes.io/custom + operator: Exists +---- + +You can also set tolerations on the hosted cluster while you create a cluster by using the `--tolerations` hcp CLI argument. + +.Example CLI argument +[source,terminal] +---- +--toleration="key=kubernetes.io/custom,operator=Exists,effect=NoSchedule" +---- + +For fine granular control of hosted cluster pod placement on a per-hosted-cluster basis, use custom tolerations with `nodeSelectors`. You can co-locate groups of hosted clusters and isolate them from other hosted clusters. You can also place hosted clusters in infra and control plane nodes. + +Tolerations on the hosted cluster spread only to the pods of the control plane. To configure other pods that run on the management cluster and infrastructure-related pods, such as the pods to run virtual machines, you need to use a different process. \ No newline at end of file