튜토리얼


OpenShift Dedicated 4

OpenShift Dedicated 튜토리얼

Red Hat OpenShift Documentation Team

초록

OpenShift Dedicated 클러스터를 관리하는 튜토리얼입니다.

1장. 튜토리얼 개요

Red Hat 전문가의 단계별 튜토리얼을 사용하여 관리형 OpenShift 클러스터를 최대한 활용할 수 있습니다.

중요

이 콘텐츠는 Red Hat 전문가가 작성했지만 지원되는 모든 구성에서 테스트되지 않았습니다.

이 가이드에서는 GCP(Google Cloud Platform) 버전 4.14 이상에서 OpenShift Dedicated에서 웹 콘솔, OAuth 서버 및 다운로드 구성 요소 경로의 호스트 이름 및 TLS 인증서를 수정하는 방법을 보여줍니다.[1]

구성 요소 경로에 대한 변경 사항[2] 이 가이드에서는 내부 OAuth 서버 URL 사용자 지정,콘솔 경로 사용자 지정, 다운로드 경로 OpenShift Dedicated 설명서 사용자 지정에 자세히 설명되어 있습니다.

2.1. 사전 요구 사항

  • OCM CLI(ocm) 버전 1.0.5 이상
  • gcloud CLI(gcloud)
  • GCP(Google Cloud Platform) 클러스터 버전 4.14 이상의 OpenShift Dedicated
  • OpenShift CLI(oc)
  • jq CLI
  • cluster-admin 역할의 사용자로 클러스터에 액세스할 수 있어야 합니다.
  • OpenSSL(데모 SSL/TLS 인증서를 생성하기 위해)

2.2. 환경 설정

  1. cluster-admin 권한이 있는 계정을 사용하여 클러스터에 로그인합니다.
  2. 클러스터 이름에 대한 환경 변수를 구성합니다.

    $ export CLUSTER_NAME=$(oc get infrastructure cluster -o=jsonpath="{.status.infrastructureName}"  | sed 's/-[a-z0-9]\{5\}$//')
    Copy to Clipboard Toggle word wrap
  3. 다음 섹션으로 이동하기 전에 모든 필드가 올바르게 출력되는지 확인합니다.

    $ echo "Cluster: ${CLUSTER_NAME}"
    Copy to Clipboard Toggle word wrap

    출력 예

    Cluster: my-osd-cluster
    Copy to Clipboard Toggle word wrap

2.3. 현재 경로 찾기

  1. 기본 호스트 이름에서 구성 요소 경로에 연결할 수 있는지 확인합니다.

    openshift-consoleopenshift-authentication 프로젝트의 경로 목록을 쿼리하여 호스트 이름을 찾을 수 있습니다.

    $ oc get routes -n openshift-console
    $ oc get routes -n openshift-authentication
    Copy to Clipboard Toggle word wrap

    출력 예

    NAME        HOST/PORT                                                                          PATH       SERVICES    PORT    TERMINATION          WILDCARD
    console     console-openshift-console.apps.my-example-cluster-gcp.z9a9.p2.openshiftapps.com    ... 1 more  console    https   reencrypt/Redirect   None
    downloads   downloads-openshift-console.apps.my-example-cluster-gcp.z9a9.p2.openshiftapps.com  ... 1 more  downloads  http    edge/Redirect        None
    NAME              HOST/PORT                                                             PATH        SERVICES          PORT   TERMINATION            WILDCARD
    oauth-openshift   oauth-openshift.apps.my-example-cluster-gcp.z9a9.p2.openshiftapps.com ... 1 more  oauth-openshift   6443   passthrough/Redirect   None
    Copy to Clipboard Toggle word wrap

    이 출력에서 기본 호스트 이름은 z9a9.p2.openshiftapps.com 임을 확인할 수 있습니다.

  2. 다음 명령을 실행하여 기본 수신의 ID를 가져옵니다.

    $ export INGRESS_ID=$(ocm list ingress -c ${CLUSTER_NAME} -o json | jq -r '.[] | select(.default == true) | .id')
    Copy to Clipboard Toggle word wrap
  3. 다음 섹션으로 이동하기 전에 모든 필드가 올바르게 출력되는지 확인합니다.

    $ echo "Ingress ID: ${INGRESS_ID}"
    Copy to Clipboard Toggle word wrap

    출력 예

    Ingress ID: r3l6
    Copy to Clipboard Toggle word wrap

    이러한 명령을 실행하면 클러스터의 기본 구성 요소 경로가 다음과 같습니다.

    • console-openshift-console.apps.my-example-cluster-gcp.z9a9.p2.openshiftapps.com for Console
    • Downloads-openshift-console.apps.my-example-cluster-gcp.z9a9.p2.openshiftapps.com
    • oauth-openshift.apps.my-example-cluster-gcp.z9a9.p2.openshiftapps.com for OAuth

