Skip to content

Commit c4fe073

Browse files
authored
Merge pull request #80904 from lahinson/osdocs-11001-hcp-bm
[OSDOCS-11001]: Moving HCP bare metal content to OCP repo
2 parents 226970c + 34cfd2a commit c4fe073

24 files changed

+1272
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,6 +2460,8 @@ Topics:
24602460
File: hcp-destroy-virt
24612461
- Name: Destroying a hosted cluster on IBM Z
24622462
File: hcp-destroy-ibmz
2463+
- Name: Manually importing a hosted control plane cluster
2464+
File: hcp-import
24632465
---
24642466
Name: Nodes
24652467
Dir: nodes

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

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,72 @@ include::_attributes/common-attributes.adoc[]
55
:context: hcp-deploy-bm
66

77
toc::[]
8+
9+
You can deploy {hcp} by configuring a cluster to function as a management cluster. The management cluster is the {product-title} cluster where the control planes are hosted. In some contexts, the management cluster is also known as the _hosting_ cluster.
10+
11+
[NOTE]
12+
====
13+
The management cluster is not the same thing as the _managed_ cluster. A managed cluster is a cluster that the hub cluster manages.
14+
====
15+
16+
The {hcp} feature is enabled by default.
17+
18+
The {mce-short} supports only the default `local-cluster`, which is a hub cluster that is managed, and the hub cluster as the management cluster. If you have Red{nbsp}Hat Advanced Cluster Management installed, you can use the managed hub cluster, also known as the `local-cluster`, as the management cluster.
19+
20+
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.
21+
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}_.
23+
24+
include::modules/hcp-bm-prepare.adoc[leveloffset=+1]
25+
include::modules/hcp-bm-prereqs.adoc[leveloffset=+2]
26+
27+
[role="_additional-resources"]
28+
.Additional resources
29+
30+
* link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.11/html/clusters/cluster_mce_overview#advanced-config-engine[Advanced configuration]
31+
32+
* link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.11/html/clusters/cluster_mce_overview#enable-cim[Enabling the central infrastructure management service]
33+
34+
include::modules/hcp-bm-firewall-port-svc-reqs.adoc[leveloffset=+2]
35+
include::modules/hcp-bm-infra-reqs.adoc[leveloffset=+2]
36+
37+
[role="_additional-resources"]
38+
.Additional resources
39+
40+
* xref:../../scalability_and_performance/recommended-performance-scale-practices/recommended-etcd-practices.adoc#recommended-etcd-practices[Recommended etcd practices]
41+
42+
* xref:../../storage/persistent_storage/persistent_storage_local/persistent-storage-using-lvms.adoc[Persistent storage using LVM Storage]
43+
44+
* xref:../../hosted_control_planes/hcp-import.adoc#hcp-import-disable_hcp-import[Disabling the automatic import of hosted clusters into {mce-short}]
45+
46+
* xref:../../hosted_control_planes/hcp-prepare/hcp-enable-disable.adoc[Enabling or disabling the {hcp} feature]
47+
48+
* link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.11/html/clusters/cluster_mce_overview#ansible-config-hosted-cluster[Configuring Ansible Automation Platform jobs to run on hosted clusters]
49+
50+
include::modules/hcp-bm-dns.adoc[leveloffset=+1]
51+
include::modules/hcp-bm-hc.adoc[leveloffset=+1]
52+
53+
[role="_additional-resources"]
54+
.Additional resources
55+
56+
* xref:../../hosted_control_planes/hcp-import.adoc[Manually importing a hosted control plane cluster]
57+
58+
include::modules/hcp-bm-hc-console.adoc[leveloffset=+2]
59+
60+
.Next steps
61+
62+
* To access the web console, see xref:../../web_console/web-console.adoc#web-console-overview[Accessing the web console].
63+
64+
include::modules/hcp-bm-hc-mirror.adoc[leveloffset=+2]
65+
66+
.Next steps
67+
68+
* 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.11/html/clusters/cluster_mce_overview#creating-a-credential-for-an-on-premises-environment[Creating a credential for an on-premises environment].
69+
70+
* 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].
71+
72+
* 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.11/html/clusters/cluster_mce_overview#add-host-host-inventory[Adding hosts to the host inventory by using the Discovery Image].
73+
74+
* To extract the {product-title} release image digest, see link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/2.11/html/clusters/cluster_mce_overview#configure-hosted-disconnected-digest-image[Extracting the {product-title} release image digest].
75+
76+
include::modules/hcp-bm-verify.adoc[leveloffset=+1]

