mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
232 lines
8.3 KiB
Plaintext
232 lines
8.3 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * machine_management/creating-infrastructure-machinesets.adoc
|
|
// * machine_management/creating_machinesets/creating-machineset-aws.adoc
|
|
// * installing/installing_aws/aws-compute-edge-zone-tasks.adoc
|
|
|
|
ifeval::["{context}" == "creating-infrastructure-machinesets"]
|
|
:infra:
|
|
endif::[]
|
|
ifeval::["{context}" == "cluster-tasks"]
|
|
:infra:
|
|
endif::[]
|
|
ifeval::["{context}" == "aws-compute-edge-zone-tasks"]
|
|
:edge:
|
|
endif::[]
|
|
|
|
:_mod-docs-content-type: REFERENCE
|
|
[id="machineset-yaml-aws_{context}"]
|
|
= Sample YAML for a compute machine set custom resource on AWS
|
|
|
|
ifndef::edge[]
|
|
The sample YAML defines a compute machine set that runs in the `us-east-1a` Amazon Web Services (AWS) Local Zone and creates nodes that are labeled with
|
|
endif::edge[]
|
|
ifndef::infra,edge[`node-role.kubernetes.io/<role>: ""`.]
|
|
ifdef::infra[`node-role.kubernetes.io/infra: ""`.]
|
|
ifdef::edge[]
|
|
This sample YAML defines a compute machine set that runs in the `us-east-1-nyc-1a` Amazon Web Services (AWS) zone and creates nodes that are labeled with `node-role.kubernetes.io/edge: ""`.
|
|
|
|
[NOTE]
|
|
====
|
|
If you want to reference the sample YAML file in the context of Wavelength Zones, ensure that you replace the AWS Region and zone information with supported Wavelength Zone values.
|
|
====
|
|
endif::[]
|
|
|
|
In this sample, `<infrastructure_id>` is the infrastructure ID label that is based on the cluster ID that you set when you provisioned the cluster, and
|
|
ifndef::infra,edge[`<role>`]
|
|
ifdef::infra[`<infra>`]
|
|
ifdef::edge[`<edge>`]
|
|
is the node label to add.
|
|
|
|
[source,yaml]
|
|
----
|
|
apiVersion: machine.openshift.io/v1beta1
|
|
kind: MachineSet
|
|
metadata:
|
|
labels:
|
|
machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1>
|
|
ifndef::infra,edge[]
|
|
name: <infrastructure_id>-<role>-<zone> <2>
|
|
endif::infra,edge[]
|
|
ifdef::infra[]
|
|
name: <infrastructure_id>-infra-<zone> <2>
|
|
endif::infra[]
|
|
ifdef::edge[]
|
|
name: <infrastructure_id>-edge-<zone> <2>
|
|
endif::edge[]
|
|
namespace: openshift-machine-api
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
|
|
ifdef::edge[]
|
|
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-edge-<zone>
|
|
endif::edge[]
|
|
ifndef::infra,edge[]
|
|
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<zone>
|
|
endif::infra,edge[]
|
|
ifdef::infra[]
|
|
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra-<zone>
|
|
endif::infra[]
|
|
template:
|
|
metadata:
|
|
labels:
|
|
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
|
|
ifndef::infra,edge[]
|
|
machine.openshift.io/cluster-api-machine-role: <role> <3>
|
|
machine.openshift.io/cluster-api-machine-type: <role>
|
|
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<zone>
|
|
endif::infra,edge[]
|
|
ifdef::infra[]
|
|
machine.openshift.io/cluster-api-machine-role: infra <3>
|
|
machine.openshift.io/cluster-api-machine-type: infra
|
|
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra-<zone>
|
|
endif::infra[]
|
|
ifdef::edge[]
|
|
machine.openshift.io/cluster-api-machine-role: edge <3>
|
|
machine.openshift.io/cluster-api-machine-type: edge
|
|
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-edge-<zone>
|
|
endif::edge[]
|
|
spec:
|
|
metadata:
|
|
labels:
|
|
ifndef::infra,edge[]
|
|
node-role.kubernetes.io/<role>: ""
|
|
endif::infra,edge[]
|
|
ifdef::infra[]
|
|
node-role.kubernetes.io/infra: ""
|
|
endif::infra[]
|
|
ifdef::edge[]
|
|
machine.openshift.io/parent-zone-name: <value_of_ParentZoneName>
|
|
machine.openshift.io/zone-group: <value_of_GroupName>
|
|
machine.openshift.io/zone-type: <value_of_ZoneType>
|
|
node-role.kubernetes.io/edge: ""
|
|
endif::edge[]
|
|
providerSpec:
|
|
value:
|
|
ami:
|
|
id: ami-046fe691f52a953f9 <4>
|
|
apiVersion: machine.openshift.io/v1beta1
|
|
blockDevices:
|
|
- ebs:
|
|
iops: 0
|
|
volumeSize: 120
|
|
volumeType: gp2
|
|
credentialsSecret:
|
|
name: aws-cloud-credentials
|
|
deviceIndex: 0
|
|
iamInstanceProfile:
|
|
id: <infrastructure_id>-worker-profile
|
|
instanceType: m6i.large
|
|
kind: AWSMachineProviderConfig
|
|
placement:
|
|
availabilityZone: <zone> <5>
|
|
region: <region> <6>
|
|
securityGroups:
|
|
- filters:
|
|
- name: tag:Name
|
|
values:
|
|
- <infrastructure_id>-node
|
|
- filters:
|
|
- name: tag:Name
|
|
values:
|
|
- <infrastructure_id>-lb
|
|
subnet:
|
|
ifndef::edge[]
|
|
filters:
|
|
- name: tag:Name
|
|
values:
|
|
- <infrastructure_id>-private-<zone> <7>
|
|
endif::edge[]
|
|
ifdef::edge[]
|
|
id: <value_of_PublicSubnetIds> <7>
|
|
publicIp: true
|
|
endif::edge[]
|
|
tags:
|
|
- name: kubernetes.io/cluster/<infrastructure_id>
|
|
value: owned
|
|
- name: <custom_tag_name> <8>
|
|
value: <custom_tag_value>
|
|
userDataSecret:
|
|
name: worker-user-data
|
|
ifdef::infra,edge[]
|
|
taints: <9>
|
|
ifdef::infra[]
|
|
- key: node-role.kubernetes.io/infra
|
|
endif::infra[]
|
|
ifdef::edge[]
|
|
- key: node-role.kubernetes.io/edge
|
|
endif::edge[]
|
|
effect: NoSchedule
|
|
endif::infra,edge[]
|
|
----
|
|
<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
|
|
----
|
|
ifndef::infra,edge[]
|
|
<2> Specify the infrastructure ID, role node label, and zone.
|
|
<3> Specify the role node label to add.
|
|
endif::infra,edge[]
|
|
ifdef::infra[]
|
|
<2> Specify the infrastructure ID, `infra` role node label, and zone.
|
|
<3> Specify the `infra` role node label.
|
|
endif::infra[]
|
|
ifdef::edge[]
|
|
<2> Specify the infrastructure ID, `edge` role node label, and zone name.
|
|
<3> Specify the `edge` role node label.
|
|
endif::edge[]
|
|
<4> Specify a valid {op-system-first} Amazon
|
|
Machine Image (AMI) for your AWS zone for your {product-title} nodes. If you want to use an AWS Marketplace image, you must complete the {product-title} subscription from the link:https://aws.amazon.com/marketplace/fulfillment?productId=59ead7de-2540-4653-a8b0-fa7926d5c845[AWS Marketplace] to obtain an AMI ID for your region.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc -n openshift-machine-api \
|
|
-o jsonpath='{.spec.template.spec.providerSpec.value.ami.id}{"\n"}' \
|
|
get machineset/<infrastructure_id>-<role>-<zone>
|
|
----
|
|
ifndef::edge[]
|
|
<5> Specify the zone name, for example, `us-east-1a`.
|
|
endif::edge[]
|
|
ifdef::edge[]
|
|
<5> Specify the zone name, for example, `us-east-1-nyc-1a`.
|
|
endif::edge[]
|
|
<6> Specify the region, for example, `us-east-1`.
|
|
ifndef::edge[]
|
|
<7> Specify the infrastructure ID and zone.
|
|
endif::edge[]
|
|
ifdef::edge[]
|
|
<7> The ID of the public subnet that you created in AWS {zone-type}. You created this public subnet ID when you finished the procedure for "Creating a subnet in an AWS zone".
|
|
endif::edge[]
|
|
<8> Optional: Specify custom tag data for your cluster. For example, you might add an admin contact email address by specifying a `name:value` pair of `Email:\admin-email@example.com`.
|
|
+
|
|
[NOTE]
|
|
====
|
|
Custom tags can also be specified during installation in the `install-config.yml` file. If the `install-config.yml` file and the machine set include a tag with the same `name` data, the value for the tag from the machine set takes priority over the value for the tag in the `install-config.yml` file.
|
|
====
|
|
ifdef::infra,edge[]
|
|
<9> Specify a taint to prevent user workloads from being scheduled on
|
|
ifdef::infra[`infra`]
|
|
ifdef::edge[`edge`]
|
|
nodes.
|
|
+
|
|
[NOTE]
|
|
====
|
|
After adding the `NoSchedule` taint on the infrastructure node, existing DNS pods running on that node are marked as `misscheduled`. You must either delete or link:https://access.redhat.com/solutions/6592171[add toleration on `misscheduled` DNS pods].
|
|
====
|
|
|
|
endif::infra,edge[]
|
|
|
|
ifeval::["{context}" == "creating-infrastructure-machinesets"]
|
|
:!infra:
|
|
endif::[]
|
|
ifeval::["{context}" == "cluster-tasks"]
|
|
:!infra:
|
|
endif::[]
|
|
ifeval::["{context}" == "aws-compute-edge-zone-tasks"]
|
|
:!edge:
|
|
endif::[]
|