From bfb0e54cc0911d0cce80df6c16716d1b735acbd6 Mon Sep 17 00:00:00 2001 From: Jeana Routh Date: Fri, 21 Jan 2022 09:25:06 -0500 Subject: [PATCH] OSDOCS-2333: Azure Stack Hub MAPI integration --- _topic_maps/_topic_map.yml | 2 + .../creating-infrastructure-machinesets.adoc | 9 +- .../creating-machineset-azure-stack-hub.adoc | 23 +++ modules/machine-api-overview.adoc | 1 + .../machine-user-provisioned-limitations.adoc | 1 + modules/machineset-creating.adoc | 13 +- ...set-customer-managed-encryption-azure.adoc | 1 + modules/machineset-yaml-azure-stack-hub.adoc | 176 ++++++++++++++++++ modules/machineset-yaml-azure.adoc | 2 +- 9 files changed, 225 insertions(+), 3 deletions(-) create mode 100644 machine_management/creating_machinesets/creating-machineset-azure-stack-hub.adoc create mode 100644 modules/machineset-yaml-azure-stack-hub.adoc diff --git a/_topic_maps/_topic_map.yml b/_topic_maps/_topic_map.yml index a9acada30c..89b43819d3 100644 --- a/_topic_maps/_topic_map.yml +++ b/_topic_maps/_topic_map.yml @@ -1658,6 +1658,8 @@ Topics: File: creating-machineset-aws - Name: Creating a machine set on Azure File: creating-machineset-azure + - Name: Creating a machine set on Azure Stack Hub + File: creating-machineset-azure-stack-hub - Name: Creating a machine set on GCP File: creating-machineset-gcp - Name: Creating a machine set on OpenStack diff --git a/machine_management/creating-infrastructure-machinesets.adoc b/machine_management/creating-infrastructure-machinesets.adoc index e8696aaf01..d4f2a2d4ab 100644 --- a/machine_management/creating-infrastructure-machinesets.adoc +++ b/machine_management/creating-infrastructure-machinesets.adoc @@ -13,7 +13,7 @@ You can use infrastructure machine sets to create machines that host only infras include::modules/infrastructure-components.adoc[leveloffset=+1] -For information on infrastructure nodes and which components can run on infrastructure nodes, see the "Red Hat OpenShift control plane and infrastructure nodes" section in the link:https://www.redhat.com/en/resources/openshift-subscription-sizing-guide[OpenShift sizing and subscription guide for enterprise Kubernetes] document. +For information about infrastructure nodes and which components can run on infrastructure nodes, see the "Red Hat OpenShift control plane and infrastructure nodes" section in the link:https://www.redhat.com/en/resources/openshift-subscription-sizing-guide[OpenShift sizing and subscription guide for enterprise Kubernetes] document. [id="creating-infrastructure-machinesets-production"] == Creating infrastructure machine sets for production environments @@ -34,6 +34,13 @@ include::modules/machineset-yaml-azure.adoc[leveloffset=+3] Machine sets running on Azure support non-guaranteed xref:../machine_management/creating_machinesets/creating-machineset-azure.adoc#machineset-non-guaranteed-instance_creating-machineset-azure[Spot VMs]. You can save on costs by using Spot VMs at a lower price compared to standard VMs on Azure. You can xref:../machine_management/creating_machinesets/creating-machineset-azure.adoc#machineset-creating-non-guaranteed-instance_creating-machineset-azure[configure Spot VMs] by adding `spotVMOptions` to the `MachineSet` YAML file. +include::modules/machineset-yaml-azure-stack-hub.adoc[leveloffset=+3] + +[NOTE] +==== +Machine sets running on Azure Stack Hub do not support non-guaranteed Spot VMs. +==== + include::modules/machineset-yaml-gcp.adoc[leveloffset=+3] Machine sets running on GCP support non-guaranteed xref:../machine_management/creating_machinesets/creating-machineset-gcp.adoc#machineset-non-guaranteed-instance_creating-machineset-gcp[preemptible VM instances]. You can save on costs by using preemptible VM instances at a lower price diff --git a/machine_management/creating_machinesets/creating-machineset-azure-stack-hub.adoc b/machine_management/creating_machinesets/creating-machineset-azure-stack-hub.adoc new file mode 100644 index 0000000000..f8366d4439 --- /dev/null +++ b/machine_management/creating_machinesets/creating-machineset-azure-stack-hub.adoc @@ -0,0 +1,23 @@ +[id="creating-machineset-azure-stack-hub"] += Creating a machine set on Azure Stack Hub +include::modules/common-attributes.adoc[] +:context: creating-machineset-azure-stack-hub + +toc::[] + +You can create a different machine set to serve a specific purpose in your {product-title} cluster on Microsoft Azure Stack Hub. For example, you might create infrastructure machine sets and related machines so that you can move supporting workloads to the new machines. + +//[IMPORTANT] admonition for UPI +include::modules/machine-user-provisioned-limitations.adoc[leveloffset=+1] + +//Machine API overview +include::modules/machine-api-overview.adoc[leveloffset=+1] + +//Sample YAML for a machine set custom resource on Azure Stack Hub +include::modules/machineset-yaml-azure-stack-hub.adoc[leveloffset=+1] + +//Creating a machine set +include::modules/machineset-creating.adoc[leveloffset=+1] + +//Enabling customer-managed encryption keys for a machine set +include::modules/machineset-customer-managed-encryption-azure.adoc[leveloffset=+1] diff --git a/modules/machine-api-overview.adoc b/modules/machine-api-overview.adoc index 1b8a3b0f56..cf8ad6df72 100644 --- a/modules/machine-api-overview.adoc +++ b/modules/machine-api-overview.adoc @@ -2,6 +2,7 @@ // // * machine_management/creating_machinesets/creating-machineset-aws.adoc // * machine_management/creating_machinesets/creating-machineset-azure.adoc +// * machine_management/creating_machinesets/creating-machineset-azure-stack-hub.adoc // * machine_management/creating_machinesets/creating-machineset-gcp.adoc // * machine_management/creating_machinesets/creating-machineset-osp.adoc // * machine_management/creating_machinesets/creating-machineset-vsphere.adoc diff --git a/modules/machine-user-provisioned-limitations.adoc b/modules/machine-user-provisioned-limitations.adoc index 1896a7ec33..d705532ef8 100644 --- a/modules/machine-user-provisioned-limitations.adoc +++ b/modules/machine-user-provisioned-limitations.adoc @@ -3,6 +3,7 @@ // * machine_management/creating-infrastructure-machinesets.adoc // * machine_management/creating_machinesets/creating-machineset-aws.adoc // * machine_management/creating_machinesets/creating-machineset-azure.adoc +// * machine_management/creating_machinesets/creating-machineset-azure-stack-hub.adoc // * machine_management/creating_machinesets/creating-machineset-gcp.adoc // * machine_management/creating_machinesets/creating-machineset-osp.adoc // * machine_management/creating_machinesets/creating-machineset-rhv.adoc diff --git a/modules/machineset-creating.adoc b/modules/machineset-creating.adoc index 2681ea5a9f..cbf37b5ddf 100644 --- a/modules/machineset-creating.adoc +++ b/modules/machineset-creating.adoc @@ -3,6 +3,7 @@ // * machine_management/creating-infrastructure-machinesets.adoc // * machine_management/creating_machinesets/creating-machineset-aws.adoc // * machine_management/creating_machinesets/creating-machineset-azure.adoc +// * machine_management/creating_machinesets/creating-machineset-azure-stack-hub.adoc // * machine_management/creating_machinesets/creating-machineset-gcp.adoc // * machine_management/creating_machinesets/creating-machineset-osp.adoc // * machine_management/creating_machinesets/creating-machineset-vsphere.adoc @@ -17,10 +18,12 @@ endif::[] ifeval::["{context}" == "creating-windows-machineset-azure"] :win: endif::[] +ifeval::["{context}" == "creating-machineset-azure-stack-hub"] +:ash: +endif::[] ifeval::["{context}" == "creating-windows-machineset-vsphere"] :win: endif::[] - ifeval::["{context}" == "creating-machineset-vsphere"] :vsphere: endif::[] @@ -39,12 +42,20 @@ ifdef::vsphere[] * Create a tag inside your vCenter instance based on the cluster API name. This tag is utilized by the machine set to associate the {product-title} nodes to the provisioned virtual machines (VM). For directions on creating tags in vCenter, see the VMware documentation for link:https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.vcenterhost.doc/GUID-E8E854DD-AA97-4E0C-8419-CE84F93C4058.html[vSphere Tags and Attributes]. * Have the necessary permissions to deploy VMs in your vCenter instance and have the required access to the datastore specified. endif::vsphere[] +ifdef::ash[] +* Create an availability set in which to deploy Azure Stack Hub machines. +endif::ash[] .Procedure . Create a new YAML file that contains the machine set custom resource (CR) sample and is named `.yaml`. + +ifndef::ash[] Ensure that you set the `` and `` parameter values. +endif::ash[] +ifdef::ash[] +Ensure that you set the ``, ``, and `` parameter values. +endif::ash[] .. If you are not sure which value to set for a specific field, you can check an existing machine set from your cluster: + diff --git a/modules/machineset-customer-managed-encryption-azure.adoc b/modules/machineset-customer-managed-encryption-azure.adoc index 0c688ba57f..e0bbb37159 100644 --- a/modules/machineset-customer-managed-encryption-azure.adoc +++ b/modules/machineset-customer-managed-encryption-azure.adoc @@ -1,6 +1,7 @@ // Module included in the following assemblies: // // * machine_management/creating_machinesets/creating-machineset-gcp.adoc +// * machine_management/creating_machinesets/creating-machineset-azure-stack-hub.adoc [id="machineset-enabling-customer-managed-encryption-azure_{context}"] = Enabling customer-managed encryption keys for a machine set diff --git a/modules/machineset-yaml-azure-stack-hub.adoc b/modules/machineset-yaml-azure-stack-hub.adoc new file mode 100644 index 0000000000..17de125646 --- /dev/null +++ b/modules/machineset-yaml-azure-stack-hub.adoc @@ -0,0 +1,176 @@ +// Module included in the following assemblies: +// +// * machine_management/creating-infrastructure-machinesets.adoc +// * machine_management/creating_machinesets/creating-machineset-azure-stack-hub.adoc +// * post_installation_configuration/cluster-tasks.adoc + +ifeval::["{context}" == "creating-infrastructure-machinesets"] +:infra: +endif::[] +ifeval::["{context}" == "post-install-cluster-tasks"] +:infra: +endif::[] + +[id="machineset-yaml-azure-stack-hub_{context}"] += Sample YAML for a machine set custom resource on Azure Stack Hub + +This sample YAML defines a machine set that runs in the `1` Microsoft Azure zone in a region and creates nodes that are labeled with +ifndef::infra[`node-role.kubernetes.io/: ""`.] +ifdef::infra[`node-role.kubernetes.io/infra: ""`.] + +In this sample, `` is the infrastructure ID label that is based on the cluster ID that you set when you provisioned the cluster, and +ifndef::infra[``] +ifdef::infra[``] +is the node label to add. + +[source,yaml] +---- +apiVersion: machine.openshift.io/v1beta1 +kind: MachineSet +metadata: + labels: + machine.openshift.io/cluster-api-cluster: <1> +ifndef::infra[] + machine.openshift.io/cluster-api-machine-role: <2> + machine.openshift.io/cluster-api-machine-type: <2> + name: -- <3> +endif::infra[] +ifdef::infra[] + machine.openshift.io/cluster-api-machine-role: <2> + machine.openshift.io/cluster-api-machine-type: <2> + name: -infra- <3> +endif::infra[] + namespace: openshift-machine-api +spec: + replicas: 1 + selector: + matchLabels: + machine.openshift.io/cluster-api-cluster: <1> +ifndef::infra[] + machine.openshift.io/cluster-api-machineset: -- <3> +endif::infra[] +ifdef::infra[] + machine.openshift.io/cluster-api-machineset: -infra- <3> +endif::infra[] + template: + metadata: + creationTimestamp: null + labels: + machine.openshift.io/cluster-api-cluster: <1> +ifndef::infra[] + machine.openshift.io/cluster-api-machine-role: <2> + machine.openshift.io/cluster-api-machine-type: <2> + machine.openshift.io/cluster-api-machineset: -- <3> +endif::infra[] +ifdef::infra[] + machine.openshift.io/cluster-api-machine-role: <2> + machine.openshift.io/cluster-api-machine-type: <2> + machine.openshift.io/cluster-api-machineset: -infra- <3> +endif::infra[] + spec: + metadata: + creationTimestamp: null + labels: +ifndef::infra[] + node-role.kubernetes.io/: "" <2> +endif::infra[] +ifdef::infra[] + node-role.kubernetes.io/infra: "" <2> + taints: <4> + - key: node-role.kubernetes.io/infra + effect: NoSchedule +endif::infra[] + providerSpec: + value: + apiVersion: machine.openshift.io/v1beta1 + availabilitySet: <6> + credentialsSecret: + name: azure-cloud-credentials + namespace: openshift-machine-api + image: + offer: "" + publisher: "" + resourceID: /resourceGroups/-rg/providers/Microsoft.Compute/images/ <1> + sku: "" + version: "" + internalLoadBalancer: "" + kind: AzureMachineProviderSpec +ifndef::infra[] + location: <4> +endif::infra[] +ifdef::infra[] + location: <5> +endif::infra[] + managedIdentity: -identity <1> + metadata: + creationTimestamp: null + natRule: null + networkResourceGroup: "" + osDisk: + diskSizeGB: 128 + managedDisk: + storageAccountType: Premium_LRS + osType: Linux + publicIP: false + publicLoadBalancer: "" + resourceGroup: -rg <1> + sshPrivateKey: "" + sshPublicKey: "" + subnet: --subnet <1> <2> + userDataSecret: + name: worker-user-data <2> + vmSize: Standard_DS4_v2 + vnet: -vnet <1> +ifndef::infra[] + zone: "1" <5> +endif::infra[] +ifdef::infra[] + zone: "1" <7> +endif::infra[] +---- +<1> Specify the infrastructure ID that is based on the cluster ID that you set when you provisioned the cluster. If you have the OpenShift CLI installed, you can obtain the infrastructure ID by running the following command: ++ +[source,terminal] +---- +$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster +---- ++ +You can obtain the subnet by running the following command: ++ +[source,terminal] +---- +$ oc -n openshift-machine-api \ + -o jsonpath='{.spec.template.spec.providerSpec.value.subnet}{"\n"}' \ + get machineset/-worker-centralus1 +---- +You can obtain the vnet by running the following command: ++ +[source,terminal] +---- +$ oc -n openshift-machine-api \ + -o jsonpath='{.spec.template.spec.providerSpec.value.vnet}{"\n"}' \ + get machineset/-worker-centralus1 +---- +ifndef::infra[] +<2> Specify the node label to add. +<3> Specify the infrastructure ID, node label, and region. +<4> Specify the region to place machines on. +<5> Specify the zone within your region to place machines on. Be sure that your region supports the zone that you specify. +<6> Specify the availability set for the cluster. +endif::infra[] +ifdef::infra[] +<2> Specify the `` node label. +<3> Specify the infrastructure ID, `` node label, and region. +<4> Specify a taint to prevent user workloads from being scheduled on infra nodes. +<5> Specify the region to place machines on. +<6> Specify the availability set for the cluster. +<7> Specify the zone within your region to place machines on. Be sure that your region supports the zone that you specify. +endif::infra[] + + +ifeval::["{context}" == "creating-infrastructure-machinesets"] +:!infra: +endif::[] +ifeval::["{context}" == "cluster-tasks"] +:!infra: +endif::[] diff --git a/modules/machineset-yaml-azure.adoc b/modules/machineset-yaml-azure.adoc index 2c74e70a85..a00d141b18 100644 --- a/modules/machineset-yaml-azure.adoc +++ b/modules/machineset-yaml-azure.adoc @@ -12,7 +12,7 @@ ifeval::["{context}" == "post-install-cluster-tasks"] endif::[] [id="machineset-yaml-azure_{context}"] -= Sample YAML for a machine set custom resource on Azure += Sample YAML for a machine set custom resource on Azure This sample YAML defines a machine set that runs in the `1` Microsoft Azure zone in a region and creates nodes that are labeled with ifndef::infra[`node-role.kubernetes.io/: ""`.]