hosted_control_planes/hcp-import.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="hcp-import"]
3+
include::_attributes/common-attributes.adoc[]
4+
= Manually importing a hosted control plane cluster
5+
:context: hcp-import
6+
7+
toc::[]
8+
9+
Hosted clusters are automatically imported into {mce-short} after the hosted control plane becomes available.
10+
11+
include::modules/hcp-import-manual.adoc[leveloffset=+1]
12+
include::modules/hcp-import-manual-aws.adoc[leveloffset=+1]
13+
include::modules/hcp-import-disable.adoc[leveloffset=+1]
14+

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,31 @@ include::_attributes/common-attributes.adoc[]
55
:context: hcp-manage-bm
66

77
toc::[]
8+
9+
After you deploy {hcp} on bare metal, you can manage a hosted cluster by completing the following tasks.
10+
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/metallb/about-metallb.adoc#about-metallb[About MetalLB and the MetalLB Operator]
28+
29+
include::modules/hcp-bm-machine-health.adoc[leveloffset=+1]
30+
include::modules/hcp-bm-machine-health-disable.adoc[leveloffset=+1]
31+
32+
[role="_additional-resources"]
33+
.Additional resources
34+
35+
* xref:../../machine_management/deploying-machine-health-checks.adoc#deploying-machine-health-checks[Deploying machine health checks]

modules/hcp-bm-access.adoc

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-manage/hcp-manage-bm.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-bm-access_{context}"]
7+
= Accessing the hosted cluster
8+
9+
You can access the hosted cluster by either getting the `kubeconfig` file and `kubeadmin` credential directly from resources, or by using the `hcp` command line interface to generate a `kubeconfig` file.
10+
11+
.Prerequisites
12+
13+
To access the hosted cluster by getting the `kubeconfig` file and credentials directly from resources, you need to be familiar with the access secrets for hosted control plane clusters. The secrets are stored in the hosted cluster (hosting) namespace. The _hosted cluster (hosting)_ namespace contains hosted cluster resources, and the _hosted control plane_ namespace is where the hosted control plane runs.
14+
15+
The secret name formats are as follows:
16+
17+
** `kubeconfig` secret: `<hosted-cluster-namespace>-<name>-admin-kubeconfig` (clusters-hypershift-demo-admin-kubeconfig)
18+
** `kubeadmin` password secret: `<hosted-cluster-namespace>-<name>-kubeadmin-password` (clusters-hypershift-demo-kubeadmin-password)
19+
20+
The `kubeconfig` secret contains a Base64-encoded `kubeconfig` field, which you can decode and save into a file to use with the following command:
21+
22+
[source,terminal]
23+
----
24+
$ oc --kubeconfig <hosted-cluster-name>.kubeconfig get nodes
25+
----
26+
27+
The `kubeadmin` password secret is also Base64-encoded. You can decode it and use the password to log in to the API server or console of the hosted cluster.
28+
29+
.Procedure
30+
31+
* To access the hosted cluster by using the `hcp` CLI to generate the `kubeconfig` file, take the following steps:
32+
33+
. Generate the `kubeconfig` file by entering the following command:
34+
+
35+
[source,terminal]
36+
----
37+
$ hcp create kubeconfig --namespace <hosted-cluster-namespace> --name <hosted-cluster-name> > <hosted-cluster-name>.kubeconfig
38+
----
39+
40+
. After you save the `kubeconfig` file, you can access the hosted cluster by entering the following example command:
41+
+
42+
[source,terminal]
43+
----
44+
$ oc --kubeconfig <hosted-cluster-name>.kubeconfig get nodes
45+
----

modules/hcp-bm-add-np.adoc

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-manage/hcp-manage-bm.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-bm-add-np_{context}"]
7+
= Adding node pools
8+
9+
You can create node pools for a hosted cluster by specifying a name, number of replicas, and any additional information, such as an agent label selector.
10+
11+
.Procedure
12+
13+
. To create a node pool, enter the following information:
14+
+
15+
[source,terminal]
16+
----
17+
export NODEPOOL_NAME=${CLUSTER_NAME}-extra-cpu
18+
export WORKER_COUNT="2"
19+
20+
$ hcp create nodepool agent \
21+
--cluster-name $CLUSTER_NAME \
22+
--name $NODEPOOL_NAME \
23+
--node-count $WORKER_COUNT \
24+
--agentLabelSelector '{"matchLabels": {"size": "medium"}}' <1>
25+
----
26+
+
27+
<1> The `--agentLabelSelector` is optional. The node pool uses agents with the `"size" : "medium"` label.
28+
29+
. Check the status of the node pool by listing `nodepool` resources in the `clusters` namespace:
30+
+
31+
[source,terminal]
32+
----
33+
$oc get nodepools --namespace clusters
34+
----
35+
36+
. Extract the `admin-kubeconfig` secret by entering the following command:
37+
+
38+
[source,terminal]
39+
----
40+
$ oc extract -n <hosted-control-plane-namespace> secret/admin-kubeconfig --to=./hostedcluster-secrets --confirm
41+
----
42+
+
43+
.Example output
44+
[source,terminal]
45+
----
46+
hostedcluster-secrets/kubeconfig
47+
----
48+
49+
. After some time, you can check the status of the node pool by entering the following command:
50+
+
51+
[source,terminal]
52+
----
53+
$ oc --kubeconfig ./hostedcluster-secrets get nodes
54+
----
55+
56+
. Verify that the number of available node pools match the number of expected node pools by entering this command:
57+
+
58+
[source,terminal]
59+
----
60+
$ oc get nodepools --namespace clusters
61+
----

