5.2. IDP 계정으로 클러스터에 액세스


클러스터에 로그인하려면 IDP(ID 공급자)를 구성할 수 있습니다. 이 절차에서는 GitHub를 예제 IDP로 사용합니다. 다른 지원되는 IDP를 보려면 rosa create idp --help 명령을 실행합니다.

참고

또는 클러스터를 생성한 사용자로 빠른 액세스 절차를 사용할 수 있습니다.

절차

IDP 계정을 사용하여 클러스터에 액세스하려면 다음을 수행합니다.

  1. IDP를 추가합니다.

    1. 다음 명령은 GitHub에서 지원하는 IDP를 생성합니다. 명령을 실행한 후 출력의 대화형 프롬프트에 따라 GitHub 개발자 설정에 액세스하고 새 OAuth 애플리케이션을 구성합니다.

      $ rosa create idp --cluster=<cluster_name> --interactive
    2. 다음 값을 입력합니다.

      • ID 공급자 유형: github
      • 구성원으로 제한: 조직 ( GitHub 조직이 없는 경우 지금 생성할 수 있습니다)
      • GitHub 조직: rh-test-org (조직 이름 입력)

      출력 예

      I: Interactive mode enabled.
      Any optional fields can be left empty and a default will be selected.
      ? Type of identity provider: github
      ? Restrict to members of: organizations
      ? GitHub organizations: rh-test-org
      ? To use GitHub as an identity provider, you must first register the application:
        - Open the following URL:
          https://github.com/organizations/rh-rosa-test-cluster/settings/applications/new?oauth_application%5Bcallback_url%5D=https%3A%2F%2Foauth-openshift.apps.rh-rosa-test-cluster.z7v0.s1.devshift.org%2Foauth2callback%2Fgithub-1&oauth_application%5Bname%5D=rh-rosa-test-cluster-stage&oauth_application%5Burl%5D=https%3A%2F%2Fconsole-openshift-console.apps.rh-rosa-test-cluster.z7v0.s1.devshift.org
        - Click on 'Register application'
      ...

    3. 출력의 URL을 따르고 애플리케이션 등록을 선택하여 GitHub 조직에 새 OAuth 애플리케이션을 등록합니다. 애플리케이션을 등록하면 ROSA에 빌드된 OAuth 서버를 활성화하여 GitHub 조직의 멤버를 클러스터에 인증할 수 있습니다.

      참고

      새 OAuth 애플리케이션 GitHub 양식의 필드는 rosa CLI 툴에서 정의한 URL을 통해 필요한 값으로 자동으로 채워집니다.

    4. 생성한 GitHub 애플리케이션의 정보를 사용하고 프롬프트를 계속합니다. 다음 값을 입력합니다.

      • 클라이언트 ID: & lt;my_github_client_id>
      • 클라이언트 시크릿: [? for help] &lt ;my_github_client_secret>
      • hostname: (선택 사항, 지금 비워 둘 수 있음)
      • 매핑 방법: 클레임

      연속된 예제 출력

      ...
      ? Client ID: <my_github_client_id>
      ? Client Secret: [? for help] <my_github_client_secret>
      ? Hostname:
      ? Mapping method: claim
      I: Configuring IDP for cluster 'rh_rosa_test_cluster'
      I: Identity Provider 'github-1' has been created. You need to ensure that there is a list of cluster administrators defined. See 'rosa create user --help' for more information. To login into the console, open https://console-openshift-console.apps.rh-test-org.z7v0.s1.devshift.org and click on github-1

      IDP는 클러스터 내에서 1-2 분 정도 걸릴 수 있습니다.

    5. 다음 명령을 입력하여 IDP가 올바르게 구성되었는지 확인합니다.

      $ rosa list idps --cluster=<cluster_name>

      출력 예

      NAME        TYPE      AUTH URL
      github-1    GitHub    https://oauth-openshift.apps.rh-rosa-test-cluster1.j9n4.s1.devshift.org/oauth2callback/github-1

  2. 클러스터에 로그인합니다.

    1. 다음 명령을 입력하여 클러스터의 콘솔 URL 을 가져옵니다.

      $ rosa describe cluster --cluster=<cluster_name>

      출력 예

      Name:        rh-rosa-test-cluster1
      ID:          1de87g7c30g75qechgh7l5b2bha6r04e
      External ID: 34322be7-b2a7-45c2-af39-2c684ce624e1
      API URL:     https://api.rh-rosa-test-cluster1.j9n4.s1.devshift.org:6443
      Console URL: https://console-openshift-console.apps.rh-rosa-test-cluster1.j9n4.s1.devshift.org
      Nodes:       Master: 3, Infra: 3, Compute: 4
      Region:      us-east-2
      State:       ready
      Created:     May 27, 2020

    2. 콘솔 URL 로 이동하여 Github 자격 증명을 사용하여 로그인합니다.
    3. OpenShift 콘솔 오른쪽 상단에서 이름을 클릭하고 Copy Login Command 를 클릭합니다.
    4. 추가한 IDP 이름(예: github-1)을 선택하고 토큰 표시를 클릭합니다.
    5. oc login 명령을 복사하여 터미널에 붙여넣습니다.

      $ oc login --token=z3sgOGVDk0k4vbqo_wFqBQQTnT-nA-nQLb8XEmWnw4X --server=https://api.rh-rosa-test-cluster1.j9n4.s1.devshift.org:6443

      출력 예

      Logged into "https://api.rh-rosa-cluster1.j9n4.s1.devshift.org:6443" as "rh-rosa-test-user" using the token provided.
      
      You have access to 67 projects, the list has been suppressed. You can list all projects with 'oc projects'
      
      Using project "default".

    6. 간단한 oc 명령을 입력하여 모든 항목이 올바르게 설정되어 있고 로그인되었는지 확인합니다.

      $ oc version

      출력 예

      Client Version: 4.4.0-202005231254-4a4cd75
      Server Version: 4.3.18
      Kubernetes Version: v1.16.2

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

© 2024 Red Hat, Inc.