Skip to content

Commit 2228b34

Browse files
authored
Merge pull request #103275 from lahinson/ocpbugs-62751-hcp-ibm-revert-hc
[OCPBUGS-62751]: Reverting changes to HCP file
2 parents 28f7e88 + 790a779 commit 2228b34

File tree

1 file changed

+231
-1
lines changed

1 file changed

+231
-1
lines changed

modules/hcp-bm-hc.adoc

Lines changed: 231 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Module included in the following assemblies:
22
//
33
// * hosted_control_planes/hcp-deploy/hcp-deploy-bm.adoc
4-
// * hosted_control_planes/hcp-deploy/hcp-deploy-ibm-z.adoc
54
// * hosted_control_planes/hcp-deploy/hcp-deploy-ibm-power.adoc
65

76
:_mod-docs-content-type: PROCEDURE
@@ -22,6 +21,27 @@ On bare-metal infrastructure, you can create or import a hosted cluster. After y
2221
2322
- Verify that you have a default storage class configured for your cluster. Otherwise, you might see pending persistent volume claims (PVCs).
2423
24+
- By default when you use the `hcp create cluster agent` command, the command creates a hosted cluster with configured node ports. The preferred publishing strategy for hosted clusters on bare metal exposes services through a load balancer. If you create a hosted cluster by using the web console or by using {rh-rhacm-title}, to set a publishing strategy for a service besides the Kubernetes API server, you must manually specify the `servicePublishingStrategy` information in the `HostedCluster` custom resource.
25+
26+
- Ensure that you meet the requirements described in "Requirements for {hcp} on bare metal", which includes requirements related to infrastructure, firewalls, ports, and services. For example, those requirements describe how to add the appropriate zone labels to the bare-metal hosts in your management cluster, as shown in the following example commands:
27+
+
28+
[source,terminal]
29+
----
30+
$ oc label node [compute-node-1] topology.kubernetes.io/zone=zone1
31+
----
32+
+
33+
[source,terminal]
34+
----
35+
$ oc label node [compute-node-2] topology.kubernetes.io/zone=zone2
36+
----
37+
+
38+
[source,terminal]
39+
----
40+
$ oc label node [compute-node-3] topology.kubernetes.io/zone=zone3
41+
----
42+
43+
- Ensure that you have added bare-metal nodes to a hardware inventory.
44+
2545
.Procedure
2646

2747
. Create a namespace by entering the following command:
@@ -67,6 +87,39 @@ $ hcp create cluster agent \
6787
<11> Specify the node pool replica count, such as `3`. You must specify the replica count as `0` or greater to create the same number of replicas. Otherwise, you do not create node pools.
6888
<12> After the `--ssh-key` flag, specify the path to the SSH key, such as `user/.ssh/id_rsa`.
6989

90+
. Configure the service publishing strategy. By default, hosted clusters use the `NodePort` service publishing strategy because node ports are always available without additional infrastructure. However, you can configure the service publishing strategy to use a load balancer.
91+
92+
** If you are using the default `NodePort` strategy, configure the DNS to point to the hosted cluster compute nodes, not the management cluster nodes. For more information, see "DNS configurations on bare metal".
93+
94+
** For production environments, use the `LoadBalancer` strategy because this strategy provides certificate handling and automatic DNS resolution. The following example demonstrates changing the service publishing `LoadBalancer` strategy in your hosted cluster configuration file:
95+
+
96+
[source,yaml]
97+
----
98+
# ...
99+
spec:
100+
services:
101+
- service: APIServer
102+
servicePublishingStrategy:
103+
type: LoadBalancer #<1>
104+
- service: Ignition
105+
servicePublishingStrategy:
106+
type: Route
107+
- service: Konnectivity
108+
servicePublishingStrategy:
109+
type: Route
110+
- service: OAuthServer
111+
servicePublishingStrategy:
112+
type: Route
113+
- service: OIDC
114+
servicePublishingStrategy:
115+
type: Route
116+
sshKey:
117+
name: <ssh_key>
118+
# ...
119+
----
120+
+
121+
<1> Specify `LoadBalancer` as the API Server type. For all other services, specify `Route` as the type.
122+
70123
. Apply the changes to the hosted cluster configuration file by entering the following command:
71124
+
72125
[source,terminal]
@@ -99,6 +152,183 @@ $ oc get pods -n <hosted_cluster_namespace>
99152

100153
. Confirm that the hosted cluster is ready. The status of `Available: True` indicates the readiness of the cluster and the node pool status shows `AllMachinesReady: True`. These statuses indicate the healthiness of all cluster Operators.
101154

