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