Skip to content

Commit e7f9b6d

Browse files
authored
Merge pull request #112605 from lahinson/osdocs-19903-hcp-azure-infra
[OSDOCS-19903]: Creating an infrastructure for HCP on Azure
2 parents f8f4cbb + ed3ddbf commit e7f9b6d

7 files changed

Lines changed: 208 additions & 26 deletions

File tree

hosted_control_planes/hcp-deploy/hcp-deploy-azure.adoc

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,35 @@ include::modules/hcp-azure-oidc.adoc[leveloffset=+2]
3232
3333
include::modules/hcp-azure-workload-id.adoc[leveloffset=+2]
3434

35-
include::modules/hcp-azure-workload-id-delete.adoc[leveloffset=+2]
35+
include::modules/hcp-azure-infra.adoc[leveloffset=+2]
36+
37+
[role="_additional-resources"]
38+
.Additional resources
3639

37-
// include::modules/hcp-azure-infra-sep.adoc[leveloffset=+2]
40+
* xref:../../hosted_control_planes/hcp-deploy/hcp-deploy-azure.adoc#hcp-azure-workload-id_hcp-deploy-azure[Creating {azure-short} Workload Identities]
3841
3942
//include::modules/hcp-azure-mgmt-cluster.adoc[leveloffset=+1]
4043

4144
// include::modules/hcp-azure-create-hosted.adoc[leveloffset=+1]
4245

43-
//include::modules/hcp-azure-create-private-hosted.adoc[leveloffset=+1]
46+
// include::modules/hcp-azure-private.adoc[leveloffset=+1]
47+
48+
// include::modules/hcp-azure-private-iam.adoc[leveloffset=+2]
49+
50+
// include::modules/hcp-azure-private-infra.adoc[leveloffset=+2]
4451

45-
//include::modules/hcp-azure-autoscaling.adoc[leveloffset=+1]
52+
// include::modules/hcp-azure-private-hosted.adoc[leveloffset=+2]
53+
54+
// include::modules/hcp-azure-autoscaling.adoc[leveloffset=+1]
4655

4756
// include::modules/hcp-azure-hc-config-params.adoc[leveloffset=+1]
4857

4958
// include::modules/hcp-azure-nodepool-config-params.adoc[leveloffset=+2]
59+
60+
include::modules/hcp-azure-delete.adoc[leveloffset=+1]
61+
62+
include::modules/hcp-azure-cluster-delete.adoc[leveloffset=+2]
63+
64+
include::modules/hcp-azure-infra-delete.adoc[leveloffset=+2]
65+
66+
include::modules/hcp-azure-workload-id-delete.adoc[leveloffset=+2]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//Module included in the following assemblies:
2+
// hosted_control_planes/hcp-deploy/hcp-deploy-azure.adoc
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="hcp-azure-cluster-delete_{context}"]
6+
= Deleting a hosted cluster on {azure-short}
7+
8+
[role="_abstract"]
9+
If you are no longer using a hosted cluster on {azure-short}, you can delete it.
10+
11+
.Procedure
12+
13+
* To delete a hosted cluster, enter the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ hcp destroy cluster azure \
18+
--name $CLUSTER_NAME \
19+
--azure-creds $AZURE_CREDS \
20+
--dns-zone-rg-name $PERSISTENT_RG_NAME \
21+
--preserve-resource-group
22+
----
23+
+
24+
** `--name` specifies your hosted cluster name.
25+
** `--azure-creds` specifies an {azure-short} credentials file that has permission to create infrastructure resources, such as virtual networks, subnets, and load balancers.
26+
** `--dns-zone-rg-name` specifies the name of the resource group that contains your DNS zone.
27+
** `--preserve-resource-group` specifies that the infrastructure will be preserved. If you do not want to preserve the infrastructure, do not include this flag.

