2.2.2. Azure의 머신 세트사용자 지정 리소스에 대한 샘플 YAML
이 샘플 YAML은 리전의 1
Microsoft Azure 영역에서 실행되는 머신 세트를 정의하고 node-role.kubernetes.io/<role>: ""
로 레이블이 지정된 노드를 만듭니다.
이 샘플에서 <infrastructure_id>
는 클러스터를 프로비저닝할 때 설정한 클러스터 ID를 기반으로 하는 인프라 ID 레이블이며 <role>
은 추가할 노드 레이블입니다.
apiVersion: machine.openshift.io/v1beta1 kind: MachineSet metadata: labels: machine.openshift.io/cluster-api-cluster: <infrastructure_id> 1 machine.openshift.io/cluster-api-machine-role: <role> 2 machine.openshift.io/cluster-api-machine-type: <role> 3 name: <infrastructure_id>-<role>-<region> 4 namespace: openshift-machine-api spec: replicas: 1 selector: matchLabels: machine.openshift.io/cluster-api-cluster: <infrastructure_id> 5 machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<region> 6 template: metadata: creationTimestamp: null labels: machine.openshift.io/cluster-api-cluster: <infrastructure_id> 7 machine.openshift.io/cluster-api-machine-role: <role> 8 machine.openshift.io/cluster-api-machine-type: <role> 9 machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<region> 10 spec: metadata: creationTimestamp: null labels: node-role.kubernetes.io/<role>: "" 11 providerSpec: value: apiVersion: azureproviderconfig.openshift.io/v1beta1 credentialsSecret: name: azure-cloud-credentials namespace: openshift-machine-api image: offer: "" publisher: "" resourceID: /resourceGroups/<infrastructure_id>-rg/providers/Microsoft.Compute/images/<infrastructure_id> 12 sku: "" version: "" internalLoadBalancer: "" kind: AzureMachineProviderSpec location: <region> 13 managedIdentity: <infrastructure_id>-identity 14 metadata: creationTimestamp: null natRule: null networkResourceGroup: "" osDisk: diskSizeGB: 128 managedDisk: storageAccountType: Premium_LRS osType: Linux publicIP: false publicLoadBalancer: "" resourceGroup: <infrastructure_id>-rg 15 sshPrivateKey: "" sshPublicKey: "" subnet: <infrastructure_id>-<role>-subnet 16 17 userDataSecret: name: worker-user-data 18 vmSize: Standard_DS4_v2 vnet: <infrastructure_id>-vnet 19 zone: "1" 20
- 1 5 7 12 14 15 16 19
- 클러스터를 프로비저닝할 때 설정한 클러스터 ID를 기반으로 하는 인프라 ID를 지정합니다. OpenShift CLI 패키지가 설치되어 있으면 다음 명령을 실행하여 인프라 ID를 얻을 수 있습니다.
$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster
다음 명령을 실행하여 서브넷을 가져올 수 있습니다.
$ oc -n openshift-machine-api \ -o jsonpath='{.spec.template.spec.providerSpec.value.subnet}{"\n"}' \ get machineset/<infrastructure_id>-worker-centralus1
다음 명령을 실행하여 vnet을 가져올 수 있습니다.
$ oc -n openshift-machine-api \ -o jsonpath='{.spec.template.spec.providerSpec.value.vnet}{"\n"}' \ get machineset/<infrastructure_id>-worker-centralus1
- 2 3 8 9 11 17 18
- 추가할 노드 레이블을 지정합니다.
- 4 6 10
- 인프라 ID, 노드 레이블, 리전을 지정합니다.
- 13
- 머신을 배치할 리전을 지정합니다.
- 20
- 머신을 배치할 리전 내 영역을 지정합니다. 해당 리전이 지정한 영역을 지원하는지 확인합니다.