애플리케이션 개발
애플리케이션을 위한 AWS에서 Red Hat OpenShift Service 구성
초록
1장. 배포
1.1. 애플리케이션용 사용자 정의 도메인
AWS 4.14에서 Red Hat OpenShift Service부터 Custom Domain Operator는 더 이상 사용되지 않습니다. AWS 4.14의 Red Hat OpenShift Service에서 Ingress를 관리하려면 Ingress Operator를 사용합니다. AWS 4.13 및 이전 버전의 Red Hat OpenShift Service에는 기능이 변경되지 않습니다.
애플리케이션에 대한 사용자 정의 도메인을 구성할 수 있습니다. 사용자 정의 도메인은 AWS 애플리케이션에서 Red Hat OpenShift Service와 함께 사용할 수 있는 특정 와일드카드 도메인입니다.
1.1.1. 애플리케이션의 사용자 정의 도메인 구성
최상위 도메인( ScanSetting)은 AWS 클러스터에서 Red Hat OpenShift Service를 운영하는 고객이 소유합니다. Custom Domains Operator는 사용자 정의 인증서를 사용하여 2일 차 작업으로 새 수신 컨트롤러를 설정합니다. 그런 다음 이 Ingress 컨트롤러의 퍼블릭 DNS 레코드를 사용하여 사용자 정의 도메인에 사용할 와일드카드 CNAME 레코드를 만들 수 있습니다.
Red Hat은 API 도메인을 제어하므로 사용자 정의 API 도메인이 지원되지 않습니다. 그러나 고객은 애플리케이션 도메인을 변경할 수 있습니다. 비공개 IngressController
가 있는 프라이빗 사용자 정의 도메인의 경우 CustomDomain
CR에서 .spec.scope
를 Internal
로 설정합니다.
사전 요구 사항
-
dedicated-admin
권한이 있는 사용자 계정 -
고유한 도메인 또는 와일드카드 도메인(예:
*.apps.<company_name>.io
) -
CN=*.apps.<company_name>.io
와 같은 사용자 정의 인증서 또는 와일드카드 사용자 정의 인증서 -
최신 버전의
oc
CLI가 설치된 클러스터에 액세스
CustomDomain
CR의 metadata/name:
섹션에서 예약된 이름 기본값
또는
(예: apps 또는 apps2)를 사용하지 마십시오.
*apps
절차
개인 키 및 공용 인증서에서 새 TLS 시크릿을 생성합니다. 여기서
fullchain.pem
및privkey.pem
은 공개 또는 개인 와일드카드 인증서입니다.예제
$ oc create secret tls <name>-tls --cert=fullchain.pem --key=privkey.pem -n <my_project>
새
CustomDomain
CR(사용자 정의 리소스)을 생성합니다.예:
<company_name>-custom-domain.yaml
apiVersion: managed.openshift.io/v1alpha1 kind: CustomDomain metadata: name: <company_name> spec: domain: apps.<company_name>.io 1 scope: External loadBalancerType: Classic 2 certificate: name: <name>-tls 3 namespace: <my_project> routeSelector: 4 matchLabels: route: acme namespaceSelector: 5 matchLabels: type: sharded
CR을 적용합니다.
예제
$ oc apply -f <company_name>-custom-domain.yaml
새로 생성된 CR의 상태를 가져옵니다.
$ oc get customdomains
출력 예
NAME ENDPOINT DOMAIN STATUS <company_name> xxrywp.<company_name>.cluster-01.opln.s1.openshiftapps.com *.apps.<company_name>.io Ready
엔드포인트 값을 사용하여 관리형 DNS 공급자(예: Route53)에 새 와일드카드 CNAME 레코드 세트를 추가합니다.
예제
*.apps.<company_name>.io -> xxrywp.<company_name>.cluster-01.opln.s1.openshiftapps.com
새 애플리케이션을 생성하고 노출합니다.
예제
$ oc new-app --docker-image=docker.io/openshift/hello-openshift -n my-project
$ oc create route <route_name> --service=hello-openshift hello-openshift-tls --hostname hello-openshift-tls-my-project.apps.<company_name>.io -n my-project
$ oc get route -n my-project
$ curl https://hello-openshift-tls-my-project.apps.<company_name>.io Hello OpenShift!
1.1.2. 사용자 정의 도메인의 인증서 갱신
oc
CLI 툴을 사용하여 Custom Domains Operator(CDO)로 인증서를 갱신할 수 있습니다.
사전 요구 사항
-
최신 버전의
oc
CLI 툴이 설치되어 있습니다.
절차
새 보안 생성
$ oc create secret tls <secret-new> --cert=fullchain.pem --key=privkey.pem -n <my_project>
Patch CustomDomain CR
$ oc patch customdomain <company_name> --type='merge' -p '{"spec":{"certificate":{"name":"<secret-new>"}}}'
이전 보안 삭제
$ oc delete secret <secret-old> -n <my_project>
문제 해결
Legal Notice
Copyright © 2024 Red Hat, Inc.
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.