튜토리얼
1장. 튜토리얼 개요 링크 복사링크가 클립보드에 복사되었습니다!
Red Hat 전문가의 단계별 튜토리얼을 사용하여 관리형 OpenShift 클러스터를 최대한 활용할 수 있습니다.
이 콘텐츠는 Red Hat 전문가가 작성했지만 지원되는 모든 구성에서 테스트되지 않았습니다.
2장. 튜토리얼: 사용자 정의 도메인 및 TLS 인증서를 사용하여 구성 요소 경로 업데이트 링크 복사링크가 클립보드에 복사되었습니다!
이 가이드에서는 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. 환경 설정 링크 복사링크가 클립보드에 복사되었습니다!
-
cluster-admin
권한이 있는 계정을 사용하여 클러스터에 로그인합니다. 클러스터 이름에 대한 환경 변수를 구성합니다.
export CLUSTER_NAME=$(oc get infrastructure cluster -o=jsonpath="{.status.infrastructureName}" | sed 's/-[a-z0-9]\{5\}$//')
$ export CLUSTER_NAME=$(oc get infrastructure cluster -o=jsonpath="{.status.infrastructureName}" | sed 's/-[a-z0-9]\{5\}$//')
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 다음 섹션으로 이동하기 전에 모든 필드가 올바르게 출력되는지 확인합니다.
echo "Cluster: ${CLUSTER_NAME}"
$ echo "Cluster: ${CLUSTER_NAME}"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 출력 예
Cluster: my-osd-cluster
Cluster: my-osd-cluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. 현재 경로 찾기 링크 복사링크가 클립보드에 복사되었습니다!
기본 호스트 이름에서 구성 요소 경로에 연결할 수 있는지 확인합니다.
openshift-console
및openshift-authentication
프로젝트의 경로 목록을 쿼리하여 호스트 이름을 찾을 수 있습니다.oc get routes -n openshift-console oc get routes -n openshift-authentication
$ oc get routes -n openshift-console $ oc get routes -n openshift-authentication
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 출력 예
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
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 Copied! Toggle word wrap Toggle overflow 이 출력에서 기본 호스트 이름은
z9a9.p2.openshiftapps.com
임을 확인할 수 있습니다.다음 명령을 실행하여 기본 수신의 ID를 가져옵니다.
export INGRESS_ID=$(ocm list ingress -c ${CLUSTER_NAME} -o json | jq -r '.[] | select(.default == true) | .id')
$ export INGRESS_ID=$(ocm list ingress -c ${CLUSTER_NAME} -o json | jq -r '.[] | select(.default == true) | .id')
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 다음 섹션으로 이동하기 전에 모든 필드가 올바르게 출력되는지 확인합니다.
echo "Ingress ID: ${INGRESS_ID}"
$ echo "Ingress ID: ${INGRESS_ID}"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 출력 예
Ingress ID: r3l6
Ingress ID: r3l6
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 이러한 명령을 실행하면 클러스터의 기본 구성 요소 경로가 다음과 같습니다.
-
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
$ 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:...'
이 예제에서는 다음과 같은 사용자 지정 구성 요소 경로를 사용합니다.
-
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"
$ 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 Copied! Toggle word wrap Toggle overflow 이렇게 하면
.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
$ 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 Copied! Toggle word wrap Toggle overflow
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
$ 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
이 경우 로드 밸런서 IP는 34.85.169.230
입니다.
나중에 이 값을 저장하십시오. 새 구성 요소 경로 호스트 이름에 대한 DNS 레코드를 구성해야 하므로 나중에 이 값을 저장합니다.
2.7. 호스팅 공급자에 구성 요소 경로 DNS 레코드 추가 링크 복사링크가 클립보드에 복사되었습니다!
DNS 설정에 A 레코드를 만들어 router-default 로드 밸런서의 IP 주소를 가리킵니다.
2.8. OCM CLI를 사용하여 구성 요소 경로 및 TLS 시크릿 업데이트 링크 복사링크가 클립보드에 복사되었습니다!
DNS 레코드가 업데이트되면 OCM CLI를 사용하여 구성 요소 경로를 변경할 수 있습니다.
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'
$ 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 Copied! Toggle word wrap Toggle overflow 참고구성 요소 경로를 빈 문자열로 설정하지 않으려는 상태로 두어 구성 요소 경로의 하위 집합만 편집할 수도 있습니다. 예를 들어 콘솔 및 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'
$ 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 Copied! Toggle word wrap Toggle overflow ocm list ingress
명령을 실행하여 변경 사항이 성공적으로 적용되었는지 확인합니다.ocm list ingress -c ${CLUSTER_NAME} -ojson | jq ".[] | select(.id == \"${INGRESS_ID}\") | .component_routes"
$ ocm list ingress -c ${CLUSTER_NAME} -ojson | jq ".[] | select(.id == \"${INGRESS_ID}\") | .component_routes"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 출력 예
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 로컬 시스템의 신뢰 저장소에 인증서를 추가한 다음 로컬 웹 브라우저를 사용하여 새 경로에서 구성 요소에 액세스할 수 있는지 확인합니다.
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=""'
$ ocm edit ingress -c ${CLUSTER_NAME} ${INGRESS_ID} --component-routes 'console: hostname="";tlsSecretRef="",downloads: hostname="";tlsSecretRef="", oauth: hostname="";tlsSecretRef=""'
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.