Skip to content

Commit d7dd5ba

Browse files
committed
[OSDOCS-15316]: Creating a hosted cluster on bare metal
1 parent ac83941 commit d7dd5ba

15 files changed

+340
-53
lines changed

hosted_control_planes/hcp-deploy/hcp-deploy-bm.adoc

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The {mce-short} supports only the default `local-cluster`, which is a hub cluste
1919

2020
A _hosted cluster_ is an {product-title} cluster with its API endpoint and control plane that are hosted on the management cluster. The hosted cluster includes the control plane and its corresponding data plane. You can use the {mce-short} console or the hosted control plane command-line interface, `hcp`, to create a hosted cluster.
2121

22-
The hosted cluster is automatically imported as a managed cluster. If you want to disable this automatic import feature, see _Disabling the automatic import of hosted clusters into {mce-short}_.
22+
The hosted cluster is automatically imported as a managed cluster. If you want to disable this automatic import feature, see "Disabling the automatic import of hosted clusters into {mce-short}".
2323

2424
include::modules/hcp-bm-prepare.adoc[leveloffset=+1]
2525
include::modules/hcp-bm-prereqs.adoc[leveloffset=+2]
@@ -48,23 +48,47 @@ include::modules/hcp-bm-infra-reqs.adoc[leveloffset=+2]
4848
include::modules/hcp-bm-dns.adoc[leveloffset=+1]
4949
include::modules/hcp-custom-dns.adoc[leveloffset=+2]
5050

51-
include::modules/hcp-bm-hc.adoc[leveloffset=+1]
51+
include::modules/hcp-bm-add-nodes-to-inventory.adoc[leveloffset=+1]
52+
53+
[id="hcp-bm-create-hc"]
54+
== Creating a hosted cluster on bare metal
55+
56+
When you create a hosted cluster with the Agent platform, the HyperShift Operator installs the Agent Cluster API provider in the hosted control plane namespace. You can create a hosted cluster on bare metal or you can import one.
57+
58+
include::modules/hcp-bm-hc.adoc[leveloffset=+2]
5259

5360
[role="_additional-resources"]
5461
.Additional resources
5562
* xref:../../hosted_control_planes/hcp-import.adoc[Manually importing a hosted cluster]
63+
* link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#configure-hosted-disconnected-digest-image[Extracting the {product-title} release image digest]
5664

5765
include::modules/hcp-bm-hc-console.adoc[leveloffset=+2]
5866

59-
.Next steps
60-
* To access the web console, see xref:../../web_console/web-console.adoc#web-console-overview[Accessing the web console].
67+
[role="_additional-resources"]
68+
.Additional resources
69+
* xref:../../web_console/web-console.adoc#web-console-overview[Accessing the web console]
6170

6271
include::modules/hcp-bm-hc-mirror.adoc[leveloffset=+2]
6372

64-
.Next steps
65-
* To create credentials that you can reuse when you create a hosted cluster with the console, see link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#creating-a-credential-for-an-on-premises-environment[Creating a credential for an on-premises environment].
66-
* To access a hosted cluster, see xref:../../hosted_control_planes/hcp-manage/hcp-manage-bm.adoc#hcp-bm-access_hcp-manage-bm[Accessing the hosted cluster].
67-
* To add hosts to the host inventory by using the Discovery Image, see link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#add-host-host-inventory[Adding hosts to the host inventory by using the Discovery Image].
68-
* To extract the {product-title} release image digest, see link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#configure-hosted-disconnected-digest-image[Extracting the {product-title} release image digest].
73+
[role="_additional-resources"]
74+
.Additional resources
75+
* link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#creating-a-credential-for-an-on-premises-environment[Creating a credential for an on-premises environment]
76+
* link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#add-host-host-inventory[Adding hosts to the host inventory by using the Discovery Image]
6977

7078
include::modules/hcp-bm-verify.adoc[leveloffset=+1]
79+
80+
include::modules/hcp-bm-access.adoc[leveloffset=+1]
81+
include::modules/hcp-bm-scale-np.adoc[leveloffset=+1]
82+
include::modules/hcp-bm-add-np.adoc[leveloffset=+2]
83+
include::modules/hcp-bm-autoscale.adoc[leveloffset=+2]
84+
include::modules/hcp-bm-autoscale-disable.adoc[leveloffset=+2]
85+
86+
[role="_additional-resources"]
87+
.Additional resources
88+
* xref:../../hosted_control_planes/hcp-troubleshooting.adoc#scale-down-data-plane_hcp-troubleshooting[Scaling down the data plane to zero]
89+
90+
include::modules/hcp-bm-ingress.adoc[leveloffset=+1]
91+
92+
[role="_additional-resources"]
93+
.Additional resources
94+
* xref:../../networking/networking_operators/metallb-operator/about-metallb.adoc#about-metallb_about-metallb[About MetalLB and the MetalLB Operator]

