Skip to content

Commit 531204b

Browse files
committed
[OSDOCS-15316]: Creating a hosted cluster on bare metal
1 parent a144257 commit 531204b

14 files changed

+370
-50
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: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
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 -n openshift-config get \
38+
secret pull-secret -o yaml | grep -vE "uid|resourceVersion|creationTimestamp|namespace" \
39+
| sed "s/openshift-config/<namespace_example>/g" | oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig \
40+
-n <namespace> apply -f -
41+
----
42+
+
43+
where:
44+
+
45+
<directory_example>:: Is the name of the directory where the kubeconfig file for the management cluster is saved.
46+
<namespace_example>:: Is the name of the namespace that you are creating; for example, `hardware-inventory`.
47+
+
48+
.Example output
49+
[source,terminal]
50+
----
51+
secret/pull-secret created
52+
----
53+
54+
. Create the InfraEnv resource by adding the following content to a YAML file:
55+
+
56+
[source,yaml]
57+
----
58+
apiVersion: agent-install.openshift.io/v1beta1
59+
kind: InfraEnv
60+
metadata:
61+
name: hosted
62+
namespace: <namespace_example>
63+
spec:
64+
additionalNTPSources:
65+
- <ip_address>
66+
pullSecretRef:
67+
name: pull-secret
68+
sshAuthorizedKey: <ssh_public_key>
69+
----
70+
71+
. Apply the changes to the YAML file by entering the following command:
72+
+
73+
[source,terminal]
74+
----
75+
$ oc apply -f <infraenv_config>.yaml
76+
----
77+
+
78+
Replace `<infraenv_config>` with the name of your file.
79+
80+
. Verify that the `InfraEnv` resource was created by entering the following command:
81+
+
82+
[source,terminal]
83+
----
84+
$ oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig -n <namespace_example> \
85+
get infraenv hosted
86+
----
87+
88+
. Create `BareMetalHost` objects by adding the following content to a YAML file:
89+
+
90+
[NOTE]
91+
====
92+
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.
93+
====
94+
+
95+
[source,yaml]
96+
----
97+
apiVersion: v1
98+
kind: Secret
99+
metadata:
100+
name: hosted-worker0-bmc-secret
101+
namespace: <namespace_example>
102+
data:
103+
password: <password>
104+
username: <username>
105+
type: Opaque
106+
---
107+
apiVersion: v1
108+
kind: Secret
109+
metadata:
110+
name: hosted-worker1-bmc-secret
111+
namespace: <namespace_example>
112+
data:
113+
password: <password>
114+
username: <username>
115+
type: Opaque
116+
---
117+
apiVersion: v1
118+
kind: Secret
119+
metadata:
120+
name: hosted-worker2-bmc-secret
121+
namespace: <namespace_example>
122+
data:
123+
password: <password>
124+
username: <username>
125+
type: Opaque
126+
---
127+
apiVersion: metal3.io/v1alpha1
128+
kind: BareMetalHost
129+
metadata:
130+
name: hosted-worker0
131+
namespace: <namespace_example>
132+
labels:
133+
infraenvs.agent-install.openshift.io: hosted
134+
annotations:
135+
inspect.metal3.io: disabled
136+
bmac.agent-install.openshift.io/hostname: hosted-worker0
137+
spec:
138+
automatedCleaningMode: disabled
139+
bmc:
140+
disableCertificateVerification: True
141+
address: <bmc_address>
142+
credentialsName: hosted-worker0-bmc-secret
143+
bootMACAddress: aa:aa:aa:aa:02:01
144+
online: true
145+
---
146+
apiVersion: metal3.io/v1alpha1
147+
kind: BareMetalHost
148+
metadata:
149+
name: hosted-worker1
150+
namespace: <namespace_example>
151+
labels:
152+
infraenvs.agent-install.openshift.io: hosted
153+
annotations:
154+
inspect.metal3.io: disabled
155+
bmac.agent-install.openshift.io/hostname: hosted-worker1
156+
spec:
157+
automatedCleaningMode: disabled
158+
bmc:
159+
disableCertificateVerification: True
160+
address: <bmc_address>
161+
credentialsName: hosted-worker1-bmc-secret
162+
bootMACAddress: aa:aa:aa:aa:02:02
163+
online: true
164+
---
165+
apiVersion: metal3.io/v1alpha1
166+
kind: BareMetalHost
167+
metadata:
168+
name: hosted-worker2
169+
namespace: <namespace_example>
170+
labels:
171+
infraenvs.agent-install.openshift.io: hosted
172+
annotations:
173+
inspect.metal3.io: disabled
174+
bmac.agent-install.openshift.io/hostname: hosted-worker2
175+
spec:
176+
automatedCleaningMode: disabled
177+
bmc:
178+
disableCertificateVerification: True
179+
address: <bmc_address>
180+
credentialsName: hosted-worker2-bmc-secret
181+
bootMACAddress: aa:aa:aa:aa:02:03
182+
online: true
183+
---
184+
apiVersion: rbac.authorization.k8s.io/v1
185+
kind: Role
186+
metadata:
187+
name: capi-provider-role
188+
namespace: <namespace_example>
189+
rules:
190+
- apiGroups:
191+
- agent-install.openshift.io
192+
resources:
193+
- agents
194+
verbs:
195+
- '*'
196+
----
197+
+
198+
where:
199+
+
200+
<namespace_example>:: Is the your namespace.
201+
<password>:: Is the password for your secret.
202+
<username>:: Is the user name for your secret.
203+
<bmc_address>:: Is the BMC address for the `BareMetalHost` object.
204+
205+
. Apply the changes to the YAML file by entering the following command:
206+
+
207+
[source,terminal]
208+
----
209+
$ oc apply -f <bare_metal_host_config>.yaml
210+
----
211+
+
212+
Replace <bare_metal_host_config> with the name of your file.
213+
214+
. Enter the following command, and then wait a few minutes for the `BareMetalHost` objects to move to the `Provisioning` state:
215+
+
216+
[source,terminal]
217+
----
218+
$ oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig -n <namespace_example> get bmh
219+
----
220+
+
221+
.Example output
222+
[source,terminal]
223+
----
224+
NAME STATE CONSUMER ONLINE ERROR AGE
225+
hosted-worker0 provisioning true 106s
226+
hosted-worker1 provisioning true 106s
227+
hosted-worker2 provisioning true 106s
228+
----
229+
230+
. 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.
231+
+
232+
[source,terminal]
233+
----
234+
$ oc --kubeconfig ~/<directory_example>/mgmt-kubeconfig -n <namespace_example> get agent
235+
----
236+
+
237+
.Example output
238+
[source,terminal]
239+
----
240+
NAME CLUSTER APPROVED ROLE STAGE
241+
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa0201 true auto-assign
242+
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa0202 true auto-assign
243+
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaa0203 true auto-assign
244+
----

0 commit comments

Comments
 (0)