ocm edit ingress 명령을 사용하여 각 서비스의 호스트 이름을 변경하고 모든 구성 요소 경로에 대한 TLS 인증서를 추가할 수 있습니다. 관련 매개변수는 ocm edit ingress 명령에 대한 명령줄 도움말의 이 발췌에 표시됩니다.

$ ocm edit ingress -h
Edit a cluster ingress for a cluster. Usage:
  ocm edit ingress ID [flags]
  [...]
  --component-routes string                Component routes settings. Available keys [oauth, console, downloads]. For each key a pair of hostname and tlsSecretRef is expected to be supplied. Format should be a comma separate list 'oauth: hostname=example-hostname;tlsSecretRef=example-secret-ref,downloads:...'
Copy to Clipboard Toggle word wrap

이 예제에서는 다음과 같은 사용자 지정 구성 요소 경로를 사용합니다.

  • console.my-new-domain.dev
  • Downloads.my-new-domain.dev for Downloads
  • oauth.my-new-domain.dev for OAuth

2.4. 각 구성 요소 경로에 유효한 TLS 인증서 생성

이 섹션에서는 별도의 자체 서명된 인증서 키 쌍을 세 개 생성한 다음 이를 신뢰하여 실제 웹 브라우저를 사용하여 새 구성 요소 경로에 액세스할 수 있는지 확인합니다.

주의

이는 설명용으로만 사용되며 프로덕션 워크로드를 위한 솔루션으로는 권장되지 않습니다. 프로덕션 워크로드에 대한 유사한 특성으로 인증서를 생성하는 방법을 알아보려면 인증 기관을 참조하십시오.

중요

HTTP/2 연결 병합 문제를 방지하려면 각 끝점에 대해 별도의 개별 인증서를 사용해야 합니다. 와일드카드 또는 SAN 인증서 사용은 지원되지 않습니다.

  • 각 구성 요소 경로에 대한 인증서를 생성하고 인증서의 제목(-subj)을 사용하려는 구성 요소 경로의 사용자 지정 도메인으로 설정합니다.

    $ openssl req -newkey rsa:2048 -new -nodes -x509 -days 365 -keyout key-console.pem -out cert-console.pem -subj "/CN=console.my-new-domain.dev"
    $ openssl req -newkey rsa:2048 -new -nodes -x509 -days 365 -keyout key-downloads.pem -out cert-downloads.pem -subj "/CN=downloads.my-new-domain.dev"
    $ openssl req -newkey rsa:2048 -new -nodes -x509 -days 365 -keyout key-oauth.pem -out cert-oauth.pem -subj "/CN=oauth.my-new-domain.dev"
    Copy to Clipboard Toggle word wrap

    이렇게 하면 .pem 파일, key-<component>.pem 및 cert- <component>.pem 쌍의 세 쌍이 생성됩니다.

2.5. 클러스터에 시크릿으로 인증서 추가

  • openshift-config 네임스페이스에 3개의 TLS 시크릿을 생성합니다.

    이는 이 가이드의 뒷부분에 있는 구성 요소 경로를 업데이트할 때 시크릿 참조가 됩니다.

    $ oc create secret tls console-tls --cert=cert-console.pem --key=key-console.pem -n openshift-config
    $ oc create secret tls downloads-tls --cert=cert-downloads.pem --key=key-downloads.pem -n openshift-config
    $ oc create secret tls oauth-tls --cert=cert-oauth.pem --key=key-oauth.pem -n openshift-config
    Copy to Clipboard Toggle word wrap

2.6. 클러스터에서 로드 밸런서의 로드 밸런서 IP 찾기

클러스터를 생성할 때 서비스는 로드 밸런서를 생성하고 해당 로드 밸런서에 대한 로드 밸런서 IP를 생성합니다. 클러스터에 대한 DNS 레코드를 만들려면 로드 밸런서 IP를 알아야 합니다.

openshift-ingress 네임스페이스에 대해 oc get svc 명령을 실행하여 로드 밸런서 IP를 찾을 수 있습니다. 로드 밸런서의 로드 밸런서 IP는 openshift-ingress 네임스페이스의 router-default 서비스와 연결된 EXTERNAL-IP 입니다.

$ oc get svc -n openshift-ingress
NAME            TYPE          CLUSTER-IP     EXTERNAL-IP        PORT(S)                     AGE
router-default  LoadBalancer  172.30.237.88  34.85.169.230      80:31175/TCP,443:31554/TCP  76d
Copy to Clipboard Toggle word wrap

이 경우 로드 밸런서 IP는 34.85.169.230 입니다.