modules/hcp-azure-delete.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//Module included in the following assemblies:
2+
// hosted_control_planes/hcp-deploy/hcp-deploy-azure.adoc
3+
4+
:_mod-docs-content-type: CONCEPT
5+
[id="hcp-azure-delete_{context}"]
6+
= Deleting an {azure-short} hosted cluster and its resources
7+
8+
[role="_abstract"]
9+
If you no longer need a hosted cluster, you can remove it and its infrastructure. Any related Workload Identities and OIDC issuers that were created during setup can be reused for other clusters or deleted separately if you no longer need them.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//Module included in the following assemblies:
2+
// hosted_control_planes/hcp-deploy/hcp-deploy-azure.adoc
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="hcp-azure-infra-delete_{context}"]
6+
= Deleting {azure-short} infrastructure
7+
8+
[role="_abstract"]
9+
If you have {azure-short} infrastructure without a hosted cluster, you can remove the infrastructure if you are not using it.
10+
11+
For example, this scenario can happen if you created the infrastructure standalone but never created a hosted cluster. Or, you might have manually deleted the hosted cluster or management cluster, but the infrastructure resources still exist.
12+
13+
You can delete the entire infrastructure, or delete cluster-specific resources but preserve the main resource group. Preserving the main resource group is helpful when you have other resources in the same resource group that you want to keep.
14+
15+
If you have a hosted cluster and want to delete infrastructure while you delete the hosted cluster, follow the steps in "Deleting a hosted cluster on {azure-short}", but omit the `--preserve-resource-group` flag.
16+
17+
.Procedure
18+
19+
* To delete the infrastructure, enter one of the following commands:
20+
+
21+
** To delete the infrastructure, including the resource group, enter the following command:
22+
+
23+
[source,terminal]
24+
----
25+
$ hcp destroy infra azure \
26+
--name <my_cluster_name> \
27+
--infra-id <infra_id> \
28+
--azure-creds <azure_credentials_file>
29+
----
30+
+
31+
*** `--name` specifies your hosted cluster name.
32+
*** `--infra-id` specifies a unique name that identifies your infrastructure. This value is used to name and tag {azure-short} resources. Typically, it is the name of your cluster with a suffix appended to it.
33+
*** `--azure-creds` specifies an {azure-short} credentials file that has permission to create infrastructure resources, such as virtual networks, subnets, and load balancers.
34+
+
35+
** To preserve the resource group but delete only cluster-specific resources, enter the following command:
36+
+
37+
[source,terminal]
38+
----
39+
$ hcp destroy infra azure \
40+
--name <my_cluster_name> \
41+
--infra-id <infra_id> \
42+
--azure-creds <azure_credentials_file> \
43+
--preserve-resource-group
44+
----
45+
+
46+
*** `--name` specifies your hosted cluster name.
47+
*** `--infra-id` specifies a unique name that identifies your infrastructure. This value is used to name and tag {azure-short} resources. Typically, it is the name of your cluster with a suffix appended to it.
48+
*** `--azure-creds` specifies an {azure-short} credentials file that has permission to create infrastructure resources, such as virtual networks, subnets, and load balancers.
49+
*** `--preserve-resource-group` specifies that you want to preserve the resource group.
50+
51+

modules/hcp-azure-infra-sep.adoc

Lines changed: 0 additions & 11 deletions
This file was deleted.

