This documentation is for a release that is no longer maintained
See documentation for the latest supported version.Amazon Elastic Kubernetes Service에 Red Hat Developer Hub 설치
초록
1장. EBS(Elastic Kubernetes Service)에 Red Hat Developer Hub 설치
다음 방법 중 하나를 사용하여 Amazon Elastic Kubernetes Service(EKS)에 Red Hat Developer Hub를 설치할 수 있습니다.
- Red Hat Developer Hub Operator
- Red Hat Developer Hub Helm 차트
1.1. Operator를 사용하여 EKS에 개발자 허브 설치
Red Hat Developer Hub Operator를 설치하려면 OLM(Operator Lifecycle Manager) 프레임워크가 필요합니다.
Additonal 리소스
- OLM에 대한 자세한 내용은 OLM(Operator Lifecycle Manager) 설명서를 참조하십시오.
1.1.1. OLM 프레임워크를 사용하여 Developer Hub Operator 설치
OLM(Operator Lifecycle Manager) 프레임워크를 사용하여 EKS에 Developer Hub Operator 를 설치할 수 있습니다. 이에 따라 EKS에 Developer Hub 인스턴스를 계속 배포할 수 있습니다.
사전 요구 사항
-
현재
kubeconfig
에서 컨텍스트를 EKS 클러스터로 설정했습니다. 자세한 내용은 Amazon EKS 클러스터의 kubeconfig 파일 생성 또는 업데이트를 참조하십시오. -
kubectl
을 설치했습니다. 자세한 내용은 kubectl 설치 또는 업데이트를 참조하십시오. -
registry.redhat.io
에 가입했습니다. 자세한 내용은 Red Hat Container Registry Authentication 을 참조하십시오. - OLM(Operator Lifecycle Manager)이 설치되어 있습니다. 설치 및 문제 해결에 대한 자세한 내용은 OLM QuickStart 또는 How do I get Operator Lifecycle Manager를 참조하십시오.
프로세스
터미널에서 다음 명령을 실행하여 Operator가 설치된
rhdh-operator
네임스페이스를 생성합니다.kubectl create namespace rhdh-operator
kubectl create namespace rhdh-operator
Copy to Clipboard Copied! 다음 명령을 사용하여 풀 시크릿을 생성합니다.
kubectl -n rhdh-operator create secret docker-registry rhdh-pull-secret \ --docker-server=registry.redhat.io \ --docker-username=<user_name> \ --docker-password=<password> \ --docker-email=<email>
kubectl -n rhdh-operator create secret docker-registry rhdh-pull-secret \ --docker-server=registry.redhat.io \ --docker-username=<user_name> \
1 --docker-password=<password> \
2 --docker-email=<email>
3 Copy to Clipboard Copied! 생성된 풀 시크릿은 Red Hat Ecosystem에서 Developer Hub 이미지를 가져오는 데 사용됩니다.
Red Hat Ecosystem에서 Operator가 포함된
CatalogSource
리소스를 생성합니다.cat <<EOF | kubectl -n rhdh-operator apply -f - apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: redhat-catalog spec: sourceType: grpc image: registry.redhat.io/redhat/redhat-operator-index:v4.15 secrets: - "rhdh-pull-secret" displayName: Red Hat Operators EOF
cat <<EOF | kubectl -n rhdh-operator apply -f - apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: redhat-catalog spec: sourceType: grpc image: registry.redhat.io/redhat/redhat-operator-index:v4.15 secrets: - "rhdh-pull-secret" displayName: Red Hat Operators EOF
Copy to Clipboard Copied! 다음과 같이
OperatorGroup
리소스를 생성합니다.cat <<EOF | kubectl apply -n rhdh-operator -f - apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: rhdh-operator-group EOF
cat <<EOF | kubectl apply -n rhdh-operator -f - apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: rhdh-operator-group EOF
Copy to Clipboard Copied! 다음 코드를 사용하여
서브스크립션
리소스를 생성합니다.cat <<EOF | kubectl apply -n rhdh-operator -f - apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: rhdh namespace: rhdh-operator spec: channel: fast installPlanApproval: Automatic name: rhdh source: redhat-catalog sourceNamespace: rhdh-operator startingCSV: rhdh-operator.v1.2.6 EOF
cat <<EOF | kubectl apply -n rhdh-operator -f - apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: rhdh namespace: rhdh-operator spec: channel: fast installPlanApproval: Automatic name: rhdh source: redhat-catalog sourceNamespace: rhdh-operator startingCSV: rhdh-operator.v1.2.6 EOF
Copy to Clipboard Copied! 다음 명령을 실행하여 생성된 Operator가 실행 중인지 확인합니다.
kubectl -n rhdh-operator get pods -w
kubectl -n rhdh-operator get pods -w
Copy to Clipboard Copied! Operator Pod에
ImagePullBackOff
상태가 표시되면 Operator 배포 매니페스트 내에서 이미지를 직접 가져오려면 권한이 필요할 수 있습니다.작은 정보deployment.spec.template.spec.imagePullSecrets
목록에 필요한 시크릿 이름을 추가하고kubectl get deployment -n rhdh-operator
명령을 사용하여 배포 이름을 확인할 수 있습니다.kubectl -n rhdh-operator patch deployment \ rhdh.fast --patch '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"rhdh-pull-secret"}]}}}}' \ --type=merge
kubectl -n rhdh-operator patch deployment \ rhdh.fast --patch '{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"rhdh-pull-secret"}]}}}}' \ --type=merge
Copy to Clipboard Copied! 다음 단계를 사용하여 EKS에서 Developer Hub 리소스가 올바르게 시작될 수 있도록 Operator의 기본 구성을 업데이트합니다.
다음 명령을 사용하여
rhdh-operator
네임스페이스에서backstage-default-config
ConfigMap을 편집합니다.kubectl -n rhdh-operator edit configmap backstage-default-config
kubectl -n rhdh-operator edit configmap backstage-default-config
Copy to Clipboard Copied! 다음 예와 같이
db-statefulset.yaml
문자열을 찾고fsGroup
을spec.template.spec.securityContext
에 추가합니다.db-statefulset.yaml: | apiVersion: apps/v1 kind: StatefulSet --- TRUNCATED --- spec: --- TRUNCATED --- restartPolicy: Always securityContext: # You can assign any random value as fsGroup fsGroup: 2000 serviceAccount: default serviceAccountName: default --- TRUNCATED ---
db-statefulset.yaml: | apiVersion: apps/v1 kind: StatefulSet --- TRUNCATED --- spec: --- TRUNCATED --- restartPolicy: Always securityContext: # You can assign any random value as fsGroup fsGroup: 2000 serviceAccount: default serviceAccountName: default --- TRUNCATED ---
Copy to Clipboard Copied! 다음 예와 같이
deployment.yaml
문자열을 찾고fsGroup
을 사양에 추가합니다.deployment.yaml: | apiVersion: apps/v1 kind: Deployment --- TRUNCATED --- spec: securityContext: # You can assign any random value as fsGroup fsGroup: 3000 automountServiceAccountToken: false --- TRUNCATED ---
deployment.yaml: | apiVersion: apps/v1 kind: Deployment --- TRUNCATED --- spec: securityContext: # You can assign any random value as fsGroup fsGroup: 3000 automountServiceAccountToken: false --- TRUNCATED ---
Copy to Clipboard Copied! service.yaml
문자열을 찾고 다음과 같이유형을
NodePort
로 변경합니다.service.yaml: | apiVersion: v1 kind: Service spec: # NodePort is required for the ALB to route to the Service type: NodePort --- TRUNCATED ---
service.yaml: | apiVersion: v1 kind: Service spec: # NodePort is required for the ALB to route to the Service type: NodePort --- TRUNCATED ---
Copy to Clipboard Copied! 저장 및 종료합니다.
변경 사항이 Operator Pod에 자동으로 적용될 때까지 몇 분 정도 기다립니다.
1.1.2. Operator를 사용하여 EKS에 Developer Hub 인스턴스 배포
사전 요구 사항
- 클러스터 관리자가 Red Hat Developer Hub Operator를 설치했습니다.
- AWS Application Load Balancer(ALB) 애드온이 설치된 EKS 클러스터가 있어야 합니다. 자세한 내용은 Amazon Elastic Kubernetes Service의 애플리케이션 로드 밸런싱 및 AWS Load Balancer Controller 애드온 설치를 참조하십시오.
- 개발자 허브 인스턴스의 도메인 이름을 구성했습니다. 도메인 이름은 Route 53의 호스팅 영역 항목이거나 AWS 외부에서 관리할 수 있습니다. 자세한 내용은 Amazon Route 53 as your DNS 서비스 설명서를 참조하십시오.
- 원하는 도메인 이름에 대한 AWS Certificate Manager (ACM) 항목이 있습니다. 인증서 ARN 기록을 보관해야 합니다.
-
registry.redhat.io
에 가입했습니다. 자세한 내용은 Red Hat Container Registry Authentication 을 참조하십시오. -
현재
kubeconfig
에서 컨텍스트를 EKS 클러스터로 설정했습니다. 자세한 내용은 Amazon EKS 클러스터의 kubeconfig 파일 생성 또는 업데이트를 참조하십시오. -
kubectl
을 설치했습니다. 자세한 내용은 kubectl 설치 또는 업데이트를 참조하십시오.
프로세스
다음 템플릿을 사용하여 Developer Hub 구성이 포함된
app-config-rhdh
라는 ConfigMap을 생성합니다.apiVersion: v1 kind: ConfigMap metadata: name: app-config-rhdh data: "app-config-rhdh.yaml": | app: title: Red Hat Developer Hub baseUrl: https://<rhdh_dns_name> backend: auth: keys: - secret: "${BACKEND_SECRET}" baseUrl: https://<rhdh_dns_name> cors: origin: https://<rhdh_dns_name>
apiVersion: v1 kind: ConfigMap metadata: name: app-config-rhdh data: "app-config-rhdh.yaml": | app: title: Red Hat Developer Hub baseUrl: https://<rhdh_dns_name> backend: auth: keys: - secret: "${BACKEND_SECRET}" baseUrl: https://<rhdh_dns_name> cors: origin: https://<rhdh_dns_name>
Copy to Clipboard Copied! secrets-rhdh
라는 시크릿을 생성하고Base64로 인코딩된
문자열을 값으로 사용하여BACKEND_SECRET
이라는 키를 추가합니다.apiVersion: v1 kind: Secret metadata: name: secrets-rhdh stringData: # TODO: See https://backstage.io/docs/auth/service-to-service-auth/#setup BACKEND_SECRET: "xxx"
apiVersion: v1 kind: Secret metadata: name: secrets-rhdh stringData: # TODO: See https://backstage.io/docs/auth/service-to-service-auth/#setup BACKEND_SECRET: "xxx"
Copy to Clipboard Copied! 중요각 Developer Hub 인스턴스에 대해 고유한
BACKEND_SECRET
값을 사용해야 합니다.다음 명령을 사용하여 키를 생성할 수 있습니다.
node-p'require("crypto").randomBytes(24).toString("base64")'
node-p'require("crypto").randomBytes(24).toString("base64")'
Copy to Clipboard Copied! Red Hat Ecosystem Catalog에서 PostgreSQL 이미지를 가져올 수 있도록 Developer Hub 인스턴스가 배포되는 네임스페이스 내의 기본 서비스 계정에 이미지 가져오기 보안을 추가합니다.
kubectl patch serviceaccount default \ -p '{"imagePullSecrets": [{"name": "rhdh-pull-secret"}]}' \ -n <your_namespace>
kubectl patch serviceaccount default \ -p '{"imagePullSecrets": [{"name": "rhdh-pull-secret"}]}' \ -n <your_namespace>
Copy to Clipboard Copied! 다음 템플릿을 사용하여 사용자 정의 리소스 파일을 생성합니다.
apiVersion: rhdh.redhat.com/v1alpha1 kind: Backstage metadata: # TODO: this the name of your Developer Hub instance name: my-rhdh spec: application: imagePullSecrets: - "rhdh-pull-secret" route: enabled: false appConfig: configMaps: - name: "app-config-rhdh" extraEnvs: secrets: - name: "secrets-rhdh"
apiVersion: rhdh.redhat.com/v1alpha1 kind: Backstage metadata: # TODO: this the name of your Developer Hub instance name: my-rhdh spec: application: imagePullSecrets: - "rhdh-pull-secret" route: enabled: false appConfig: configMaps: - name: "app-config-rhdh" extraEnvs: secrets: - name: "secrets-rhdh"
Copy to Clipboard Copied! 다음 템플릿을 사용하여 Ingress 리소스를 생성하여 필요에 따라 이름을 사용자 지정하도록 합니다.
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: # TODO: this the name of your Developer Hub Ingress name: my-rhdh annotations: alb.ingress.kubernetes.io/scheme: internet-facing alb.ingress.kubernetes.io/target-type: ip # TODO: Using an ALB HTTPS Listener requires a certificate for your own domain. Fill in the ARN of your certificate, e.g.: alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-xxx:xxxx:certificate/xxxxxx alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' alb.ingress.kubernetes.io/ssl-redirect: '443' # TODO: Set your application domain name. external-dns.alpha.kubernetes.io/hostname: <rhdh_dns_name> spec: ingressClassName: alb rules: # TODO: Set your application domain name. - host: <rhdh_dns_name> http: paths: - path: / pathType: Prefix backend: service: # TODO: my-rhdh is the name of your Backstage Custom Resource. # Adjust if you changed it! name: backstage-my-rhdh port: name: http-backend
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: # TODO: this the name of your Developer Hub Ingress name: my-rhdh annotations: alb.ingress.kubernetes.io/scheme: internet-facing alb.ingress.kubernetes.io/target-type: ip # TODO: Using an ALB HTTPS Listener requires a certificate for your own domain. Fill in the ARN of your certificate, e.g.: alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-xxx:xxxx:certificate/xxxxxx alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' alb.ingress.kubernetes.io/ssl-redirect: '443' # TODO: Set your application domain name. external-dns.alpha.kubernetes.io/hostname: <rhdh_dns_name> spec: ingressClassName: alb rules: # TODO: Set your application domain name. - host: <rhdh_dns_name> http: paths: - path: / pathType: Prefix backend: service: # TODO: my-rhdh is the name of your Backstage Custom Resource. # Adjust if you changed it! name: backstage-my-rhdh port: name: http-backend
Copy to Clipboard Copied! 이전 템플릿에서 ' <rhdh_dns_name>'을 Developer Hub 도메인 이름으로 바꾸고
alb.ingress.kubernetes.io/certificate-arn
값을 인증서 ARN으로 업데이트합니다.
검증
DNS 이름이 응답할 때까지 기다린 후 Developer Hub 인스턴스를 사용할 준비가 되었음을 나타냅니다.
1.2. Helm 차트를 사용하여 EKS에 개발자 허브 설치
EKS(Elastic Kubernetes Service)에 Developer Hub Helm 차트를 설치할 때 AWS 에코시스템 내에서 강력한 개발자 플랫폼을 제공하는 Developer Hub 인스턴스의 배포를 오케스트레이션합니다.
사전 요구 사항
- AWS Application Load Balancer(ALB) 애드온이 설치된 EKS 클러스터가 있어야 합니다. 자세한 내용은 Amazon Developer Hub의 애플리케이션 로드 밸런싱 및 AWS Load Balancer Controller 애드온 설치를 참조하십시오.
- 개발자 허브 인스턴스의 도메인 이름을 구성했습니다. 도메인 이름은 Route 53의 호스팅 영역 항목이거나 AWS 외부에서 관리할 수 있습니다. 자세한 내용은 Amazon Route 53 as your DNS 서비스 설명서를 참조하십시오.
- 원하는 도메인 이름에 대한 AWS Certificate Manager (ACM) 항목이 있습니다. 인증서 ARN 기록을 보관해야 합니다.
-
registry.redhat.io
에 가입했습니다. 자세한 내용은 Red Hat Container Registry Authentication 을 참조하십시오. -
현재
kubeconfig
에서 컨텍스트를 EKS 클러스터로 설정했습니다. 자세한 내용은 Amazon EKS 클러스터의 kubeconfig 파일 생성 또는 업데이트를 참조하십시오. -
kubectl
을 설치했습니다. 자세한 내용은 kubectl 설치 또는 업데이트를 참조하십시오. - Helm 3 또는 최신 버전을 설치했습니다. 자세한 내용은 Amazon EKS에서 Helm 사용을 참조하십시오.
프로세스
터미널로 이동하여 다음 명령을 실행하여 개발자 허브 차트가 포함된 Helm 차트 리포지터리를 로컬 Helm 레지스트리에 추가합니다.
helm repo add openshift-helm-charts https://charts.openshift.io/
helm repo add openshift-helm-charts https://charts.openshift.io/
Copy to Clipboard Copied! 다음 명령을 사용하여 풀 시크릿을 생성합니다.
kubectl create secret docker-registry rhdh-pull-secret \ --docker-server=registry.redhat.io \ --docker-username=<user_name> \ --docker-password=<password> \ --docker-email=<email>
kubectl create secret docker-registry rhdh-pull-secret \ --docker-server=registry.redhat.io \ --docker-username=<user_name> \
1 --docker-password=<password> \
2 --docker-email=<email>
3 Copy to Clipboard Copied! 생성된 풀 시크릿은 Red Hat Ecosystem에서 Developer Hub 이미지를 가져오는 데 사용됩니다.
다음 템플릿을 사용하여
values.yaml
이라는 파일을 생성합니다.global: # TODO: Set your application domain name. host: <your Developer Hub domain name> route: enabled: false upstream: service: # NodePort is required for the ALB to route to the Service type: NodePort ingress: enabled: true annotations: kubernetes.io/ingress.class: alb alb.ingress.kubernetes.io/scheme: internet-facing # TODO: Using an ALB HTTPS Listener requires a certificate for your own domain. Fill in the ARN of your certificate, e.g.: alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:xxx:xxxx:certificate/xxxxxx alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' alb.ingress.kubernetes.io/ssl-redirect: '443' # TODO: Set your application domain name. external-dns.alpha.kubernetes.io/hostname: <your rhdh domain name> backstage: image: pullSecrets: - rhdh-pull-secret podSecurityContext: # you can assign any random value as fsGroup fsGroup: 2000 postgresql: image: pullSecrets: - rhdh-pull-secret primary: podSecurityContext: enabled: true # you can assign any random value as fsGroup fsGroup: 3000 volumePermissions: enabled: true
global: # TODO: Set your application domain name. host: <your Developer Hub domain name> route: enabled: false upstream: service: # NodePort is required for the ALB to route to the Service type: NodePort ingress: enabled: true annotations: kubernetes.io/ingress.class: alb alb.ingress.kubernetes.io/scheme: internet-facing # TODO: Using an ALB HTTPS Listener requires a certificate for your own domain. Fill in the ARN of your certificate, e.g.: alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:xxx:xxxx:certificate/xxxxxx alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' alb.ingress.kubernetes.io/ssl-redirect: '443' # TODO: Set your application domain name. external-dns.alpha.kubernetes.io/hostname: <your rhdh domain name> backstage: image: pullSecrets: - rhdh-pull-secret podSecurityContext: # you can assign any random value as fsGroup fsGroup: 2000 postgresql: image: pullSecrets: - rhdh-pull-secret primary: podSecurityContext: enabled: true # you can assign any random value as fsGroup fsGroup: 3000 volumePermissions: enabled: true
Copy to Clipboard Copied! 터미널에서 다음 명령을 실행하여 최신 버전의 Helm 차트를 사용하고 이전 단계에서 생성한 values.yaml 파일을 사용하여 개발자 허브를 배포합니다.
helm install rhdh \ openshift-helm-charts/redhat-developer-hub \ [--version 1.2.6] \ --values /path/to/values.yaml
helm install rhdh \ openshift-helm-charts/redhat-developer-hub \ [--version 1.2.6] \ --values /path/to/values.yaml
Copy to Clipboard Copied!
검증
DNS 이름이 응답할 때까지 기다린 후 Developer Hub 인스턴스를 사용할 준비가 되었음을 나타냅니다.