8.7. kube-system 프로젝트에 관리자 수준 시크릿을 저장하는 대안


기본적으로 관리자 시크릿은 kube-system 프로젝트에 저장됩니다. install-config.yaml 파일에서 credentialsMode 매개변수를 Manual 로 구성한 경우 다음 대안 중 하나를 사용해야 합니다.

8.7.1. 수동으로 장기 인증 정보 생성

Cloud Credential Operator (CCO)는 클라우드 아이덴티티 및 액세스 관리 (IAM) API에 연결할 수 없는 환경에서 설치하기 전에 수동 모드로 전환할 수 있습니다. 또는 관리자가 클러스터 kube-system 네임 스페이스에 관리자 수준의 인증 정보 시크릿을 저장하지 않도록 합니다.

프로세스

  1. 설치 프로그램이 사용하는 GCP 계정에 다음 세분화된 권한을 추가합니다.

    예 8.1. 필요한 GCP 권한

    • compute.machineTypes.list
    • compute.regions.list
    • compute.zones.list
    • dns.changes.create
  2. apiVersion: v1
    baseDomain: example.com
    credentialsMode: Manual
    # ...

  3. $ openshift-install create manifests --dir <installation_directory>

  4. $ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')
  5. $ 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
    2
    3

    apiVersion: cloudcredential.openshift.io/v1
    kind: CredentialsRequest
    metadata:
      name: <component_credentials_request>
      namespace: openshift-cloud-credential-operator
      ...
    spec:
      providerSpec:
        apiVersion: cloudcredential.openshift.io/v1
        kind: GCPProviderSpec
        predefinedRoles:
        - roles/storage.admin
        - roles/iam.serviceAccountUser
        skipServiceCheck: true
      ...

  6. apiVersion: cloudcredential.openshift.io/v1
    kind: CredentialsRequest
    metadata:
      name: <component_credentials_request>
      namespace: openshift-cloud-credential-operator
      ...
    spec:
      providerSpec:
        apiVersion: cloudcredential.openshift.io/v1
          ...
      secretRef:
        name: <component_secret>
        namespace: <component_namespace>
      ...

    apiVersion: v1
    kind: Secret
    metadata:
      name: <component_secret>
      namespace: <component_namespace>
    data:
      service_account.json: <base64_encoded_gcp_service_account_file>

중요

8.7.2.

8.7.2.1.

참고

    • 예 8.2.

      • iam.roles.update
      • iam.serviceAccounts.create
      • iam.serviceAccounts.delete
      • iam.serviceAccounts.getIamPolicy
      • iam.serviceAccounts.list
      • iam.serviceAccounts.setIamPolicy
      • iam.workloadIdentityPoolProviders.get
      • iam.workloadIdentityPools.delete
      • resourcemanager.projects.get
      • resourcemanager.projects.getIamPolicy
      • resourcemanager.projects.setIamPolicy
      • storage.buckets.create
      • storage.buckets.delete
      • storage.buckets.get
      • storage.buckets.getIamPolicy
      • storage.buckets.setIamPolicy

  1. $ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')
  2. $ CCO_IMAGE=$(oc adm release info --image-for='cloud-credential-operator' $RELEASE_IMAGE -a ~/.pull-secret)
    참고

  3. $ oc image extract $CCO_IMAGE \
      --file="/usr/bin/ccoctl.<rhel_version>" \1
      -a ~/.pull-secret
    1
  4. $ chmod 775 ccoctl.<rhel_version>

  • $ ./ccoctl.rhel9

    OpenShift credentials provisioning tool
    
    Usage:
      ccoctl [command]
    
    Available Commands:
      aws          Manage credentials objects for AWS cloud
      azure        Manage credentials objects for Azure
      gcp          Manage credentials objects for Google cloud
      help         Help about any command
      ibmcloud     Manage credentials objects for IBM Cloud
      nutanix      Manage credentials objects for Nutanix
    
    Flags:
      -h, --help   help for ccoctl
    
    Use "ccoctl [command] --help" for more information about a command.

8.7.2.2.

참고

  1. $ RELEASE_IMAGE=$(./openshift-install version | awk '/release image/ {print $3}')
  2. $ 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
    2
    3
    참고

  3. $ ccoctl gcp create-all \
      --name=<name> \1
      --region=<gcp_region> \2
      --project=<gcp_project_id> \3
      --credentials-requests-dir=<path_to_credentials_requests_directory> 4
    1
    2
    3
    4
    참고

  • $ ls <path_to_ccoctl_output_dir>/manifests

    cluster-authentication-02-config.yaml
    openshift-cloud-controller-manager-gcp-ccm-cloud-credentials-credentials.yaml
    openshift-cloud-credential-operator-cloud-credential-operator-gcp-ro-creds-credentials.yaml
    openshift-cloud-network-config-controller-cloud-credentials-credentials.yaml
    openshift-cluster-api-capg-manager-bootstrap-credentials-credentials.yaml
    openshift-cluster-csi-drivers-gcp-pd-cloud-credentials-credentials.yaml
    openshift-image-registry-installer-cloud-credentials-credentials.yaml
    openshift-ingress-operator-cloud-credentials-credentials.yaml
    openshift-machine-api-gcp-cloud-credentials-credentials.yaml

8.7.2.3.

  1. 예 8.3.

  2. apiVersion: v1
    baseDomain: example.com
    credentialsMode: Manual
    # ...

  3. $ openshift-install create manifests --dir <installation_directory>

  4. $ cp /<path_to_ccoctl_output_dir>/manifests/* ./manifests/
  5. $ cp -a /<path_to_ccoctl_output_dir>/tls .
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

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

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

Red Hat 소개

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

© 2024 Red Hat, Inc.