Skip to content

Commit 319791b

Browse files
authored
Merge pull request #81797 from xenolinux/hcp-migrate-aws
OSDOCS#11004: Hosted control planes: Migrate AWS to OCP
2 parents bdae00c + f8d46b4 commit 319791b

34 files changed

+1274
-31
lines changed

_topic_maps/_topic_map.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ Topics:
24902490
File: hcp-destroy-ibmz
24912491
- Name: Destroying a hosted cluster on non-bare metal agent machines
24922492
File: hcp-destroy-non-bm
2493-
- Name: Manually importing a hosted control plane cluster
2493+
- Name: Manually importing a hosted cluster
24942494
File: hcp-import
24952495
---
24962496
Name: Nodes
Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,75 @@
11
:_mod-docs-content-type: ASSEMBLY
22
[id="hcp-deploy-aws"]
33
include::_attributes/common-attributes.adoc[]
4-
= Deploying {hcp} on AWS
4+
= Deploying {hcp} on {aws-short}
55
:context: hcp-deploy-aws
66

7-
toc::[]
7+
toc::[]
8+
9+
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. To configure {hcp} on premises, you must install {mce} in a management cluster. By deploying the HyperShift Operator on an existing managed cluster by using the `hypershift-addon` managed cluster add-on, you can enable that cluster as a management cluster and start to create the hosted cluster. The `hypershift-addon` managed cluster add-on is enabled by default for the `local-cluster` managed cluster.
10+
11+
You can use the {mce-short} console or the hosted control plane command-line interface (CLI), `hcp`, to create a hosted cluster. The hosted cluster is automatically imported as a managed cluster. However, you can xref:../../hosted_control_planes/hcp-import.adoc#hcp-import-disable_hcp-import[disable this automatic import feature into {mce-short}].
12+
13+
include::modules/hcp-aws-prepare.adoc[leveloffset=+1]
14+
include::modules/hcp-aws-prereqs.adoc[leveloffset=+2]
15+
16+
[role="_additional-resources"]
17+
.Additional resources
18+
19+
* 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]
20+
21+
* 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]
22+
23+
* 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]
24+
25+
* xref:../../hosted_control_planes/hcp-prepare/hcp-enable-disable.adoc#hcp-enable-manual_hcp-enable-disable[Manually enabling the {hcp} feature]
26+
27+
* xref:../../hosted_control_planes/hcp-prepare/hcp-enable-disable.adoc#hcp-disable_hcp-enable-disable[Disabling the {hcp} feature]
28+
29+
* xref:../../networking/hardware_networks/configuring-sriov-operator.adoc#sriov-operator-hosted-control-planes_configuring-sriov-operator[Deploying the SR-IOV Operator for {hcp}]
30+
31+
include::modules/hcp-aws-create-secret-s3.adoc[leveloffset=+1]
32+
33+
include::modules/hcp-aws-create-public-zone.adoc[leveloffset=+1]
34+
35+
include::modules/hcp-aws-create-role-sts-creds.adoc[leveloffset=+1]
36+
37+
include::modules/hcp-aws-enable-ext-dns.adoc[leveloffset=+1]
38+
39+
include::modules/hcp-aws-enable-ext-dns-prereq.adoc[leveloffset=+2]
40+
41+
include::modules/hcp-aws-set-up-ext-dns.adoc[leveloffset=+2]
42+
43+
include::modules/hcp-aws-create-dns-hosted-zone.adoc[leveloffset=+2]
44+
45+
include::modules/hcp-aws-hc-ext-dns.adoc[leveloffset=+2]
46+
47+
include::modules/hcp-aws-enable-private-link.adoc[leveloffset=+1]
48+
49+
include::modules/hcp-aws-deploy-hc.adoc[leveloffset=+1]
50+
51+
include::modules/hcp-access-pub-hc-aws.adoc[leveloffset=+2]
52+
53+
include::modules/hcp-access-pub-hc-aws-cli.adoc[leveloffset=+2]
54+
55+
include::modules/hc-create-aws-multi-zones.adoc[leveloffset=+1]
56+
57+
include::modules/hcp-create-hc-multi-zone-aws-creds.adoc[leveloffset=+2]
58+
59+
include::modules/hcp-enable-arm-amd.adoc[leveloffset=+1]
60+
include::modules/hcp-create-hc-arm64-aws.adoc[leveloffset=+2]
61+
include::modules/hcp-create-np-arm64-aws.adoc[leveloffset=+2]
62+
63+
[role="_additional-resources"]
64+
.Additional resources
65+
66+
* 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]
67+
68+
include::modules/hcp-create-private-hc-aws.adoc[leveloffset=+1]
69+
70+
[role="_additional-resources"]
71+
.Additional resources
72+
73+
//Identity and Access Management (IAM) permissions
74+
75+
include::modules/hcp-access-priv-mgmt-aws.adoc[leveloffset=+2]

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The {hcp} feature is enabled by default.
1717