modules/hcp-bm-autoscale-disable.adoc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-manage/hcp-manage-bm.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-bm-autoscale-disable_{context}"]
7+
= Disabling node auto-scaling for the hosted cluster
8+
9+
To disable node auto-scaling, complete the following procedure.
10+
11+
.Procedure
12+
13+
* Enter the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ oc -n <hosted-cluster-namespace> patch nodepool <hosted-cluster-name> --type=json -p '[\{"op":"remove", "path": "/spec/autoScaling"}, \{"op": "add", "path": "/spec/replicas", "value": <specify-value-to-scale-replicas>]'
18+
----
19+
+
20+
The command removes `"spec.autoScaling"` from the YAML file, adds `"spec.replicas"`, and sets `"spec.replicas"` to the integer value that you specify.

modules/hcp-bm-autoscale.adoc

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-manage/hcp-manage-bm.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-bm-autoscale_{context}"]
7+
= Enabling node auto-scaling for the hosted cluster
8+
9+
When you need more capacity in your hosted cluster and spare agents are available, you can enable auto-scaling to install new worker nodes.
10+
11+
.Procedure
12+
13+
. To enable auto-scaling, enter the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ oc -n <hosted-cluster-namespace> patch nodepool <hosted-cluster-name> --type=json -p '[{"op": "remove", "path": "/spec/replicas"},{"op":"add", "path": "/spec/autoScaling", "value": { "max": 5, "min": 2 }}]'
18+
----
19+
+
20+
[NOTE]
21+
====
22+
In the example, the minimum number of nodes is 2, and the maximum is 5. The maximum number of nodes that you can add might be bound by your platform. For example, if you use the Agent platform, the maximum number of nodes is bound by the number of available agents.
23+
====
24+
25+
. Create a workload that requires a new node.
26+
27+
.. Create a YAML file that contains the workload configuration, by using the following example:
28+
+
29+
[source,yaml]
30+
----
31+
apiVersion: apps/v1
32+
kind: Deployment
33+
metadata:
34+
creationTimestamp: null
35+
labels:
36+
app: reversewords
37+
name: reversewords
38+
namespace: default
39+
spec:
40+
replicas: 40
41+
selector:
42+
matchLabels:
43+
app: reversewords
44+
strategy: {}
45+
template:
46+
metadata:
47+
creationTimestamp: null
48+
labels:
49+
app: reversewords
50+
spec:
51+
containers:
52+
- image: quay.io/mavazque/reversewords:latest
53+
name: reversewords
54+
resources:
55+
requests:
56+
memory: 2Gi
57+
status: {}
58+
----
59+
60+
.. Save the file as `workload-config.yaml`.
61+
62+
.. Apply the YAML by entering the following command:
63+
+
64+
[source,terminal]
65+
----
66+
$ oc apply -f workload-config.yaml
67+
----
68+
69+
. Extract the `admin-kubeconfig` secret by entering the following command:
70+
+
71+
[source,terminal]
72+
----
73+
$ oc extract -n <hosted-cluster-namespace> secret/<hosted-cluster-name>-admin-kubeconfig --to=./hostedcluster-secrets --confirm
74+
----
75+
+
76+
.Example output
77+
----
78+
hostedcluster-secrets/kubeconfig
79+
----
80+
81+
. You can check if new nodes are in the `Ready` status by entering the following command:
82+
+
83+
[source,terminal]
84+
----
85+
$ oc --kubeconfig ./hostedcluster-secrets get nodes
86+
----
87+
88+
. To remove the node, delete the workload by entering the following command:
89+
+
90+
[source,terminal]
91+
----
92+
$ oc --kubeconfig ./hostedcluster-secrets -n default delete deployment reversewords
93+
----
94+
95+
. Wait for several minutes to pass without requiring the additional capacity. On the Agent platform, the agent is decommissioned and can be reused. You can confirm that the node was removed by entering the following command:
96+
+
97+
[source,terminal]
98+
----
99+
$ oc --kubeconfig ./hostedcluster-secrets get nodes
100+
----

0 commit comments

Comments
 (0)