2.6. 서비스 주체 생성
OpenShift Container Platform 및 해당 설치 프로그램은 Azure Resource Manager를 사용하여 Microsoft Azure 리소스를 생성하므로 이를 나타내는 서비스 주체를 생성해야 합니다.
사전 요구 사항
- Azure CLI를 설치 또는 업데이트합니다.
- Azure 계정은 사용하는 서브스크립션에 대한 필요한 역할을 갖습니다.
- 사용자 지정 역할을 사용하려면 설치 관리자 프로비저닝 인프라에 대한 필수 Azure 권한에 나열된 필수 권한이 있는 사용자 지정 역할을 생성했습니다.
프로세스
Azure CLI에 로그인합니다.
$ az login
Azure 계정에서 서브스크립션을 사용하는 경우 올바른 서브스크립션을 사용하고 있는지 확인합니다.
사용 가능한 계정 목록을 보고 클러스터에 사용하려는 서브스크립션의
tenantId
값을 기록합니다.$ az account list --refresh
출력 예
[ { "cloudName": "AzureCloud", "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": "AzureCloud", "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
매개변수의 값이 올바른 서브스크립션 ID인지 확인합니다.
올바른 서브스크립션을 사용하지 않는 경우, 활성 서브스크립션을 변경합니다.
$ az account set -s <subscription_id> 1
- 1
- 서브스크립션 ID를 지정합니다.
서브스크립션 ID 업데이트를 확인합니다.
$ az account show
출력 예
{ "environmentName": "AzureCloud", "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 <role_name> \1 --name <service_principal> \2 --scopes /subscriptions/<subscription_id> 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 설치 중에 이러한 값이 필요합니다. Contributor
역할을 서비스 주체에 적용한 경우 다음 명령을 실행하여사용자 관리자 액세스
역할을 할당합니다.$ az role assignment create --role "User Access Administrator" \ --assignee-object-id $(az ad sp show --id <appId> --query id -o tsv) 1
- 1
- 서비스 주체의
appId
매개변수 값을 지정합니다.
추가 리소스
- CCO 모드에 대한 자세한 내용은 Cloud Credential Operator 정보를 참조하십시오.