155+
. Install MetalLB in the hosted cluster:
156+
+
157+
.. Extract the `kubeconfig` file from the hosted cluster and set the environment variable for hosted cluster access by entering the following commands:
158+
+
159+
[source,terminal]
160+
----
161+
$ oc get secret \
162+
<hosted_cluster_namespace>-admin-kubeconfig \
163+
-n <hosted_cluster_namespace> \
164+
-o jsonpath='{.data.kubeconfig}' \
165+
| base64 -d > \
166+
kubeconfig-<hosted_cluster_namespace>.yaml
167+
----
168+
+
169+
[source,terminal]
170+
----
171+
$ export KUBECONFIG="/path/to/kubeconfig-<hosted_cluster_namespace>.yaml"
172+
----
173+
+
174+
.. Install the MetalLB Operator by creating the `install-metallb-operator.yaml` file:
175+
+
176+
[source,yaml]
177+
----
178+
apiVersion: v1
179+
kind: Namespace
180+
metadata:
181+
name: metallb-system
182+
---
183+
apiVersion: operators.coreos.com/v1
184+
kind: OperatorGroup
185+
metadata:
186+
name: metallb-operator
187+
namespace: metallb-system
188+
---
189+
apiVersion: operators.coreos.com/v1alpha1
190+
kind: Subscription
191+
metadata:
192+
name: metallb-operator
193+
namespace: metallb-system
194+
spec:
195+
channel: "stable"
196+
name: metallb-operator
197+
source: redhat-operators
198+
sourceNamespace: openshift-marketplace
199+
installPlanApproval: Automatic
200+
# ...
201+
----
202+
+
203+
.. Apply the file by entering the following command:
204+
+
205+
[source,terminal]
206+
----
207+
$ oc apply -f install-metallb-operator.yaml
208+
----
209+
+
210+
.. Configure the MetalLB IP address pool by creating the `deploy-metallb-ipaddresspool.yaml` file:
211+
+
212+
[source,yaml]
213+
----
214+
apiVersion: metallb.io/v1beta1
215+
kind: IPAddressPool
216+
metadata:
217+
name: metallb
218+
namespace: metallb-system
219+
spec:
220+
autoAssign: true
221+
addresses:
222+
- 10.11.176.71-10.11.176.75
223+
---
224+
apiVersion: metallb.io/v1beta1
225+
kind: L2Advertisement
226+
metadata:
227+
name: l2advertisement
228+
namespace: metallb-system
229+
spec:
230+
ipAddressPools:
231+
- metallb
232+
# ...
233+
----
234+
+
235+
.. Apply the configuration by entering the following command:
236+
+
237+
[source,terminal]
238+
----
239+
$ oc apply -f deploy-metallb-ipaddresspool.yaml
240+
----
241+
+
242+
.. Verify the installation of MetalLB by checking the Operator status, the IP address pool, and the `L2Advertisement` resource by entering the following commands:
243+
+
244+
[source,terminal]
245+
----
246+
$ oc get pods -n metallb-system
247+
----
248+
+
249+
[source,terminal]
250+
----
251+
$ oc get ipaddresspool -n metallb-system
252+
----
253+
+
254+
[source,terminal]
255+
----
256+
$ oc get l2advertisement -n metallb-system
257+
----
258+
259+
. Configure the load balancer for ingress:
260+
+
261+
.. Create the `ingress-loadbalancer.yaml` file:
262+
+
263+
[source,yaml]
264+
----
265+
apiVersion: v1
266+
kind: Service
267+
metadata:
268+
annotations:
269+
metallb.universe.tf/address-pool: metallb
270+
name: metallb-ingress
271+
namespace: openshift-ingress
272+
spec:
273+
ports:
274+
- name: http
275+
protocol: TCP
276+
port: 80
277+
targetPort: 80
278+
- name: https
279+
protocol: TCP
280+
port: 443
281+
targetPort: 443
282+
selector:
283+
ingresscontroller.operator.openshift.io/deployment-ingresscontroller: default
284+
type: LoadBalancer
285+
# ...
286+
----
287+
+
288+
.. Apply the configuration by entering the following command:
289+
+
290+
[source,terminal]
291+
----
292+
$ oc apply -f ingress-loadbalancer.yaml
293+
----
294+
+
295+
.. Verify that the load balancer service works as expected by entering the following command:
296+
+
297+
[source,terminal]
298+
----
299+
$ oc get svc metallb-ingress -n openshift-ingress
300+
----
301+
+
302+
.Example output
303+
+
304+
[source,text]
305+
----
306+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
307+
metallb-ingress LoadBalancer 172.31.127.129 10.11.176.71 80:30961/TCP,443:32090/TCP 16h
308+
----
309+
310+
. Configure the DNS to work with the load balancer:
311+
+
312+
.. Configure the DNS for the `apps` domain by pointing the `*.apps.<hosted_cluster_namespace>.<base_domain>` wildcard DNS record to the load balancer IP address.
313+
+
314+
.. Verify the DNS resolution by entering the following command:
315+
+
316+
[source,terminal]
317+
----
318+
$ nslookup console-openshift-console.apps.<hosted_cluster_namespace>.<base_domain> <load_balancer_ip_address>
319+
----
320+
+
321+
.Example output
322+
+
323+
[source,text]
324+
----
325+
Server: 10.11.176.1
326+
Address: 10.11.176.1#53
327+
328+
Name: console-openshift-console.apps.my-hosted-cluster.sample-base-domain.com
329+
Address: 10.11.176.71
330+
----
331+
102332
.Verification
103333

104334
. Check the cluster Operators by entering the following command:

0 commit comments

Comments
 (0)