2.10. 컨테이너 이미지용 Satellite 서버 준비
Red Hat Satellite 6는 레지스트리 동기화 기능을 제공합니다. 이를 통해 여러 이미지를 Satellite 서버로 가져와 애플리케이션 라이프사이클의 일부로 관리할 수 있습니다. Satellite는 다른 컨테이너 활성화 시스템이 사용할 레지스트리 역할도 합니다. 컨테이너 이미지 관리 방법에 관한 자세한 내용은 Red Hat Satellite 6 Content Management Guide의 "Managing Container Images"를 참조하십시오.
다음 절차의 예제에서는 Red Hat Satellite 6용 hammer
명령행 툴과 ACME
라는 조직을 사용합니다. 이 조직을 실제로 사용하는 Satellite 6 조직으로 대체하십시오.
다음 절차에서는 registry.redhat.io
에서 컨테이너 이미지에 액세스하기 위해 인증 정보가 필요합니다. 개별 사용자 인증 정보를 사용하는 대신, 레지스트리 서비스 계정을 생성하고 해당 인증 정보를 사용하여 registry.redhat.io
콘텐츠에 액세스하는 것이 좋습니다. 자세한 내용은 "Red Hat Container Registry Authentication"을 참조하십시오.
절차
모든 컨테이너 이미지 목록을 생성합니다.
$ sudo podman search --limit 1000 "registry.redhat.io/rhosp-rhel8/openstack" --format="{{ .Name }}" | sort > satellite_images $ sudo podman search --limit 1000 "registry.redhat.io/rhceph" | grep rhceph-4-dashboard-rhel8 $ sudo podman search --limit 1000 "registry.redhat.io/rhceph" | grep rhceph-4-rhel8 $ sudo podman search --limit 1000 "registry.redhat.io/openshift" | grep ose-prometheus
다음과 같은 ose-prometheus 컨테이너가 필요합니다.
registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.6 registry.redhat.io/openshift4/ose-prometheus:v4.6 registry.redhat.io/openshift4/ose-prometheus-alertmanager:v4.6
-
satellite_images_names
파일을 Satellite 6hammer
툴이 포함된 시스템으로 복사합니다. 또는 Hammer CLI 가이드의 지침에 따라hammer
툴을 언더클라우드에 설치합니다. 다음
hammer
명령을 실행하여 Satellite 조직에서 새 제품(OSP16.1 Containers
)을 생성합니다.$ hammer product create \ --organization "ACME" \ --name "OSP Containers"
이 사용자 지정 제품에 이미지를 저장합니다.
satellite_images
파일에서 오버클라우드 컨테이너 이미지를 추가합니다.$ while read IMAGE; do \ IMAGE_NAME=$(echo $IMAGE | cut -d"/" -f3 | sed "s/openstack-//g") ; \ IMAGE_NOURL=$(echo $IMAGE | sed "s/registry.redhat.io\///g") ; \ hammer repository create \ --organization "ACME" \ --product "OSP Containers" \ --content-type docker \ --url https://registry.redhat.io \ --docker-upstream-name $IMAGE_NOURL \ --upstream-username USERNAME \ --upstream-password PASSWORD \ --name $IMAGE_NAME ; done < satellite_images
Ceph Storage 4 컨테이너 이미지를 추가합니다.
$ hammer repository create \ --organization "ACME" \ --product "OSP Containers" \ --content-type docker \ --url https://registry.redhat.io \ --docker-upstream-name rhceph/rhceph-4-rhel8 \ --upstream-username USERNAME \ --upstream-password PASSWORD \ --name rhceph-4-rhel8
컨테이너 이미지를 동기화합니다.
$ hammer product synchronize \ --organization "ACME" \ --name "OSP Containers"
Satellite 서버가 동기화를 완료할 때까지 기다립니다.
참고설정에 따라
hammer
에서 Satellite 서버 사용자 이름과 암호가 필요할 수 있습니다.hammer
를 구성한 후 구성 파일을 사용하여 자동으로 로그인할 수 있습니다. 자세한 내용은 Hammer CLI Guide의 "Authentication" 섹션을 참조하십시오.-
Satellite 6 서버에서 콘텐츠 뷰를 사용하는 경우, 새로운 콘텐츠 뷰 버전을 생성하여 이미지를 통합하고 애플리케이션 라이프사이클의 환경에 따라 승격합니다. 이 과정은 대체로 애플리케이션 라이프사이클을 구조화한 방법에 따라 달라집니다. 예를 들어 라이프사이클에
production
이라는 환경이 있고 해당 환경에서 컨테이너 이미지를 사용할 수 있도록 하려면 컨테이너 이미지가 포함된 콘텐츠 뷰를 생성하고 해당 콘텐츠 뷰를production
환경으로 승격합니다. 자세한 내용은 Managing Content Views를 참조하십시오. base
이미지에 사용 가능한 태그를 확인합니다.$ hammer docker tag list --repository "base" \ --organization "ACME" \ --lifecycle-environment "production" \ --product "OSP Containers"
이 명령을 수행하면 OpenStack Platform 컨테이너 이미지의 태그가 특정 환경의 콘텐츠 뷰에 표시됩니다.
언더클라우드로 돌아가서 Satellite 서버를 소스로 사용하여 이미지를 준비하는 기본 환경 파일을 생성합니다. 다음 예제 명령을 실행하여 환경 파일을 생성합니다.
$ sudo openstack tripleo container image prepare default \ --output-env-file containers-prepare-parameter.yaml
-
--output-env-file
은 환경 파일 이름입니다. 이 파일의 콘텐츠에는 언더클라우드의 컨테이너 이미지를 준비하는 데 필요한 매개변수가 포함되어 있습니다. 이 경우 파일 이름은containers-prepare-parameter.yaml
입니다.
-
containers-prepare-parameter.yaml
파일을 편집하여 다음 매개변수를 수정합니다.-
push_destination
- 선택한 컨테이너 이미지 관리 전략에 따라 이 값을true
또는false
로 설정합니다. 이 매개변수를false
로 설정하면 오버클라우드 노드는 Satellite에서 직접 이미지를 가져옵니다. 이 매개변수를true
로 설정하면 director가 Satellite에서 언더클라우드 레지스트리로 이미지를 가져오고 오버클라우드는 언더클라우드 레지스트리에서 이미지를 가져옵니다. -
namespace
- Satellite 서버 레지스트리의 URL 및 포트입니다. Red Hat Satellite의 기본 레지스트리 포트는 443입니다. name_prefix
- 접두사는 Satellite 6 규칙을 기반으로 하며, 콘텐츠 뷰 사용 여부에 따라 달라집니다.-
콘텐츠 뷰를 사용하는 경우 구조는
[org]-[environment]-[content view]-[product]-
입니다. 예:acme-production-myosp16-osp_containers-
. -
콘텐츠 뷰를 사용하지 않는 경우 구조는
[org]-[product]-
입니다. 예:acme-osp_containers-
.
-
콘텐츠 뷰를 사용하는 경우 구조는
-
ceph_namespace
,ceph_image
,ceph_tag
- Ceph Storage를 사용하는 경우 추가 매개변수를 포함하여 Ceph Storage 컨테이너 이미지 위치를 정의합니다. 이제ceph_image
에는 Satellite별 접두사가 포함됩니다. 이 접두사는name_prefix
옵션과 동일한 값입니다.
-
다음 예제 환경 파일에는 Satellite별 매개변수가 포함되어 있습니다.
parameter_defaults: ContainerImagePrepare: - push_destination: false set: ceph_image: acme-production-myosp16_1-osp_containers-rhceph-4 ceph_namespace: satellite.example.com:443 ceph_tag: latest name_prefix: acme-production-myosp16_1-osp_containers- name_suffix: '' namespace: satellite.example.com:443 neutron_driver: null tag: '{osp_curr_ver_no_beta}' ...
Red Hat Satellite Server에 저장된 특정 컨테이너 이미지 버전을 사용하려면 set
사전에 태그
키-값 쌍을 특정 버전으로 설정합니다. 예를 들어 {osp_curr_ver_no_beta}.2 이미지 스트림을 사용하려면 set 사전에 tag: {osp_curr_ver_no_beta}.2
를 설정합니다
.
undercloud.conf
구성 파일에 containers-prepare-parameter.yaml
환경 파일을 정의해야 합니다. 그렇지 않으면 언더클라우드에서 기본값을 사용합니다.
container_images_file = /home/stack/containers-prepare-parameter.yaml