Skip to content

Commit 128d460

Browse files
authored
Merge pull request #94279 from jeana-redhat/OSDOCS-14842-CAPI-bare-metal-config-yaml
OSDOCS-14842: Adds bare metal Cluster API config assembly
2 parents 3573457 + 459d6df commit 128d460

File tree

7 files changed

+161
-2
lines changed

7 files changed

+161
-2
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,6 +2420,8 @@ Topics:
24202420
File: cluster-api-config-options-rhosp
24212421
- Name: Cluster API configuration options for VMware vSphere
24222422
File: cluster-api-config-options-vsphere
2423+
- Name: Cluster API configuration options for bare metal
2424+
File: cluster-api-config-options-bare-metal
24232425
# - Name: Cluster API resiliency and recovery
24242426
# File: cluster-api-resiliency
24252427
- Name: Troubleshooting Cluster API clusters

machine_management/applying-autoscaling.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ include::modules/cluster-autoscaler-cr.adoc[leveloffset=+3]
3232
include::modules/cluster-autoscaler-config-priority-expander.adoc[leveloffset=+3]
3333

3434
//Labeling GPU machine sets for the cluster autoscaler
35-
include::modules/machineset-label-gpu-autoscaler.adoc[leveloffset=+3]
35+
include::modules/machine-feature-agnostic-options-label-gpu-autoscaler.adoc[leveloffset=+3]
3636

3737
:FeatureName: cluster autoscaler
3838
:FeatureResourceName: ClusterAutoscaler
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="cluster-api-config-options-bare-metal"]
3+
= Cluster API configuration options for bare metal
4+
include::_attributes/common-attributes.adoc[]
5+
:context: cluster-api-config-options-bare-metal
6+
7+
toc::[]
8+
9+
You can change the configuration of your bare metal Cluster API machines by updating values in the Cluster API custom resource manifests.
10+
11+
:FeatureName: Managing machines with the Cluster API
12+
include::snippets/technology-preview.adoc[]
13+
14+
[id="cluster-api-sample-yaml-bare-metal_{context}"]
15+
== Sample YAML for configuring bare metal clusters
16+
17+
The following example YAML files show configurations for a bare metal cluster.
18+
19+
//Sample YAML for CAPI bare metal machine template resource
20+
include::modules/capi-yaml-machine-template-bare-metal.adoc[leveloffset=+2]
21+
22+
//Sample YAML for a CAPI bare metal compute machine set resource
23+
include::modules/capi-yaml-machine-set-bare-metal.adoc[leveloffset=+2]
24+
25+
[id="cluster-api-supported-features-bare-metal_{context}"]
26+
== Enabling bare metal features with the Cluster API
27+
28+
You can enable features by updating values in the Cluster API custom resource manifests.
29+
30+
// Cluster autoscaler GPU labels
31+
include::modules/machine-feature-agnostic-options-label-gpu-autoscaler.adoc[leveloffset=+2]
32+
33+
[role="_additional-resources"]
34+
.Additional resources
35+
* xref:../../../machine_management/applying-autoscaling.adoc#cluster-autoscaler-cr_applying-autoscaling[Cluster autoscaler resource definition]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/cluster_api_machine_management/cluster_api_provider_configurations/cluster-api-config-options-bare-metal.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="capi-yaml-machine-set-bare-metal_{context}"]
7+
= Sample YAML for a Cluster API compute machine set resource on bare metal
8+
9+
The compute machine set resource defines additional properties of the machines that it creates.
10+
The compute machine set also references the cluster resource and machine template when creating machines.
11+
12+
[source,yaml]
13+
----
14+
apiVersion: cluster.x-k8s.io/v1
15+
kind: MachineSet
16+
metadata:
17+
name: <machine_set_name> # <1>
18+
namespace: openshift-cluster-api
19+
labels:
20+
cluster.x-k8s.io/cluster-name: <cluster_name> # <2>
21+
spec:
22+
clusterName: <cluster_name>
23+
replicas: 1
24+
selector:
25+
matchLabels:
26+
test: example
27+
cluster.x-k8s.io/cluster-name: <cluster_name>
28+
cluster.x-k8s.io/set-name: <machine_set_name>
29+
template:
30+
metadata:
31+
labels:
32+
test: example
33+
cluster.x-k8s.io/cluster-name: <cluster_name>
34+
cluster.x-k8s.io/set-name: <machine_set_name>
35+
node-role.kubernetes.io/<role>: ""
36+
spec:
37+
bootstrap:
38+
dataSecretName: worker-user-data
39+
clusterName: <cluster_name>
40+
infrastructureRef:
41+
apiVersion: infrastructure.cluster.x-k8s.io/v1
42+
kind: Metal3MachineTemplate # <3>
43+
name: <template_name> # <4>
44+
----
45+
<1> Specify a name for the compute machine set.
46+
The cluster ID, machine role, and region form a typical pattern for this value in the following format: `<cluster_name>-<role>-<region>`.
47+
<2> Specify the cluster ID as the name of the cluster.
48+
<3> Specify the machine template kind.
49+
This value must match the value for your platform.
50+
<4> Specify the machine template name.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/cluster_api_machine_management/cluster_api_provider_configurations/cluster-api-config-options-bare-metal.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="capi-yaml-machine-template-bare-metal_{context}"]
7+
= Sample YAML for a Cluster API machine template resource on bare metal
8+
9+
The machine template resource is provider-specific and defines the basic properties of the machines that a compute machine set creates.
10+
The compute machine set references this template when creating machines.
11+
12+
[source,yaml]
13+
----
14+
apiVersion: infrastructure.cluster.x-k8s.io/v1
15+
kind: Metal3MachineTemplate # <1>
16+
metadata:
17+
name: <template_name> # <2>
18+
namespace: openshift-cluster-api
19+
spec:
20+
template:
21+
spec: # <3>
22+
customDeploy: install_coreos
23+
userData: worker-user-data
24+
----
25+
<1> Specify the machine template kind.
26+
This value must match the value for your platform.
27+
<2> Specify a name for the machine template.
28+
<3> Specify the details for your environment.
29+
The values here are examples.