1818
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.
1919

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.
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.
2121

2222
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

@@ -53,7 +53,7 @@ include::modules/hcp-bm-hc.adoc[leveloffset=+1]
5353
[role="_additional-resources"]
5454
.Additional resources
5555

56-
* xref:../../hosted_control_planes/hcp-import.adoc[Manually importing a hosted control plane cluster]
56+
* xref:../../hosted_control_planes/hcp-import.adoc[Manually importing a hosted cluster]
5757
5858
include::modules/hcp-bm-hc-console.adoc[leveloffset=+2]
5959

@@ -73,4 +73,4 @@ include::modules/hcp-bm-hc-mirror.adoc[leveloffset=+2]
7373
7474
* 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].
7575
76-
include::modules/hcp-bm-verify.adoc[leveloffset=+1]
76+
include::modules/hcp-bm-verify.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
@@ -55,7 +55,7 @@ include::modules/hcp-non-bm-hc.adoc[leveloffset=+1]
5555
[role="_additional-resources"]
5656
.Additional resources
5757

58-
* xref:../../hosted_control_planes/hcp-import.adoc#hcp-import-manual_hcp-import[Manually importing a hosted control plane cluster]
58+
* xref:../../hosted_control_planes/hcp-import.adoc#hcp-import-manual_hcp-import[Manually importing a hosted cluster]
5959
6060
include::modules/hcp-non-bm-hc-console.adoc[leveloffset=+2]
6161

hosted_control_planes/hcp-import.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:_mod-docs-content-type: ASSEMBLY
22
[id="hcp-import"]
33
include::_attributes/common-attributes.adoc[]
4-
= Manually importing a hosted control plane cluster
4+
= Manually importing a hosted cluster
55
:context: hcp-import
66

77
toc::[]
@@ -11,4 +11,3 @@ Hosted clusters are automatically imported into {mce-short} after the hosted con
1111
include::modules/hcp-import-manual.adoc[leveloffset=+1]
1212
include::modules/hcp-import-manual-aws.adoc[leveloffset=+1]
1313
include::modules/hcp-import-disable.adoc[leveloffset=+1]
14-

hosted_control_planes/hcp-prepare/hcp-enable-disable.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include::modules/hcp-enable-manual-addon.adoc[leveloffset=+2]
1414
[id="hcp-disable_{context}"]
1515
== Disabling the {hcp} feature
1616

17-
You can uninstall the HyperShift Operator and disable the hosted control plane. When you disable the hosted control plane cluster feature, you must destroy the hosted cluster and the managed cluster resource on {mce-short}, as described in the _Managing hosted control plane clusters_ topics.
17+
You can uninstall the HyperShift Operator and disable the {hcp} feature. When you disable the {hcp} feature, you must destroy the hosted cluster and the managed cluster resource on {mce-short}, as described in the _Managing hosted clusters_ topics.
1818

1919
include::modules/hcp-uninstall-operator.adoc[leveloffset=+2]
20-
include::modules/hcp-disable-feature.adoc[leveloffset=+2]
20+
include::modules/hcp-disable-feature.adoc[leveloffset=+2]
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-deploy/hcp-deploy-aws.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hc-create-aws-multiple-zones_{context}"]
7+
= Creating a hosted cluster in multiple zones on {aws-short}
8+
9+
You can create a hosted cluster in multiple zones on {aws-first} by using the `hcp` command-line interface (CLI).
10+
11+
.Prerequisites
12+
13+
* You created an {aws-short} Identity and Access Management (IAM) role and {aws-short} Security Token Service (STS) credentials.
14+
15+
.Procedure
16+
17+
* Create a hosted cluster in multiple zones on {aws-short} by running the following command:
18+
+
19+
[source,terminal]
20+
----
21+
$ hcp create cluster aws \
22+
--name <hosted_cluster_name> \// <1>
23+
--node-pool-replicas=<node_pool_replica_count> \// <2>
24+
--base-domain <basedomain> \// <3>
25+
--pull-secret <path_to_pull_secret> \// <4>
26+
--role-arn <arn_role> \// <5>
27+
--region <region> \// <6>
28+
--zones <zones> \// <7>
29+
--sts-creds <path_to_sts_credential_file> <8>
30+
----
31+
<1> Specify the name of your hosted cluster, for instance, `example`.
32+
<2> Specify the node pool replica count, for example, `2`.
33+
<3> Specify your base domain, for example, `example.com`.
34+
<4> Specify the path to your pull secret, for example, `/user/name/pullsecret`.
35+
<5> Specify the Amazon Resource Name (ARN), for example, `arn:aws:iam::820196288204:role/myrole`.
36+
<6> Specify the {aws-short} region name, for example, `us-east-1`.
37+
<7> Specify availability zones within your {aws-short} region, for example, `us-east-1a`, and `us-east-1b`.
38+
<8> Specify the path to your {aws-short} STS credentials file, for example, `/home/user/sts-creds/sts-creds.json`.
39+
40+
For each specified zone, the following infrastructure is created:
41+
42+
* Public subnet
43+
* Private subnet
44+
* NAT gateway
45+
* Private route table
46+
47+
A public route table is shared across public subnets.
48+
49+
One `NodePool` resource is created for each zone. The node pool name is suffixed by the zone name. The private subnet for zone is set in `spec.platform.aws.subnet.id`.

