Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

8.3. OpenShift Container Registry 설치

  1. 계획 계획 부터 전체 클러스터 설치 프로세스를 검토합니다. OCR을 설치하면 동일한 프로세스가 사용되지만 인벤토리 파일에 몇 가지 특정 설정이 필요합니다. 설치 문서에는 인벤토리 파일에 사용 가능한 Ansible 변수 목록이 포함되어 있습니다.
  2. 호스트 준비 단계를 완료합니다.
  3. /etc/ansible/hosts 디렉터리에 인벤토리 파일을 생성합니다.

    중요

    독립 실행형 OCR을 설치하려면 [OSEv3:vars] 섹션의 인벤토리 파일에 deployment_subtype=registry 를 설정해야 합니다.

    지원되는 다양한 시스템 토폴로지에 대해 다음 예제 인벤토리 파일을 사용합니다.

    올인원 독립형 OpenShift Container Registry 인벤토리 파일

    # Create an OSEv3 group that contains the masters and nodes groups
    [OSEv3:children]
    masters
    nodes
    etcd
    
    # Set variables common for all OSEv3 hosts
    [OSEv3:vars]
    # SSH user, this user should allow ssh based auth without requiring a password
    ansible_ssh_user=root
    
    openshift_master_default_subdomain=apps.test.example.com
    
    # If ansible_ssh_user is not root, ansible_become must be set to true
    #ansible_become=true
    
    openshift_deployment_type=openshift-enterprise
    deployment_subtype=registry 1
    openshift_hosted_infra_selector="" 2
    
    # uncomment the following to enable htpasswd authentication; defaults to DenyAllPasswordIdentityProvider
    #openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider'}]
    
    # host group for masters
    [masters]
    registry.example.com
    
    # host group for etcd
    [etcd]
    registry.example.com
    
    # host group for nodes
    [nodes]
    registry.example.com openshift_node_group_name='node-config-all-in-one'

    1
    전체 OpenShift Container Platform 환경이 아닌 독립형 OCR을 설치하도록 deployment_subtype=registry 를 설정합니다.
    2
    단일 호스트에 레지스트리 및 해당 웹 콘솔을 예약할 수 있습니다.

    여러 마스터(고가용성) 독립형 OpenShift Container Registry 인벤토리 파일

    # Create an OSEv3 group that contains the master, nodes, etcd, and lb groups.
    # The lb group lets Ansible configure HAProxy as the load balancing solution.
    # Comment lb out if your load balancer is pre-configured.
    [OSEv3:children]
    masters
    nodes
    etcd
    lb
    
    # Set variables common for all OSEv3 hosts
    [OSEv3:vars]
    ansible_ssh_user=root
    openshift_deployment_type=openshift-enterprise
    deployment_subtype=registry 1
    
    openshift_master_default_subdomain=apps.test.example.com
    
    # Uncomment the following to enable htpasswd authentication; defaults to
    # DenyAllPasswordIdentityProvider.
    #openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider'}]
    
    # Native high availability cluster method with optional load balancer.
    # If no lb group is defined installer assumes that a load balancer has
    # been preconfigured. For installation the value of
    # openshift_master_cluster_hostname must resolve to the load balancer
    # or to one or all of the masters defined in the inventory if no load
    # balancer is present.
    openshift_master_cluster_method=native
    openshift_master_cluster_hostname=openshift-internal.example.com
    openshift_master_cluster_public_hostname=openshift-cluster.example.com
    
    # apply updated node-config-compute group defaults
    openshift_node_groups=[{'name': 'node-config-compute', 'labels': ['node-role.kubernetes.io/compute=true'], 'edits': [{'key': 'kubeletArguments.pods-per-core','value': ['20']}, {'key': 'kubeletArguments.max-pods','value': ['250']}, {'key': 'kubeletArguments.image-gc-high-threshold', 'value':['90']}, {'key': 'kubeletArguments.image-gc-low-threshold', 'value': ['80']}]}]
    
    # enable ntp on masters to ensure proper failover
    openshift_clock_enabled=true
    
    # host group for masters
    [masters]
    master1.example.com
    master2.example.com
    master3.example.com
    
    # host group for etcd
    [etcd]
    etcd1.example.com
    etcd2.example.com
    etcd3.example.com
    
    # Specify load balancer host
    [lb]
    lb.example.com
    
    # host group for nodes, includes region info
    [nodes]
    master[1:3].example.com openshift_node_group_name='node-config-master-infra'
    node1.example.com       openshift_node_group_name='node-config-compute'
    node2.example.com       openshift_node_group_name='node-config-compute'

    1
    전체 OpenShift Container Platform 환경이 아닌 독립형 OCR을 설치하도록 deployment_subtype=registry 를 설정합니다.
  4. 독립 실행형 OCR을 설치합니다. 프로세스는 전체 클러스터 설치 프로세스와 유사합니다.

    중요

    Ansible 플레이북을 실행하는 호스트에는 인벤토리 파일에서 호스트당 최소 75MiB의 여유 메모리가 있어야 합니다.

    1. 새 클러스터를 배포하기 전에 클러스터 디렉터리로 변경하고 prerequisites.yml 플레이북을 실행합니다.

      $ cd /usr/share/ansible/openshift-ansible
      $ ansible-playbook  [-i /path/to/inventory] \ 1
          playbooks/prerequisites.yml
      1
      인벤토리 파일이 /etc/ansible/hosts 디렉터리에 없는 경우 -i 및 인벤토리 파일의 경로를 지정합니다.

      이 플레이북은 한 번만 실행해야 합니다.

    2. 설치를 시작하려면 플레이북 디렉터리로 변경하고 deploy_cluster.yml 플레이북을 실행합니다.

      $ cd /usr/share/ansible/openshift-ansible
      $ ansible-playbook  [-i /path/to/inventory] \ 1
          playbooks/deploy_cluster.yml
      1
      인벤토리 파일이 /etc/ansible/hosts 디렉터리에 없는 경우 -i 및 인벤토리 파일의 경로를 지정합니다.