modules/cluster-autoscaler-cr.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ spec:
5353
<7> Optional: To configure the cluster autoscaler to deploy GPU-enabled nodes, specify a `type` value.
5454
This value must match the value of the `spec.template.spec.metadata.labels[cluster-api/accelerator]` label in the machine set that manages the GPU-enabled nodes of that type.
5555
For example, this value might be `nvidia-t4` to represent Nvidia T4 GPUs, or `nvidia-a10g` for A10G GPUs.
56-
For more information, see "Labeling GPU machine sets for the cluster autoscaler".
56+
For more information, see "Cluster autoscaler GPU labels".
5757
<8> Specify the minimum number of GPUs of the specified type to deploy in the cluster.
5858
<9> Specify the maximum number of GPUs of the specified type to deploy in the cluster.
5959
<10> Specify the logging verbosity level between `0` and `10`. The following log level thresholds are provided for guidance:
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * machine_management/applying-autoscaling.adoc
4+
// * machine_management/cluster_api_machine_management/cluster_api_provider_configurations/cluster-api-config-options-aws.adoc
5+
6+
:_mod-docs-content-type: CONCEPT
7+
[id="machine-feature-agnostic-options-label-gpu-autoscaler_{context}"]
8+
= Cluster autoscaler GPU labels
9+
10+
You can indicate machines that the cluster autoscaler can deploy GPU-enabled nodes on by adding parameters to a compute machine set custom resource (CR).
11+
12+
.Sample cluster autoscaler GPU label
13+
[source,yaml]
14+
----
15+
apiVersion: <api_group_version> # <1>
16+
kind: MachineSet
17+
# ...
18+
spec:
19+
template:
20+
spec:
21+
metadata:
22+
labels:
23+
cluster-api/accelerator: <gpu_type> # <2>
24+
# ...
25+
----
26+
<1> Specifies the API group and version of the machine set.
27+
The following values are valid:
28+
`cluster.x-k8s.io/v1beta1`:: The API group and version for Cluster API machine sets.
29+
`machine.openshift.io/v1beta1`:: The API group and version for Machine API machine sets.
30+
<2> Specifies a label to use for GPU-enabled nodes.
31+
The label must use the following format:
32+
+
33+
--
34+
* Consists of alphanumeric characters, `-`, `_`, or `.`.
35+
* Starts and ends with an alphanumeric character.
36+
--
37+
For example, this value might be `nvidia-t4` to represent Nvidia T4 GPUs, or `nvidia-a10g` for A10G GPUs.
38+
+
39+
[NOTE]
40+
====
41+
You must also specify the value of this label for the `spec.resourceLimits.gpus.type` parameter in your `ClusterAutoscaler` CR.
42+
For more information, see "Cluster autoscaler resource definition".
43+
====

0 commit comments

Comments
 (0)