modules/hcp-azure-infra.adoc

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
//Module included in the following assemblies:
2+
// hosted_control_planes/hcp-deploy/hcp-deploy-azure.adoc
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="hcp-azure-infra_{context}"]
6+
= Creating {azure-short} infrastructure
7+
8+
[role="_abstract"]
9+
Create an {azure-short} infrastructure separately so that when you create a hosted cluster on {azure-short}, you can use pre-existing infrastructure.
10+
11+
.Prerequisites
12+
13+
* You have an {azure-short} credentials file with the following format:
14+
+
15+
[source,json]
16+
----
17+
{
18+
"subscriptionId": "<my_subscription_id>",
19+
"tenantId": "<my_tenant_id>",
20+
"clientId": "<my_client_id>",
21+
"clientSecret": "<my_client_secret>"
22+
}
23+
----
24+
25+
* You have an existing public DNS zone in your {azure-short} subscription for your base domain.
26+
27+
* You created Workload Identities. For more information, see "Creating {azure-short} Workload Identities".
28+
29+
.Procedure
30+
31+
* To create the infrastructure with a new virtual network, subnet, and network security group, enter the following command:
32+
+
33+
[source,terminal]
34+
----
35+
$ hcp create infra azure \
36+
--name <my_cluster_name> \
37+
--infra-id <infra_id> \
38+
--azure-creds <azure_credentials_file> \
39+
--base-domain <base_domain> \
40+
--location <location> \
41+
--workload-identities-file <workload_identities_file> \
42+
--assign-identity-roles \
43+
--dns-zone-rg-name <dns_zone_rg> \
44+
--output-file <output_infra_file>
45+
----
46+
+
47+
where:
48+
+
49+
** `--name` specifies the name of the hosted cluster you intend to create.
50+
** `--infra-id` specifies a unique name that identifies your infrastructure. This value is used to name and tag {azure-short} resources. Typically, it is the name of your cluster with a suffix appended to it.
51+
** `--azure-creds` specifies an {azure-short} credentials file that has permission to create infrastructure resources, such as virtual networks, subnets, and load balancers.
52+
** `--base-domain` specifies the base domain for the ingress of your hosted cluster. The base domain must correspond to an existing public DNS zone in your {azure-short} subscription.
53+
** `--location` specifies the {azure-short} region where you want to create the infrastructure, such as `eastus` or `westus2`.
54+
** `--workload-identities-file` specifies the path to the JSON file that contains the Workload Identity configuration.
55+
** `--assign-identity-roles` specifies that automatic RBAC role assignment is enabled for Workload Identities.
56+
** `--dns-zone-rg-name` specifies the name of the resource group that contains your public DNS zone.
57+
** `--output-file` specifies the file where the details of the infrastructure are stored in YAML format.
58+
59+
* To create the infrastructure with an existing virtual network, subnet, and network security group, enter the following command:
60+
+
61+
[source,terminal]
62+
----
63+
$ hcp create infra azure \
64+
--name <my_cluster_name> \
65+
--infra-id <infra_id> \
66+
--azure-creds <azure_credentials_file> \
67+
--base-domain <base_domain> \
68+
--location <location> \
69+
--workload-identities-file <workload_identities_file> \
70+
--vnet-id /subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Network/virtualNetworks/<vnet_name> \
71+
--subnet-id /subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Network/virtualNetworks/<vnet_name>/subnets/<subnet_name> \
72+
--network-security-group-id /subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Network/networkSecurityGroups/<network_security_group_name> \
73+
--assign-identity-roles \
74+
--dns-zone-rg-name <dns_zone_rg> \
75+
--output-file <output_infra_file>
76+
----
77+
+
78+
where:
79+
+
80+
** `--name` specifies the name of the hosted cluster you intend to create.
81+
** `--infra-id` specifies a unique name that identifies your infrastructure. This value is used to name and tag {azure-short} resources. Typically, it is the name of your cluster with a suffix appended to it.
82+
** `--azure-creds` specifies an {azure-short} credentials file that has permission to create infrastructure resources, such as virtual networks, subnets, and load balancers.
83+
** `--base-domain` specifies the base domain for the ingress of your hosted cluster. The base domain must correspond to an existing public DNS zone in your {azure-short} subscription.
84+
** `--location` specifies the {azure-short} region where you want to create the infrastructure, such as `eastus` or `westus2`.
85+
** `--workload-identities-file` specifies the path to the JSON file that contains the Workload Identity configuration.
86+
** `--vnet-id` specifies your existing virtual network ID, which includes your subscription ID and your virtual network name.
87+
** `--subnet-id` specifies the ARM resource ID of your subnet, which includes your subscription ID, virtual network name, and subnet name.
88+
** `--network-security-group-id` specifies your existing network security group ID, which includes your subscription ID and your network security group name.
89+
** `--assign-identity-roles` specifies that automatic RBAC role assignment is enabled for Workload Identities.
90+
** `--dns-zone-rg-name` specifies the name of the resource group that contains your public DNS zone.
91+
** `--output-file` specifies the file where the details of the infrastructure are stored in YAML format.
92+

modules/hcp-azure-workload-id-delete.adoc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// hosted_control_planes/hcp-deploy/hcp-deploy-azure.adoc
33

44
:_mod-docs-content-type: PROCEDURE
5-
[id="hcp-azure-workload-delete_{context}"]
5+
[id="hcp-azure-workload-id-delete_{context}"]
66
= Deleting {azure-short} Workload Identities
77

88
[role="_abstract"]
@@ -30,14 +30,11 @@ $ hcp destroy iam azure \
3030
--cloud <my_cloud_environment>
3131
----
3232
+
33-
where:
34-
+
35-
`<azure_credentials_file>`:: Specifies the {azure-short} credentials file with permission to create managed identities and federated credentials.
36-
`<workload_identities_file>`:: Specifies the path to the Workload Identities JSON file, such as `my-cluster-name-iam-output.json`.
37-
`<resource_group>`:: Specifies the name of the resource group where you created identities.
38-
`<my_cluster_name>`:: Specifies the name of your hosted cluster.
39-
`<infra_id>`:: Specifies the unique identifier for naming {azure-short} resources. Typically, this identifier is the cluster name with a suffix.
40-
`<dns_zone_rg>`:: Specifies the DNS zone resource group.
41-
+
42-
Optionally, you can also specify the `--cloud` flag to set the {azure-short} cloud environment. The default value is `AzurePublicCloud`.
33+
** `<azure_credentials_file>` specifies the {azure-short} credentials file with permission to create managed identities and federated credentials.
34+
** `<workload_identities_file>` specifies the path to the Workload Identities JSON file, such as `my-cluster-name-iam-output.json`.
35+
** `<resource_group>` specifies the name of the resource group where you created identities.
36+
** `<my_cluster_name>` specifies the name of your hosted cluster.
37+
** `<infra_id>` specifies the unique identifier for naming {azure-short} resources. Typically, this identifier is the cluster name with a suffix.
38+
** `<dns_zone_rg>` specifies the DNS zone resource group.
39+
** `<my_cloud_environment>` specifies the {azure-short} cloud environment. Setting the `--cloud` flag is optional. The default value is `AzurePublicCloud`.
4340

0 commit comments

Comments
 (0)