2.4. 서비스 주체 생성
OpenShift Container Platform과 해당 설치 프로그램은 Azure Resource Manager를 통해 Microsoft Azure 리소스를 생성해야 하므로 이를 대표하는 서비스 주체를 생성해야 합니다.
사전 요구 사항
- Azure CLI를 설치 또는 업데이트합니다.
- Azure 계정은 사용하는 서브스크립션에 대한 필요한 역할을 갖습니다.
프로세스
환경을 등록합니다.
$ az cloud register -n AzureStackCloud --endpoint-resource-manager <endpoint>1 - 1
- Azure Resource Manager 엔드포인트 'https://management.<region>.<fqdn>/'을 지정합니다.
자세한 내용은 Microsoft 설명서 를 참조하십시오.
활성 환경을 설정합니다.
$ az cloud set -n AzureStackCloudAzure Stack Hub의 특정 API 버전을 사용하도록 환경 구성을 업데이트합니다.
$ az cloud update --profile 2019-03-01-hybridAzure CLI에 로그인합니다.
$ az login다중 테넌트 환경에 있는 경우 테넌트 ID도 제공해야 합니다.
Azure 계정이 서브스크립션을 사용하는 경우, 올바른 서브스크립션을 사용하고 있는지 확인합니다.
사용 가능한 계정 목록을 보고 클러스터에 사용하려는 서브스크립션의
tenantId값을 기록합니다.$ az account list --refresh출력 예
[ { "cloudName": AzureStackCloud", "id": "9bab1460-96d5-40b3-a78e-17b15e978a80", "isDefault": true, "name": "Subscription Name", "state": "Enabled", "tenantId": "6057c7e9-b3ae-489d-a54e-de3f6bf6a8ee", "user": { "name": "you@example.com", "type": "user" } } ]활성 계정 세부 사항을 보고
tenantId값이 사용하려는 서브스크립션과 일치하는지 확인합니다.$ az account show출력 예
{ "environmentName": AzureStackCloud", "id": "9bab1460-96d5-40b3-a78e-17b15e978a80", "isDefault": true, "name": "Subscription Name", "state": "Enabled", "tenantId": "6057c7e9-b3ae-489d-a54e-de3f6bf6a8ee",1 "user": { "name": "you@example.com", "type": "user" } }- 1
tenantId매개변수의 값이 올바른 서브스크립션의 UUID인지 확인합니다.
올바른 서브스크립션을 사용하지 않는 경우, 활성 서브스크립션을 변경합니다.
$ az account set -s <subscription_id>1 - 1
- 서브스크립션 ID를 지정합니다.
서브스크립션 ID 업데이트를 확인합니다.
$ az account show출력 예
{ "environmentName": AzureStackCloud", "id": "33212d16-bdf6-45cb-b038-f6565b61edda", "isDefault": true, "name": "Subscription Name", "state": "Enabled", "tenantId": "8049c7e9-c3de-762d-a54e-dc3f6be6a7ee", "user": { "name": "you@example.com", "type": "user" } }
-
출력에서
tenantId및id매개변수 값을 기록합니다. OpenShift Container Platform 설치 중에 이러한 값이 필요합니다. 계정에 대한 서비스 주체를 생성합니다.
$ az ad sp create-for-rbac --role Contributor --name <service_principal> \1 --scopes /subscriptions/<subscription_id>2 --years <years>3 출력 예
Creating 'Contributor' role assignment under scope '/subscriptions/<subscription_id>' The output includes credentials that you must protect. Be sure that you do not include these credentials in your code or check the credentials into your source control. For more information, see https://aka.ms/azadsp-cli { "appId": "ac461d78-bf4b-4387-ad16-7e32e328aec6", "displayName": <service_principal>", "password": "00000000-0000-0000-0000-000000000000", "tenantId": "8049c7e9-c3de-762d-a54e-dc3f6be6a7ee" }-
이전 출력의
appId및password매개변수 값을 기록합니다. OpenShift Container Platform 설치 중에 이러한 값이 필요합니다.