6.2. 외부 Redis 구성
이 섹션의 콘텐츠를 사용하여 외부 Redis 배포를 설정합니다.
6.2.1. 관리되지 않는 Redis 데이터베이스 사용
다음 절차에 따라 외부 Redis 데이터베이스를 설정합니다.
프로세스
다음 Redis 필드를 사용하여
config.yaml
파일을 생성합니다.# ... BUILDLOGS_REDIS: host: <quay-server.example.com> port: 6379 ssl: false # ... USER_EVENTS_REDIS: host: <quay-server.example.com> port: 6379 ssl: false # ...
구성 파일을 사용하여 보안을 생성하려면 다음 명령을 입력합니다.
$ oc create secret generic --from-file config.yaml=./config.yaml config-bundle-secret
Redis 구성 요소를
Unmanaged
로 설정하고 생성된 시크릿을 참조하는quayregistry.yaml
파일을 생성합니다.apiVersion: quay.redhat.com/v1 kind: QuayRegistry metadata: name: example-registry namespace: quay-enterprise spec: configBundleSecret: config-bundle-secret components: - kind: redis managed: false # ...
- Red Hat Quay 레지스트리를 배포합니다.
추가 리소스
6.2.2. 관리되지 않는 Horizontal Pod Autoscaler 사용
이제 HPA(Horizontal Pod Autoscalers)가 Clair
,Quay
, Mirror
Pod에 포함되어 로드 급증 중에 자동으로 확장됩니다.
HPA는 기본적으로 관리되도록 구성되므로 Clair
,Quay
및 미러
Pod의 수는 2로 설정됩니다. 이를 통해 Operator를 통해 또는 일정 조정 중에 Red Hat Quay를 업데이트하거나 재구성할 때 다운타임을 방지할 수 있습니다.
HorizontalPodAutoscaler
구성 요소를 비활성화하고 HPA 리소스 자체를 편집하려고 할 때 알려진 문제가 있으며 minReplicas
필드의 값을 늘립니다. 이 설정을 시도할 때 Quay
애플리케이션 pod는 관리되지 않는 HPA에서 확장되며 60초 후에 Red Hat Quay Operator에 의해 복제본 수를 조정합니다. 결과적으로 Operator에서 HPA Pod가 지속적으로 생성되고 제거됩니다.
이 문제를 해결하려면 Red Hat Quay 배포를 최소 버전 3.12.5 또는 3.13.1로 업그레이드한 다음 다음 예제를 사용하여 문제를 방지해야 합니다.
이 문제는 Red Hat Quay의 향후 버전에서 해결될 예정입니다. 자세한 내용은 PROJQUAY-6474 를 참조하십시오.
6.2.2.1. Horizontal Pod Autoscaler 비활성화
자동 스케일링을 비활성화하거나 자체 HorizontalPodAutoscaler
구성 요소를 생성하려면 QuayRegistry
사용자 정의 리소스 정의에서 구성 요소를 Unmanaged
로 지정합니다. 위에서 언급한 알려진 문제를 방지하려면 QuayRegistry
CRD 오브젝트를 수정하고 quay
,clair
, 미러
구성 요소에 대해 null
과 같은 복제본을 설정해야 합니다.
프로세스
quay
구성 요소에 대해null replicas
를 포함하도록QuayRegistry
CRD를 편집합니다.$ oc edit quayregistry <quay_registry_name> -n <quay_namespace>
apiVersion: quay.redhat.com/v1 kind: QuayRegistry metadata: name: quay-registry namespace: quay-enterprise spec: components: - kind: horizontalpodautoscaler managed: false - kind: quay managed: true overrides: replicas: null 1 - kind: clair managed: true overrides: replicas: null - kind: mirror managed: true overrides: replicas: null # ...
- 1
QuayRegistry
CRD에replicas: null
을 설정한 후Quay
앱의 배포 매니페스트가replicas: 1
로 변경되므로 새 복제본 세트가 생성될 수 있습니다.
검증
사용자 지정
HorizontalPodAutoscalers
CRD를 생성하고 Exampe의 경우minReplicas
양을 더 높은 값으로 늘립니다.kind: HorizontalPodAutoscaler apiVersion: autoscaling/v2 metadata: name: quay-registry-quay-app namespace: quay-enterprise spec: scaleTargetRef: kind: Deployment name: quay-registry-quay-app apiVersion: apps/v1 minReplicas: 3 maxReplicas: 20 metrics: - type: Resource resource: name: memory target: type: Utilization averageUtilization: 90 - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 90
다음 명령을 입력하여
QuayRegistry
애플리케이션이 성공적으로 시작되었는지 확인합니다.$ oc get pod | grep quay-app
출력 예
quay-registry-quay-app-5b8fd49d6b-7wvbk 1/1 Running 0 34m quay-registry-quay-app-5b8fd49d6b-jslq9 1/1 Running 0 3m42s quay-registry-quay-app-5b8fd49d6b-pskpz 1/1 Running 0 43m quay-registry-quay-app-upgrade-llctl 0/1 Completed 0 51m
다음 명령을 입력하여
HorizontalPodAutoscalers
가 성공적으로 시작되었는지 확인합니다.$ oc get hpa
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE quay-registry-quay-app Deployment/quay-registry-quay-app 67%/90%, 54%/90% 3 20 3 51m
6.2.3. Route 구성 요소 비활성화
Red Hat Quay Operator가 경로를 생성하지 못하도록 하려면 다음 절차를 사용하십시오.
프로세스
quayregistry.yaml
파일에서 구성 요소를managed: false
로 설정합니다.apiVersion: quay.redhat.com/v1 kind: QuayRegistry metadata: name: example-registry namespace: quay-enterprise spec: components: - kind: route managed: false
config.yaml
파일을 편집하여 Red Hat Quay가 SSL/TLS를 처리하도록 지정합니다. 예를 들면 다음과 같습니다.# ... EXTERNAL_TLS_TERMINATION: false # ... SERVER_HOSTNAME: example-registry-quay-quay-enterprise.apps.user1.example.com # ... PREFERRED_URL_SCHEME: https # ...
관리되지 않는 경로를 올바르게 구성하지 않으면 다음 오류가 반환됩니다.
{ { "kind":"QuayRegistry", "namespace":"quay-enterprise", "name":"example-registry", "uid":"d5879ba5-cc92-406c-ba62-8b19cf56d4aa", "apiVersion":"quay.redhat.com/v1", "resourceVersion":"2418527" }, "reason":"ConfigInvalid", "message":"required component `route` marked as unmanaged, but `configBundleSecret` is missing necessary fields" }
기본 경로를 비활성화하면 Red Hat Quay 인스턴스에 액세스하기 위해 경로
,서비스
또는 Ingress
를 생성해야 합니다. 또한 사용하는 DNS는 Red Hat Quay 구성의 SERVER_HOSTNAME
과 일치해야 합니다.
6.2.4. 모니터링 구성 요소 비활성화
단일 네임스페이스에 Red Hat Quay Operator를 설치하는 경우 모니터링 구성 요소가 자동으로 managed: false
로 설정됩니다. 다음 참조를 사용하여 모니터링을 명시적으로 비활성화합니다.
관리되지 않는 모니터링
apiVersion: quay.redhat.com/v1 kind: QuayRegistry metadata: name: example-registry namespace: quay-enterprise spec: components: - kind: monitoring managed: false
이 시나리오에서 모니터링을 활성화하려면 Red Hat Quay Operator가 단일 네임스페이스에 설치될 때 모니터링 활성화를 참조하십시오.
6.2.5. 미러링 구성 요소 비활성화
미러링을 비활성화하려면 다음 YAML 구성을 사용합니다.
관리되지 않는 미러링 예제 YAML 구성
apiVersion: quay.redhat.com/v1 kind: QuayRegistry metadata: name: example-registry namespace: quay-enterprise spec: components: - kind: mirroring managed: false