3.9.8. RHCOS 클러스터 이미지 및 부트스트랩 Ignition 구성 파일 업로드

Azure 클라이언트는 로컬로 존재하는 파일을 기반으로 한 배포를 지원하지 않습니다. 따라서 RHCOS VHD(가상 하드 디스크) 클러스터 이미지와 부트스트랩 Ignition 구성 파일을 스토리지 컨테이너에 복사하여 저장해야 배포 중에 액세스할 수 있습니다.

사전 요구 사항

  • Azure 계정을 구성하십시오.
  • 클러스터에 대한 Ignition 구성 파일을 생성하십시오.

프로세스

  1. VHD 클러스터 이미지를 저장할 Azure 스토리지 계정을 생성합니다.

    $ az storage account create -g ${RESOURCE_GROUP} --location ${AZURE_REGION} --name ${CLUSTER_NAME}sa --kind Storage --sku Standard_LRS
    주의

    Azure 스토리지 계정 이름은 3자에서 24자 사이여야 하며 숫자와 소문자만 사용해야 합니다. CLUSTER_NAME 변수가 이러한 제한 사항을 따르지 않으면 Azure 스토리지 계정 이름을 수동으로 정의해야 합니다. Azure 스토리지 계정 이름 제한 사항에 대한 자세한 내용은 Azure 문서의 스토리지 계정 이름 오류 해결을 참조하십시오.

  2. 스토리지 계정 키를 환경 변수 형태로 내보냅니다.

    $ export ACCOUNT_KEY=`az storage account keys list -g ${RESOURCE_GROUP} --account-name ${CLUSTER_NAME}sa --query "[0].value" -o tsv`
  3. 사용할 RHCOS 버전을 선택하고 VHD의 URL을 환경 변수로 내보냅니다.

    $ export VHD_URL=`curl -s https://raw.githubusercontent.com/openshift/installer/release-4.6/data/data/rhcos.json | jq -r .azure.url`
    중요

    RHCOS 이미지는 OpenShift Container Platform 릴리스에 따라 변경되지 않을 수 있습니다. 설치하는 OpenShift Container Platform 버전 이하에서 가장 높은 버전의 이미지를 지정해야 합니다. 지원되는 경우 OpenShift Container Platform 버전과 일치하는 이미지 버전을 사용합니다.

  4. 선택한 VHD를 Blob에 복사합니다.

    $ az storage container create --name vhd --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY}
    $ az storage blob copy start --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY} --destination-blob "rhcos.vhd" --destination-container vhd --source-uri "${VHD_URL}"

    VHD 복사 작업의 진행 상황을 추적하려면 다음 스크립트를 실행하십시오.

    status="unknown"
    while [ "$status" != "success" ]
    do
      status=`az storage blob show --container-name vhd --name "rhcos.vhd" --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY} -o tsv --query properties.copy.status`
      echo $status
    done
  5. Blob 스토리지 컨테이너를 만들고 생성된 bootstrap.ign 파일을 업로드합니다.

    $ az storage container create --name files --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY} --public-access blob
    $ az storage blob upload --account-name ${CLUSTER_NAME}sa --account-key ${ACCOUNT_KEY} -c "files" -f "<installation_directory>/bootstrap.ign" -n "bootstrap.ign"