hosted_control_planes/hcp-deploy/hcp-deploy-ibm-power.adoc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@ include::modules/hcp-ibm-power-infra-reqs.adoc[leveloffset=+1]
3737
include::modules/hcp-ibm-power-dns.adoc[leveloffset=+1]
3838
include::modules/hcp-custom-dns.adoc[leveloffset=+2]
3939

40-
include::modules/hcp-bm-hc.adoc[leveloffset=+1]
40+
[id="hcp-bm-create-hc-ibm-power"]
41+
== Creating a hosted cluster on bare metal
42+
43+
When you create a hosted cluster with the Agent platform, the HyperShift Operator installs the Agent Cluster API provider in the hosted control plane namespace. You can create a hosted cluster on bare metal or you can import one.
44+
45+
include::modules/hcp-bm-hc.adoc[leveloffset=+2]
46+
47+
[role="_additional-resources"]
48+
.Additional resources
49+
* xref:../../hosted_control_planes/hcp-import.adoc[Manually importing a hosted cluster]
50+
* link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#configure-hosted-disconnected-digest-image[Extracting the {product-title} release image digest]
4151

4252
[id="hcp-ibm-power-heterogeneous-nodepools_{context}"]
4353
== Creating heterogeneous node pools on agent hosted clusters

hosted_control_planes/hcp-deploy/hcp-deploy-ibmz.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,17 @@ include::modules/hcp-ibm-z-infra-reqs.adoc[leveloffset=+1]
4343
include::modules/hcp-ibm-z-dns.adoc[leveloffset=+1]
4444
include::modules/hcp-custom-dns.adoc[leveloffset=+2]
4545

46-
include::modules/hcp-bm-hc.adoc[leveloffset=+1]
46+
[id="hcp-bm-create-hc-ibm-z"]
47+
== Creating a hosted cluster on bare metal
48+
49+
When you create a hosted cluster with the Agent platform, the HyperShift Operator installs the Agent Cluster API provider in the hosted control plane namespace. You can create a hosted cluster on bare metal or you can import one.
50+
51+
include::modules/hcp-bm-hc.adoc[leveloffset=+2]
4752

4853
[role="_additional-resources"]
4954
.Additional resources
50-
55+
* xref:../../hosted_control_planes/hcp-import.adoc[Manually importing a hosted cluster]
56+
* link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#configure-hosted-disconnected-digest-image[Extracting the {product-title} release image digest]
5157
* xref:../../hosted_control_planes/hcp-deploy/hcp-deploy-bm.adoc#hcp-bm-hc-console_hcp-deploy-bm[Creating a hosted cluster on bare metal by using the console]
5258

5359
include::modules/hcp-ibm-z-infraenv.adoc[leveloffset=+1]

hosted_control_planes/hcp-deploy/hcp-deploy-non-bm.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ include::modules/hcp-bm-hc-mirror.adoc[leveloffset=+2]
7474

7575
* To create credentials that you can reuse when you create a hosted cluster with the console, see link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#creating-a-credential-for-an-on-premises-environment[Creating a credential for an on-premises environment].
7676
77-
* To access a hosted cluster, see xref:../../hosted_control_planes/hcp-manage/hcp-manage-bm.adoc#hcp-bm-access_hcp-manage-bm[Accessing the hosted cluster].
77+
* To access a hosted cluster, see xref:../../hosted_control_planes/hcp-deploy/hcp-deploy-bm.adoc#hcp-bm-access_hcp-deploy-bm[Accessing the hosted cluster].
7878
7979
* To add hosts to the host inventory by using the Discovery Image, see link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.13/html/clusters/cluster_mce_overview#add-host-host-inventory[Adding hosts to the host inventory by using the Discovery Image].
8080

hosted_control_planes/hcp-manage/hcp-manage-bm.adoc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,9 @@ toc::[]
88

99
After you deploy {hcp} on bare metal, you can manage a hosted cluster by completing the following tasks.
1010

11-
include::modules/hcp-bm-access.adoc[leveloffset=+1]
12-
include::modules/hcp-bm-scale-np.adoc[leveloffset=+1]
13-
include::modules/hcp-bm-add-np.adoc[leveloffset=+2]
14-
include::modules/hcp-bm-autoscale.adoc[leveloffset=+2]
15-
include::modules/hcp-bm-autoscale-disable.adoc[leveloffset=+2]
16-
17-
[role="_additional-resources"]
18-
.Additional resources
19-
20-
* xref:../../hosted_control_planes/hcp-troubleshooting.adoc#scale-down-data-plane_hcp-troubleshooting[Scaling down the data plane to zero]
21-
22-
include::modules/hcp-bm-ingress.adoc[leveloffset=+1]
23-
24-
[role="_additional-resources"]
25-
.Additional resources
26-
27-
* xref:../../networking/networking_operators/metallb-operator/about-metallb.adoc#about-metallb_about-metallb[About MetalLB and the MetalLB Operator]
28-
2911
include::modules/hcp-bm-machine-health.adoc[leveloffset=+1]
3012
include::modules/hcp-bm-machine-health-disable.adoc[leveloffset=+1]
3113

