This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.18.5.3.2. Cloud Credential Operator 유틸리티로 AWS 리소스 업데이트
AWS STS(Secure Token Service)를 사용하여 수동 모드로 구성된 OpenShift Container Platform 클러스터를 업그레이드하는 프로세스는 AWS 리소스를 개별적으로 생성하는 클러스터에 설치하는 것과 유사합니다.
기본적으로 ccoctl은 명령이 실행되는 디렉터리에 오브젝트를 생성합니다. 다른 디렉터리에 오브젝트를 생성하려면 --output-dir 플래그를 사용합니다. 이 절차에서는 & lt;path_to_ccoctl_output_dir >을 사용하여 이 디렉터리를 참조합니다.
일부 ccoctl 명령은 AWS API를 호출하여 AWS 리소스를 생성하거나 수정합니다. --dry-run 플래그를 사용하여 API 호출을 방지할 수 있습니다. 이 플래그를 사용하면 로컬 파일 시스템에 JSON 파일이 생성됩니다. JSON 파일을 검토 및 수정한 다음 --cli-input-json 매개변수를 사용하여 AWS CLI 툴로 적용할 수 있습니다.
사전 요구 사항
- 업그레이드할 버전의 OpenShift Container Platform 릴리스 이미지를 가져옵니다.
-
릴리스 이미지에서
ccoctl바이너리를 추출하고 준비합니다.
절차
OpenShift Container Platform 릴리스 이미지에서
CredentialsRequestCR(사용자 정의 리소스) 목록을 추출합니다.oc adm release extract \ --credentials-requests \ --cloud=aws \ --to=<path_to_directory_with_list_of_credentials_requests>/credrequests \ --quay.io/<path_to>/ocp-release:<version>
$ oc adm release extract \ --credentials-requests \ --cloud=aws \ --to=<path_to_directory_with_list_of_credentials_requests>/credrequests \1 --quay.io/<path_to>/ocp-release:<version>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
credrequests는CredentialsRequest오브젝트 목록이 저장되는 디렉터리입니다. 이 명령은 디렉터리가 없는 경우 해당 디렉터리를 생성합니다.
릴리스 이미지의 각
CredentialsRequestCR에 대해spec.secretRef.namespace필드의 텍스트와 일치하는 네임스페이스가 클러스터에 있는지 확인합니다. 이 필드에는 인증 정보 구성을 보유하는 생성된 시크릿이 저장됩니다.샘플 AWS
CredentialsRequest오브젝트Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 이 필드는 생성된 시크릿을 보유하기 위해 존재해야 하는 네임스페이스를 나타냅니다.
클러스터에
spec.secretRef.namespace에 지정된 이름이 있는 네임스페이스가 아직 없는CredentialsRequestCR에 대해 네임스페이스를 생성합니다.oc create namespace <component_namespace>
$ oc create namespace <component_namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow ccoctl툴을 사용하여redrequests디렉터리의 모든CredentialsRequest오브젝트를 처리합니다.ccoctl aws create-iam-roles \ --name <name> \ --region=<aws_region> \ --credentials-requests-dir=<path_to_directory_with_list_of_credentials_requests>/credrequests \ --identity-provider-arn arn:aws:iam::<aws_account_id>:oidc-provider/<name>-oidc.s3.<aws_region>.amazonaws.com
$ ccoctl aws create-iam-roles \ --name <name> \ --region=<aws_region> \ --credentials-requests-dir=<path_to_directory_with_list_of_credentials_requests>/credrequests \ --identity-provider-arn arn:aws:iam::<aws_account_id>:oidc-provider/<name>-oidc.s3.<aws_region>.amazonaws.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow 다음과 같습니다.
-
<name>은 추적을 위해 생성된 클라우드 리소스에 태그하는 데 사용되는 이름입니다. 업그레이드의 경우 초기 설치에 사용된 값과 동일한 값을 사용합니다. -
<aws_account_id>는 AWS 계정 ID입니다. -
<aws_region>은 클라우드 리소스가 생성될 AWS 리전입니다.
참고GovCloud와 같은 대체 IAM API 끝점을 사용하는 AWS 환경의 경우
--region매개변수를 사용하여 리전을 지정해야 합니다.각
CredentialsRequest오브젝트에 대해ccoctl은 지정된 OIDC ID 공급자와 연결된 신뢰 정책과 OpenShift Container Platform 릴리스 이미지의 각CredentialsRequest오브젝트에 정의된 권한 정책을 사용하여 IAM 역할을 생성합니다.-
클러스터에 시크릿을 적용합니다.
ls <path_to_ccoctl_output_dir>/manifests/*-credentials.yaml | xargs -I{} oc apply -f {}$ ls <path_to_ccoctl_output_dir>/manifests/*-credentials.yaml | xargs -I{} oc apply -f {}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
검증
AWS를 쿼리하여 IAM 역할이 생성되었는지 확인할 수 있습니다. 자세한 내용은 IAM 역할 나열에 대한 AWS 설명서를 참조하십시오.