나중에 이 값을 저장하십시오. 새 구성 요소 경로 호스트 이름에 대한 DNS 레코드를 구성해야 하므로 나중에 이 값을 저장합니다.

2.7. 호스팅 공급자에 구성 요소 경로 DNS 레코드 추가

DNS 설정에 A 레코드를 만들어 router-default 로드 밸런서의 IP 주소를 가리킵니다.

2.8. OCM CLI를 사용하여 구성 요소 경로 및 TLS 시크릿 업데이트

DNS 레코드가 업데이트되면 OCM CLI를 사용하여 구성 요소 경로를 변경할 수 있습니다.

  1. ocm edit ingress 명령을 사용하여 기본 수신 경로를 새 기본 도메인 및 연결된 보안 참조로 업데이트하여 각 구성 요소 경로의 호스트 이름을 업데이트합니다.

    $ ocm edit ingress -c ${CLUSTER_NAME} ${INGRESS_ID} --component-routes 'console: hostname=console.my-new-domain.dev;tlsSecretRef=console-tls,downloads: hostname=downloads.my-new-domain.dev;tlsSecretRef=downloads-tls,oauth: hostname=oauth.my-new-domain.dev;tlsSecretRef=oauth-tls'
    Copy to Clipboard Toggle word wrap
    참고

    구성 요소 경로를 빈 문자열로 설정하지 않으려는 상태로 두어 구성 요소 경로의 하위 집합만 편집할 수도 있습니다. 예를 들어 콘솔 및 OAuth 서버 호스트 이름 및 TLS 인증서만 변경하려면 다음 명령을 실행합니다.

    $ ocm edit ingress -c ${CLUSTER_NAME} ${INGRESS_ID} --component-routes 'console: hostname=console.my-new-domain.dev;tlsSecretRef=console-tls,downloads: hostname="";tlsSecretRef="", oauth: hostname=oauth.my-new-domain.dev;tlsSecretRef=oauth-tls'
    Copy to Clipboard Toggle word wrap
  2. ocm list ingress 명령을 실행하여 변경 사항이 성공적으로 적용되었는지 확인합니다.

    $ ocm list ingress -c ${CLUSTER_NAME} -ojson | jq ".[] | select(.id == \"${INGRESS_ID}\") | .component_routes"
    Copy to Clipboard Toggle word wrap

    출력 예

    {
      "console": {
        "kind": "ComponentRoute",
        "hostname": "console.my-new-domain.dev",
        "tls_secret_ref": "console-tls"
      },
      "downloads": {
        "kind": "ComponentRoute",
        "hostname": "downloads.my-new-domain.dev",
        "tls_secret_ref": "downloads-tls"
      },
      "oauth": {
        "kind": "ComponentRoute",
        "hostname": "oauth.my-new-domain.dev",
        "tls_secret_ref": "oauth-tls"
      }
    }
    Copy to Clipboard Toggle word wrap

  3. 로컬 시스템의 신뢰 저장소에 인증서를 추가한 다음 로컬 웹 브라우저를 사용하여 새 경로에서 구성 요소에 액세스할 수 있는지 확인합니다.

2.9. OCM CLI를 사용하여 구성 요소 경로를 기본값으로 재설정

구성 요소 경로를 기본 구성으로 재설정하려면 다음 ocm edit ingress 명령을 실행합니다.

$ ocm edit ingress -c ${CLUSTER_NAME} ${INGRESS_ID} --component-routes 'console: hostname="";tlsSecretRef="",downloads: hostname="";tlsSecretRef="", oauth: hostname="";tlsSecretRef=""'
Copy to Clipboard Toggle word wrap


[1] 4.14 이전 OpenShift Dedicated OCM 버전에서 이러한 경로를 수정하는 것은 일반적으로 지원되지 않습니다. 그러나 버전 4.13을 사용하는 클러스터가 있는 경우 지원 케이스를 열어 Red Hat 지원을 요청하여 버전 4.13 클러스터에서 이 기능에 대한 지원을 활성화할 수 있습니다.
[2] "구성 요소 경로"라는 용어를 사용하여 OCM을 처음 설치할 때 제공되는 OAuth, 콘솔 및 다운로드 경로를 참조합니다.

Legal Notice

Copyright © 2025 Red Hat

OpenShift documentation is licensed under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0).

Modified versions must remove all Red Hat trademarks.

Portions adapted from https://github.com/kubernetes-incubator/service-catalog/ with modifications by Red Hat.

Red Hat, Red Hat Enterprise Linux, the Red Hat logo, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.

Linux® is the registered trademark of Linus Torvalds in the United States and other countries.

Java® is a registered trademark of Oracle and/or its affiliates.

XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.

MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.

Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.

The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation’s permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.

All other trademarks are the property of their respective owners.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2025 Red Hat