modules/hcp-access-hc-aws-hcpcli.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted-control-planes/hcp-deploy/hcp-deploy-aws.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-access-hc-aws-hcpcli_{context}"]
7+
= Accessing a hosted cluster on {aws-short} by using the hcp CLI
8+
9+
You can access the hosted cluster by using the `hcp` command-line interface (CLI) to generate the `kubeconfig` file.
10+
11+
.Procedure
12+
13+
. Generate the `kubeconfig` file by entering the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ hcp create kubeconfig --namespace <hosted_cluster_namespace> --name <hosted_cluster_name> > <hosted_cluster_name>.kubeconfig
18+
----
19+
20+
. After you save the `kubeconfig` file, you can access the hosted cluster by entering the following command:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc --kubeconfig <hosted_cluster_name>.kubeconfig get nodes
25+
----

modules/hcp-access-hc-aws.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted-control-planes/hcp-deploy/hcp-deploy-aws.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-create-private-hc-aws_{context}"]
7+
= Accessing a hosted cluster on {aws-short}
8+
9+
You can access the hosted cluster by getting the `kubeconfig` file and the `kubeadmin` credentials directly from resources.
10+
11+
You must be familiar with the access secrets for hosted clusters. The hosted cluster namespace contains hosted cluster resources, and the hosted control plane namespace is where the hosted control plane runs. The secret name formats are as follows:
12+
13+
* `kubeconfig` secret: `<hosted-cluster-namespace>-<name>-admin-kubeconfig`. For example, `clusters-hypershift-demo-admin-kubeconfig`.
14+
* `kubeadmin` password secret: `<hosted-cluster-namespace>-<name>-kubeadmin-password`. For example, `clusters-hypershift-demo-kubeadmin-password`.
15+
16+
.Procedure
17+
18+
* The `kubeconfig` secret contains a Base64-encoded `kubeconfig` field, which you can decode and save into a file to use with the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc --kubeconfig <hosted_cluster_name>.kubeconfig get nodes
23+
----
24+
+
25+
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.

modules/hcp-access-priv-mgmt-aws.adoc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted-control-planes/hcp-deploy/hcp-deploy-aws.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-access-private-hc-aws_{context}"]
7+
= Accessing a private management cluster on {aws-short}
8+
9+
You can access your private management cluster by using the command-line interface (CLI).
10+
11+
.Procedure
12+
13+
. Find the private IPs of nodes by entering the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ aws ec2 describe-instances --filter="Name=tag:kubernetes.io/cluster/<infra_id>,Values=owned" | jq '.Reservations[] | .Instances[] | select(.PublicDnsName=="") | .PrivateIpAddress'
18+
----
19+
20+
. Create a `kubeconfig` file for the hosted cluster that you can copy to a node by entering the following command:
21+
+
22+
[source,terminal]
23+
----
24+
$ hcp create kubeconfig > <hosted_cluster_kubeconfig>
25+
----
26+
27+
. To SSH into one of the nodes through the bastion, enter the following command:
28+
+
29+
[source,terminal]
30+
----
31+
$ ssh -o ProxyCommand="ssh ec2-user@<bastion_ip> -W %h:%p" core@<node_ip>
32+
----
33+
34+
. From the SSH shell, copy the `kubeconfig` file contents to a file on the node by entering the following command:
35+
+
36+
[source,terminal]
37+
----
38+
$ mv <path_to_kubeconfig_file> <new_file_name>
39+
----
40+
41+
. Export the `kubeconfig` file by entering the following command:
42+
+
43+
[source,terminal]
44+
----
45+
$ export KUBECONFIG=<path_to_kubeconfig_file>
46+
----
47+
48+
. Observe the hosted cluster status by entering the following command:
49+
+
50+
[source,terminal]
51+
----
52+
$ oc get clusteroperators clusterversion
53+
----

0 commit comments

Comments
 (0)