You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,6 +21,27 @@ On bare-metal infrastructure, you can create or import a hosted cluster. After y
22
21
23
22
- Verify that you have a default storage class configured for your cluster. Otherwise, you might see pending persistent volume claims (PVCs).
24
23
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:
- Ensure that you have added bare-metal nodes to a hardware inventory.
44
+
25
45
.Procedure
26
46
27
47
. Create a namespace by entering the following command:
@@ -67,6 +87,39 @@ $ hcp create cluster agent \
67
87
<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.
68
88
<12> After the `--ssh-key` flag, specify the path to the SSH key, such as `user/.ssh/id_rsa`.
69
89
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
+
70
123
. Apply the changes to the hosted cluster configuration file by entering the following command:
71
124
+
72
125
[source,terminal]
@@ -99,6 +152,183 @@ $ oc get pods -n <hosted_cluster_namespace>
99
152
100
153
. 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.
101
154
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:
.. 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:
. 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:
0 commit comments