1장. Operator를 사용하여 AKS에 개발자 허브 배포
Red Hat Developer Hub Operator를 사용하여 AKS에 개발자 허브를 배포할 수 있습니다.
프로세스
rhdh-operator-<VERSION>.yaml이라는 Red Hat Developer Hub Operator 매니페스트 파일을 가져오고 다음 조각을 추가하여db-statefulset.yaml및deployment.yaml의 기본 구성을 수정합니다.securityContext: fsGroup: 300다음은 매니페스트에 지정된 위치입니다.
db-statefulset.yaml: | spec.template.spec deployment.yaml: | spec.template.spec수정된 Operator 매니페스트를 Kubernetes 클러스터에 적용합니다.
kubectl apply -f rhdh-operator-<VERSION>.yaml참고이전 명령을 실행하는 것은 클러스터 범위이며 적절한 클러스터 권한이 필요합니다.
다음 예와 같이 보호된
registry.redhat.io의 이미지에 액세스하기 위해 Red Hat 인증 정보를 사용하여rhdh-pull-secret이라는ImagePull보안을 생성합니다.kubectl -n <your_namespace> create secret docker-registry rhdh-pull-secret \ --docker-server=registry.redhat.io \ --docker-username=<redhat_user_name> \ --docker-password=<redhat_password> \ --docker-email=<email>다음과 같이 Developer Hub 서비스 이름을 지정하여
rhdh-ingress.yaml이라는 Ingress 매니페스트 파일을 생성합니다.apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: rhdh-ingress namespace: <your_namespace> spec: ingressClassName: webapprouting.kubernetes.azure.com rules: - http: paths: - path: / pathType: Prefix backend: service: name: backstage-<your-CR-name> port: name: http-backend생성된 Ingress를 배포하려면 다음 명령을 실행합니다.
kubectl -n <your_namespace> apply -f rhdh-ingress.yaml다음 예제를 사용하여 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://<app_address> backend: auth: externalAccess: - type: legacy options: subject: legacy-default-config secret: "${BACKEND_SECRET}" baseUrl: https://<app_address> cors: origin: https://<app_address>secrets-rhdh라는 시크릿을 생성하고 다음 예와 같이Base64 인코딩문자열 값을 사용하여BACKEND_SECRET이라는 키를 추가합니다.apiVersion: v1 kind: Secret metadata: name: secrets-rhdh stringData: BACKEND_SECRET: "xxx"rhdh.yaml이라는 사용자 정의 리소스(CR) 매니페스트 파일을 생성하고 다음과 같이 이전에 생성된rhdh-pull-secret을 포함합니다.apiVersion: rhdh.redhat.com/v1alpha1 kind: Backstage metadata: name: <your-rhdh-cr> spec: application: imagePullSecrets: - rhdh-pull-secret appConfig: configMaps: - name: "app-config-rhdh" extraEnvs: secrets: - name: "secrets-rhdh"CR 매니페스트를 네임스페이스에 적용합니다.
kubectl -n <your_namespace> apply -f rhdh.yaml-
URL을 사용하여 배포된 개발자 허브에 액세스합니다.
https://<app_address> . 여기서 <app_address>는 이전에 가져온 Ingress 주소입니다(예:https://108.141.70.228). 선택 사항: CR을 삭제하려면 다음 명령을 실행합니다.
kubectl -n <your_namespace> delete -f rhdh.yaml