Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

4.13. OpenShift Container Registry 구성

통합 OpenShift Container Registry 는 설치 프로그램을 사용하여 배포할 수 있습니다.

4.13.1. 레지스트리 스토리지 구성

레지스트리 스토리지 옵션을 사용하지 않는 경우 기본 OpenShift Container Registry는 임시이며 Pod가 더 이상 존재하지 않으면 모든 데이터가 손실됩니다.

중요

테스트 결과, RHEL NFS 서버를 컨테이너 이미지 레지스트리의 스토리지 백엔드로 사용하는 데 문제가 있는 것으로 표시됩니다. 여기에는 OpenShift Container Registry 및 Quay가 포함됩니다. 따라서 RHEL NFS 서버를 사용하여 핵심 서비스에서 사용하는 PV를 백업하는 것은 권장되지 않습니다.

마켓플레이스의 다른 NFS 구현에는 이러한 문제가 나타나지 않을 수 있습니다. 이러한 OpenShift 핵심 구성 요소에 대해 완료된 테스트에 대한 자세한 내용은 개별 NFS 구현 공급업체에 문의하십시오.

고급 설치 프로그램을 사용할 때 레지스트리 스토리지를 활성화하기 위한 몇 가지 옵션이 있습니다.

옵션 A: NFS 호스트 그룹

다음 변수가 설정되면 [nfs] 호스트 그룹의 호스트의 < nfs_directory>/<volume_name > 경로를 사용하여 클러스터 설치 중에 NFS 볼륨이 생성됩니다. 예를 들어 이러한 옵션을 사용하는 볼륨 경로는 /exports/registry 입니다.

[OSEv3:vars]

# nfs_directory must conform to DNS-1123 subdomain must consist of lower case
# alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character

openshift_hosted_registry_storage_kind=nfs
openshift_hosted_registry_storage_access_modes=['ReadWriteMany']
openshift_hosted_registry_storage_nfs_directory=/exports
openshift_hosted_registry_storage_nfs_options='*(rw,root_squash)'
openshift_hosted_registry_storage_volume_name=registry
openshift_hosted_registry_storage_volume_size=10Gi
옵션 B: 외부 NFS 호스트

외부 NFS 볼륨을 사용하려면 스토리지 호스트에 < nfs_directory>/<volume_name > 경로가 이미 있어야 합니다. 다음 옵션을 사용하는 원격 볼륨 경로는 nfs.example.com:/exports/registry 입니다.

[OSEv3:vars]

# nfs_directory must conform to DNS-1123 subdomain must consist of lower case
# alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character

openshift_hosted_registry_storage_kind=nfs
openshift_hosted_registry_storage_access_modes=['ReadWriteMany']
openshift_hosted_registry_storage_host=nfs.example.com
openshift_hosted_registry_storage_nfs_directory=/exports
openshift_hosted_registry_storage_volume_name=registry
openshift_hosted_registry_storage_volume_size=10Gi
NFS를 사용하여 OpenShift Container Platform 업그레이드 또는 설치
Option C: OpenStack Platform

OpenStack 스토리지 구성이 이미 있어야 합니다.

[OSEv3:vars]

openshift_hosted_registry_storage_kind=openstack
openshift_hosted_registry_storage_access_modes=['ReadWriteOnce']
openshift_hosted_registry_storage_openstack_filesystem=ext4
openshift_hosted_registry_storage_openstack_volumeID=3a650b4f-c8c5-4e0a-8ca5-eaee11f16c57
openshift_hosted_registry_storage_volume_size=10Gi
옵션 D: AWS 또는 다른 S3 스토리지 솔루션

단순 스토리지 솔루션(S3) 버킷이 이미 있어야 합니다.

[OSEv3:vars]

#openshift_hosted_registry_storage_kind=object
#openshift_hosted_registry_storage_provider=s3
#openshift_hosted_registry_storage_s3_accesskey=access_key_id
#openshift_hosted_registry_storage_s3_secretkey=secret_access_key
#openshift_hosted_registry_storage_s3_bucket=bucket_name
#openshift_hosted_registry_storage_s3_region=bucket_region
#openshift_hosted_registry_storage_s3_chunksize=26214400
#openshift_hosted_registry_storage_s3_rootdirectory=/registry
#openshift_hosted_registry_pullthrough=true
#openshift_hosted_registry_acceptschema2=true
#openshift_hosted_registry_enforcequota=true