3214
[role="_additional-resources"]
3315
.Additional resources
34-
3516
* xref:../../machine_management/deploying-machine-health-checks.adoc#deploying-machine-health-checks[Deploying machine health checks]

modules/hcp-bm-access.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * hosted_control_planes/hcp-manage/hcp-manage-bm.adoc
3+
// * hosted_control_planes/hcp-deploy/hcp-deploy-bm.adoc
44
// * hosted_control_planes/hcp-manage/hcp-manage-non-bm.adoc
55

66
:_mod-docs-content-type: PROCEDURE
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-deploy/hcp-deploy-bm.adoc
4+
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="hcp-bm-add-nodes-to-inventory_{context}"]
8+
= Adding bare-metal nodes to a hardware inventory
9+
10+
On {hcp}, the control-plane components run as pods on the management cluster while the data plane runs on dedicated nodes. You can use the Assisted Service to boot your hardware with a discovery ISO that adds your hardware to a hardware inventory. Later, when you create a hosted cluster, the hardware from the inventory is used to provision the data-plane nodes. The object that is used to get the discovery ISO is an `InfraEnv` resource. You need to create a `BareMetalHost` object that configures the cluster to boot the bare-metal node from the discovery ISO.
11+
12+
.Procedure
13+
14+
. Create a namespace to store your hardware inventory by entering the following command:
15+
+
16+
[source,terminal]
17+
----
18+
$ oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig create \
19+
namespace <namespace_example>
20+
----
21+
+
22+
where:
23+
+
24+
<directory_example>:: Is the name of the directory where the kubeconfig file for the management cluster is saved.
25+
<namespace_example>:: Is the name of the namespace that you are creating; for example, `hardware-inventory`.
26+
+
27+
.Example output
28+
[source,terminal]
29+
----
30+
namespace/hardware-inventory created
31+
----
32+
33+
. Copy the pull secret of the management cluster by entering the following command:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig \
38+
-n openshift-config get secret pull-secret -o yaml \
39+
| grep -vE "uid|resourceVersion|creationTimestamp|namespace" \
40+
| sed "s/openshift-config/<namespace_example>/g" \
41+
| oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig \
42+
-n <namespace> apply -f -
43+
----
44+
+
45+
where:
46+
+
47+
<directory_example>:: Is the name of the directory where the kubeconfig file for the management cluster is saved.
48+
<namespace_example>:: Is the name of the namespace that you are creating; for example, `hardware-inventory`.
49+
+
50+
.Example output
51+
[source,terminal]
52+
----
53+
secret/pull-secret created
54+
----
55+
56+
. Create the InfraEnv resource by adding the following content to a YAML file:
57+
+
58+
[source,yaml]
59+
----
60+
apiVersion: agent-install.openshift.io/v1beta1
61+
kind: InfraEnv
62+
metadata:
63+
name: hosted
64+
namespace: <namespace_example>
65+
spec:
66+
additionalNTPSources:
67+
- <ip_address>
68+
pullSecretRef:
69+
name: pull-secret
70+
sshAuthorizedKey: <ssh_public_key>
71+
----
72+
73+
. Apply the changes to the YAML file by entering the following command:
74+
+
75+
[source,terminal]
76+
----
77+
$ oc apply -f <infraenv_config>.yaml
78+
----
79+
+
80+
Replace `<infraenv_config>` with the name of your file.
81+
82+
. Verify that the `InfraEnv` resource was created by entering the following command:
83+
+
84+
[source,terminal]
85+
----
86+
$ oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig \
87+
-n <namespace_example> get infraenv hosted
88+
----
89+
90+
. Create `BareMetalHost` objects by adding the following content to a YAML file:
91+
+
92+
[NOTE]
93+
====
94+
When you apply this YAML file the following objects are created: secrets with credentials for the Baseboard Management Controller (BMCs), the `BareMetalHost` objects, and a role for the HyperShift Operator to be able to manage the agents. Notice how the `InfraEnv` resource is referenced in the `BareMetalHost` objects by using the `infraenvs.agent-install.openshift.io: hosted` custom label. This ensures that the nodes are booted with the ISO generated.
95+
====
96+
+
97+
[source,yaml]
98+
----
99+
apiVersion: v1
100+
kind: Secret
101+
metadata:
102+
name: hosted-worker0-bmc-secret
103+
namespace: <namespace_example>
104+
data:
105+
password: <password>
106+
username: <username>
107+
type: Opaque
108+
---
109+
apiVersion: v1
110+
kind: Secret
111+
metadata:
112+
name: hosted-worker1-bmc-secret
113+
namespace: <namespace_example>
114+
data:
115+
password: <password>
116+
username: <username>
117+
type: Opaque
118+
---
119+
apiVersion: v1
120+
kind: Secret
121+
metadata:
122+
name: hosted-worker2-bmc-secret
123+
namespace: <namespace_example>
124+
data:
125+
password: <password>
126+
username: <username>
127+
type: Opaque
128+
---
129+
apiVersion: metal3.io/v1alpha1
130+
kind: BareMetalHost
131+
metadata:
132+
name: hosted-worker0
133+
namespace: <namespace_example>
134+
labels:
135+
infraenvs.agent-install.openshift.io: hosted
136+
annotations:
137+
inspect.metal3.io: disabled
138+
bmac.agent-install.openshift.io/hostname: hosted-worker0
139+
spec:
140+
automatedCleaningMode: disabled
141+
bmc:
142+
disableCertificateVerification: True
143+
address: <bmc_address>
144+
credentialsName: hosted-worker0-bmc-secret
145+
bootMACAddress: aa:aa:aa:aa:02:01
146+
online: true
147+
---
148+
apiVersion: metal3.io/v1alpha1
149+
kind: BareMetalHost
150+
metadata:
151+
name: hosted-worker1
152+
namespace: <namespace_example>
153+
labels:
154+
infraenvs.agent-install.openshift.io: hosted
155+
annotations:
156+
inspect.metal3.io: disabled
157+
bmac.agent-install.openshift.io/hostname: hosted-worker1
158+
spec:
159+
automatedCleaningMode: disabled
160+
bmc:
161+
disableCertificateVerification: True
162+
address: <bmc_address>
163+
credentialsName: hosted-worker1-bmc-secret
164+
bootMACAddress: aa:aa:aa:aa:02:02
165+
online: true
166+
---
167+
apiVersion: metal3.io/v1alpha1
168+
kind: BareMetalHost
169+
metadata:
170+
name: hosted-worker2
171+
namespace: <namespace_example>
172+
labels:
173+
infraenvs.agent-install.openshift.io: hosted
174+
annotations:
175+
inspect.metal3.io: disabled
176+
bmac.agent-install.openshift.io/hostname: hosted-worker2
177+
spec:
178+
automatedCleaningMode: disabled
179+
bmc:
180+
disableCertificateVerification: True
181+
address: <bmc_address>
182+
credentialsName: hosted-worker2-bmc-secret
183+
bootMACAddress: aa:aa:aa:aa:02:03
184+
online: true
185+
---
186+
apiVersion: rbac.authorization.k8s.io/v1
187+
kind: Role
188+
metadata:
189+
name: capi-provider-role
190+
namespace: <namespace_example>
191+
rules:
192+
- apiGroups:
193+
- agent-install.openshift.io
194+
resources:
195+
- agents
196+
verbs:
197+
- '*'
198+
----
199+
+
200+
where:
201+
+
202+
<namespace_example>:: Is the your namespace.
203+
<password>:: Is the password for your secret.
204+
<username>:: Is the user name for your secret.
205+
<bmc_address>:: Is the BMC address for the `BareMetalHost` object.
206+
207+
. Apply the changes to the YAML file by entering the following command:
208+
+
209+
[source,terminal]
210+
----
211+
$ oc apply -f <bare_metal_host_config>.yaml
212+
----
213+
+
214+
Replace `<bare_metal_host_config>` with the name of your file.
215+
216+
. Enter the following command, and then wait a few minutes for the `BareMetalHost` objects to move to the `Provisioning` state:
217+
+
218+
[source,terminal]
219+
----
220+
$ oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig -n <namespace_example> get bmh
221+
----
222+
+
223+
.Example output
224+
[source,terminal]
225+
----
226+
NAME STATE CONSUMER ONLINE ERROR AGE
227+
hosted-worker0 provisioning true 106s
228+
hosted-worker1 provisioning true 106s
229+
hosted-worker2 provisioning true 106s
230+
----
231+
232+
. Enter the following command to verify that nodes are booting and showing up as agents. This process can take a few minutes, and you might need to enter the command more than once.
233+
+
234+
[source,terminal]
235+
----
236+
$ oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig -n <namespace_example> get agent
237+
----
238+
+
239+
.Example output
240+
[source,terminal]
241+
----
242+
NAME CLUSTER APPROVED ROLE STAGE
243+
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa0201 true auto-assign
244+
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa0202 true auto-assign
245+
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa0203 true auto-assign
246+
----

0 commit comments

Comments
 (0)