7.8.2.2.2. 개별적으로 AWS 리소스 생성


ccoctl 툴을 사용하여 AWS 리소스를 개별적으로 생성할 수 있습니다. 이 옵션은 서로 다른 사용자 또는 부서 간에 이러한 리소스를 생성하는 책임을 공유하는 조직에 유용할 수 있습니다.

그렇지 않으면 ccoctl aws create-all 명령을 사용하여 AWS 리소스를 자동으로 생성할 수 있습니다. 자세한 내용은 "단일 명령으로 AWS 리소스 생성"을 참조하십시오.

참고

기본적으로 ccoctl은 명령이 실행되는 디렉터리에 오브젝트를 생성합니다. 다른 디렉터리에 오브젝트를 생성하려면 --output-dir 플래그를 사용합니다. 이 절차에서는 <path_to_ccoctl_output_dir>을 사용하여 이 디렉터리를 나타냅니다.

일부 ccoctl 명령은 AWS API를 호출하여 AWS 리소스를 생성하거나 수정합니다. --dry-run 플래그를 사용하여 API 호출을 방지할 수 있습니다. 이 플래그를 사용하면 로컬 파일 시스템에 JSON 파일이 생성됩니다. JSON 파일을 검토 및 수정한 다음 --cli-input-json 매개변수를 사용하여 AWS CLI 툴로 적용할 수 있습니다.

사전 요구 사항

  • ccoctl 바이너리를 추출하고 준비합니다.

프로세스

  1. 다음 명령을 실행하여 클러스터의 OpenID Connect 공급자를 설정하는 데 사용되는 공개 및 개인 RSA 키 파일을 생성합니다.

    $ ccoctl aws create-key-pair

    출력 예

    2021/04/13 11:01:02 Generating RSA keypair
    2021/04/13 11:01:03 Writing private key to /<path_to_ccoctl_output_dir>/serviceaccount-signer.private
    2021/04/13 11:01:03 Writing public key to /<path_to_ccoctl_output_dir>/serviceaccount-signer.public
    2021/04/13 11:01:03 Copying signing key for use by installer

    여기서 serviceaccount-signer.privateserviceaccount-signer.public은 생성된 키 파일입니다.

    또한 이 명령은 /<path_to_ccoctl_output_dir>/tls/bound-service-account-signing-key.key에 설치하는 동안 클러스터가 필요한 개인 키를 생성합니다.

  2. 다음 명령을 실행하여 AWS에서 OpenID Connect ID 공급자 및 S3 버킷을 생성합니다.

    $ ccoctl aws create-identity-provider \
      --name=<name> \
    1
    
      --region=<aws_region> \
    2
    
      --public-key-file=<path_to_ccoctl_output_dir>/serviceaccount-signer.public 
    3
    1
    <name>은 추적을 위해 생성된 클라우드 리소스에 태그를 지정하는 데 사용되는 이름입니다.
    2
    <aws-region>은 클라우드 리소스를 생성할 AWS 리전입니다.
    3
    <path_to_ccoctl_output_dir>ccoctl aws create-key-pair 명령이 생성된 공개 키 파일의 경로입니다.

    출력 예

    2021/04/13 11:16:09 Bucket <name>-oidc created
    2021/04/13 11:16:10 OpenID Connect discovery document in the S3 bucket <name>-oidc at .well-known/openid-configuration updated
    2021/04/13 11:16:10 Reading public key
    2021/04/13 11:16:10 JSON web key set (JWKS) in the S3 bucket <name>-oidc at keys.json updated
    2021/04/13 11:16:18 Identity Provider created with ARN: arn:aws:iam::<aws_account_id>:oidc-provider/<name>-oidc.s3.<aws_region>.amazonaws.com

    여기서 openid-configuration 은 검색 문서이고 keys.json 은 JSON 웹 키 세트 파일입니다.

    이 명령은 /<path_to_ccoctl_output_dir>/manifests/cluster-authentication-02-config.yaml 에 YAML 구성 파일도 생성합니다. 이 파일은 AWS IAM ID 공급자가 토큰을 신뢰하도록 클러스터가 생성하는 서비스 계정 토큰의 발급자 URL 필드를 설정합니다.

  3. 클러스터의 각 구성 요소에 대한 IAM 역할을 생성합니다.

    1. 다음 명령을 실행하여 설치 파일의 릴리스 이미지로 $RELEASE_IMAGE 변수를 설정합니다.

      $ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')
    2. OpenShift Container Platform 릴리스 이미지에서 CredentialsRequest 오브젝트 목록을 추출합니다.

      $ oc adm release extract \
        --from=$RELEASE_IMAGE \
        --credentials-requests \
        --included \
      1
      
        --install-config=<path_to_directory_with_installation_configuration>/install-config.yaml \
      2
      
        --to=<path_to_directory_for_credentials_requests> 
      3
      1
      --included 매개변수에는 특정 클러스터 구성에 필요한 매니페스트만 포함됩니다.
      2
      install-config.yaml 파일의 위치를 지정합니다.
      3
      CredentialsRequest 오브젝트를 저장할 디렉터리의 경로를 지정합니다. 지정된 디렉터리가 없으면 이 명령이 이를 생성합니다.
    3. ccoctl 툴을 사용하여 다음 명령을 실행하여 모든 CredentialsRequest 오브젝트를 처리합니다.

      $ ccoctl aws create-iam-roles \
        --name=<name> \
        --region=<aws_region> \
        --credentials-requests-dir=<path_to_credentials_requests_directory> \
        --identity-provider-arn=arn:aws:iam::<aws_account_id>:oidc-provider/<name>-oidc.s3.<aws_region>.amazonaws.com
      참고

      GovCloud와 같은 대체 IAM API 끝점을 사용하는 AWS 환경의 경우 --region 매개변수를 사용하여 리전을 지정해야 합니다.

      클러스터에서 TechPreviewNoUpgrade 기능 세트에서 활성화한 기술 프리뷰 기능을 사용하는 경우 --enable-tech-preview 매개변수를 포함해야 합니다.

      CredentialsRequest 오브젝트에 대해 ccoctl 은 지정된 OIDC ID 공급자와 연결된 신뢰 정책과 OpenShift Container Platform 릴리스 이미지의 각 CredentialsRequest 오브젝트에 정의된 권한 정책을 사용하여 IAM 역할을 생성합니다.

검증

  • OpenShift Container Platform 보안이 생성되었는지 확인하려면 <path_to_ccoctl_output_dir>/manifests 디렉터리에 파일을 나열합니다.

    $ ls <path_to_ccoctl_output_dir>/manifests

    출력 예

    cluster-authentication-02-config.yaml
    openshift-cloud-credential-operator-cloud-credential-operator-iam-ro-creds-credentials.yaml
    openshift-cloud-network-config-controller-cloud-credentials-credentials.yaml
    openshift-cluster-api-capa-manager-bootstrap-credentials-credentials.yaml
    openshift-cluster-csi-drivers-ebs-cloud-credentials-credentials.yaml
    openshift-image-registry-installer-cloud-credentials-credentials.yaml
    openshift-ingress-operator-cloud-credentials-credentials.yaml
    openshift-machine-api-aws-cloud-credentials-credentials.yaml

    AWS를 쿼리하여 IAM 역할이 생성되었는지 확인할 수 있습니다. 자세한 내용은 IAM 역할 나열에 대한 AWS 설명서를 참조하십시오.

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동