Minio 또는 ExoScale과 같은 다른 S3 서비스를 사용하는 경우 region endpoint 매개변수도 추가합니다.

openshift_hosted_registry_storage_s3_regionendpoint=https://myendpoint.example.com/
옵션 E: 통합 모드

통합 모드를 구성하는 것과 유사하게 Red Hat Gluster Storage는 클러스터를 처음 설치하는 동안 OpenShift Container Registry용 스토리지를 제공하여 레지스트리에 대한 중복되고 안정적인 스토리지를 제공하도록 구성할 수 있습니다.

중요

특정 호스트 준비 및 사전 요구 사항은 통합 모드 고려 사항을 참조하십시오.

  1. 인벤토리 파일에서 [OSEv3:vars] 섹션에서 다음 변수를 설정하고 구성에 필요한 대로 조정합니다.

    [OSEv3:vars]
    ...
    openshift_hosted_registry_storage_kind=glusterfs 1
    openshift_hosted_registry_storage_volume_size=5Gi
    openshift_hosted_registry_selector='node-role.kubernetes.io/infra=true'
    1
    인프라 노드에서 통합 OpenShift Container Registry를 실행하는 것이 좋습니다. 인프라 노드는 OpenShift Container Platform 클러스터에 서비스를 제공하기 위해 관리자가 배포한 애플리케이션을 실행하는 전용 노드입니다.
  2. [OSEv3:children] 섹션에 glusterfs_registry 를 추가하여 [glusterfs_registry] 그룹을 활성화합니다.

    [OSEv3:children]
    masters
    nodes
    glusterfs_registry
  3. GlusterFS 스토리지를 호스팅할 각 스토리지 노드에 대한 항목이 [glusterfs_registry] 섹션을 추가합니다. 각 노드에 대해 glusterfs_devices 를 GlusterFS 클러스터의 일부로 완전히 관리할 원시 블록 장치 목록으로 설정합니다. 나열된 장치가 하나 이상 있어야 합니다. 파티션이나 LVM PV가 없는 각 장치는 베어여야 합니다. 변수를 지정하면 폼을 사용합니다.

    <hostname_or_ip> glusterfs_devices='[ "</path/to/device1/>", "</path/to/device2>", ... ]'

    예를 들면 다음과 같습니다.

    [glusterfs_registry]
    node11.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
    node12.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
    node13.example.com glusterfs_devices='[ "/dev/xvdc", "/dev/xvdd" ]'
  4. [glusterfs_registry] 아래에 나열된 호스트를 [nodes] 그룹에 추가합니다.

    [nodes]
    ...
    node11.example.com openshift_node_group_name="node-config-infra"
    node12.example.com openshift_node_group_name="node-config-infra"
    node13.example.com openshift_node_group_name="node-config-infra"
옵션 F: Google Compute Engine (GCE)의 GCS(Google Cloud Storage) 버킷

GCS 버킷은 이미 있어야 합니다.

[OSEv3:vars]

openshift_hosted_registry_storage_provider=gcs
openshift_hosted_registry_storage_gcs_bucket=bucket01
openshift_hosted_registry_storage_gcs_keyfile=test.key
openshift_hosted_registry_storage_gcs_rootdirectory=/registry
옵션 G: vSphere Cloud Provider(VCP)를 통한 vSphere 볼륨

vSphere 클라우드 공급자는 OpenShift Container Platform 노드에서 액세스할 수 있는 데이터 저장소를 사용하여 구성해야 합니다.

레지스트리에 vSphere 볼륨을 사용하는 경우 스토리지 액세스 모드를 ReadWriteOnce 로 설정하고 복제본 수를 1 로 설정해야 합니다.

[OSEv3:vars]

openshift_hosted_registry_storage_kind=vsphere
openshift_hosted_registry_storage_access_modes=['ReadWriteOnce']
openshift_hosted_registry_storage_annotations=['volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/vsphere-volume']
openshift_hosted_registry_replicas=1