7.5.3.5. 서비스 주체 생성

OpenShift Container Platform과 해당 설치 프로그램은 Azure Resource Manager를 통해 Microsoft Azure 리소스를 생성해야 하므로 이를 대표하는 서비스 주체를 생성해야 합니다.

사전 요구 사항

  • Azure CLI를 설치 또는 업데이트합니다.
  • jq 패키지를 설치합니다.
  • Azure 계정은 사용하는 서브스크립션에 대한 필요한 역할을 갖습니다.

절차

  1. Azure CLI에 Azure Stack Cloud 환경을 등록합니다. 이 프로세스에 대한 자세한 내용은 Azure Stack Hub에 연결하기 위한 Microsoft의 설명서를 참조하십시오.

    1. Azure CLI에 환경을 등록합니다.

      $ az cloud register -n <environment_name> --endpoint-resource-manager <arm_endpoint>
    2. 활성 환경을 설정합니다.

      $ az cloud set -n <environment_name>
    3. Azure Stack Hub의 특정 API 버전을 사용하도록 환경 구성을 업데이트합니다.

      $ az cloud update --profile 2019-03-01-hybrid
  2. Azure CLI에 로그인합니다.

    $ az login

    인증 정보를 사용하여 웹 콘솔에서 Azure에 로그인합니다. 다중 테넌트 환경에 있는 경우 테넌트 ID도 제공해야 합니다.

  3. Azure 계정이 서브스크립션을 사용하는 경우, 올바른 서브스크립션을 사용하고 있는지 확인합니다.

    1. 사용 가능한 계정 목록을 보고 클러스터에 사용하려는 서브스크립션의 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"
          }
        }
      ]

    2. 활성 계정 세부 사항을 보고 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인지 확인합니다.
    3. 올바른 서브스크립션을 사용하지 않는 경우, 활성 서브스크립션을 변경합니다.

      $ az account set -s <id> 1
      1
      <id>에 사용하려는 서브스크립션의 id 값을 대체합니다.
    4. 활성 서브스크립션을 변경한 경우 계정 정보를 다시 표시합니다.

      $ 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"
        }
      }

  4. 이전 출력의 tenantIdid 매개변수 값을 기록합니다. OpenShift Container Platform 설치 중에 이러한 값이 필요합니다.
  5. 계정에 대한 서비스 주체를 생성합니다.

    $ az ad sp create-for-rbac --role Contributor --name <service_principal> 1
    1
    <service_principal>을 서비스 주체에 할당할 이름으로 바꿉니다.

    출력 예

    Changing "<service_principal>" to a valid URI of "http://<service_principal>", which is the required format used for service principal names
    Retrying role assignment creation: 1/36
    Retrying role assignment creation: 2/36
    Retrying role assignment creation: 3/36
    Retrying role assignment creation: 4/36
    {
      "appId": "8bd0d04d-0ac2-43a8-928d-705c598c6956",
      "displayName": "<service_principal>",
      "name": "http://<service_principal>",
      "password": "ac461d78-bf4b-4387-ad16-7e32e328aec6",
      "tenant": "6048c7e9-b2ad-488d-a54e-dc3f6be6a7ee"
    }

  6. 이전 출력의 appIdpassword 매개변수 값을 기록합니다. OpenShift Container Platform 설치 중에 이러한 값이 필요합니다.

추가 리소스