3.11. 컨테이너 이미지용 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/rhosp15-rhel8" | awk '{ print $2 }' | grep -v beta | sed "s/registry.redhat.io\///g" | tail -n+2 > satellite_images
-
satellite_images_names
파일을 Satellite 6hammer
툴이 포함된 시스템으로 복사합니다. 또는 Hammer CLI 가이드의 지침을 사용하여hammer
툴을 언더클라우드에 설치합니다. 다음
hammer
명령을 실행하여 Satellite 조직에 새 제품(OSP15 Containers
)을 생성합니다.$ hammer product create \ --organization "ACME" \ --name "OSP15 Containers"
이 사용자 지정 제품에 이미지를 저장합니다.
제품에 기본 컨테이너 이미지를 추가합니다.
$ hammer repository create \ --organization "ACME" \ --product "OSP15 Containers" \ --content-type docker \ --url https://registry.redhat.io \ --docker-upstream-name rhosp15-rhel8/openstack-base \ --upstream-username USERNAME \ --upstream-password PASSWORD \ --name base
satellite_images
파일에서 오버클라우드 컨테이너 이미지를 추가합니다.$ while read IMAGE; do \ IMAGENAME=$(echo $IMAGE | cut -d"/" -f2 | sed "s/openstack-//g" | sed "s/:.*//g") ; \ hammer repository create \ --organization "ACME" \ --product "OSP15 Containers" \ --content-type docker \ --url https://registry.redhat.io \ --docker-upstream-name $IMAGE \ --upstream-username USERNAME \ --upstream-password PASSWORD \ --name $IMAGENAME ; done < satellite_images_names
Ceph Storage 4 컨테이너 이미지를 추가합니다.
$ hammer repository create \ --organization "ACME" \ --product "OSP15 Containers" \ --content-type docker \ --url https://registry.redhat.io \ --docker-upstream-name rhceph-beta/rhceph-4-rhel8 \ --upstream-username USERNAME \ --upstream-password PASSWORD \ --name rhceph-4-rhel8
컨테이너 이미지를 동기화합니다.
$ hammer product synchronize \ --organization "ACME" \ --name "OSP15 Containers"
Satellite 서버가 동기화를 완료할 때까지 기다립니다.
참고설정에 따라
hammer
에서 Satellite 서버 사용자 이름과 암호가 필요할 수 있습니다.hammer
를 설정한 후 설정 파일을 사용하여 자동으로 로그인할 수 있습니다. 자세한 내용은 Hammer CLI Guide의 "Authentication" 섹션을 참조하십시오.-
Satellite 6 서버에서 콘텐츠 뷰를 사용하는 경우, 새로운 콘텐츠 뷰 버전을 생성하여 이미지를 통합하고 애플리케이션 라이프사이클의 환경에 따라 승격합니다. 이 과정은 대체로 애플리케이션 라이프사이클을 구조화한 방법에 따라 달라집니다. 예를 들어 라이프사이클에
production
이라는 환경이 있고, 해당 환경에서 컨테이너 이미지를 사용할 수 있도록 하려면 컨테이너 이미지가 포함된 콘텐츠 뷰를 생성하고 해당 콘텐츠 뷰를production
환경으로 승격합니다. 자세한 내용은 "Managing Container Images with Content Views"를 참조하십시오. base
이미지에 사용 가능한 태그를 확인합니다.$ hammer docker tag list --repository "base" \ --organization "ACME" \ --environment "production" \ --content-view "myosp15" \ --product "OSP15 Containers"
이 명령을 수행하면 OpenStack Platform 컨테이너 이미지의 태그가 특정 환경에 대한 콘텐츠 뷰에 표시됩니다.
언더클라우드로 돌아가서 Satellite 서버를 소스로 사용하여 이미지 준비에 필요한 기본 환경 파일을 생성합니다. 다음 예제 명령을 실행하여 환경 파일을 생성합니다.
(undercloud) $ openstack tripleo container image prepare default \ --output-env-file containers-prepare-parameter.yaml
-
--output-env-file
은 환경 파일 이름입니다. 이 파일의 콘텐츠에는 언더클라우드의 컨테이너 이미지를 준비하는 데 필요한 매개변수가 포함되어 있습니다. 이 경우 파일 이름은containers-prepare-parameter.yaml
입니다.
-
containers-prepare-parameter.yaml
파일을 편집하여 다음 매개변수를 수정합니다.-
namespace
- Satellite 서버 레지스트리의 URL 및 포트입니다. Red Hat Satellite의 기본 레지스트리 포트는 5000입니다. name_prefix
- 접두사는 Satellite 6 규칙을 기반으로 하며, 콘텐츠 뷰 사용 여부에 따라 달라집니다.-
콘텐츠 뷰를 사용하는 경우 구조는
[org]-[environment]-[content view]-[product]-
입니다. 예를 들면acme-production-myosp15-osp15_containers-
입니다. -
콘텐츠 뷰를 사용하지 않는 경우 구조는
[org]-[product]-
입니다. 예를 들면acme-osp15_containers-
입니다.
-
콘텐츠 뷰를 사용하는 경우 구조는
-
ceph_namespace
,ceph_image
,ceph_tag
- Ceph Storage를 사용하는 경우 추가 매개변수를 포함하여 Ceph Storage 컨테이너 이미지 위치를 정의합니다. 이제ceph_image
에는 Satellite별 접두사가 포함됩니다. 이 접두사는name_prefix
옵션과 동일한 값입니다.
-
다음 예제 환경 파일에는 Satellite별 매개변수가 포함되어 있습니다.
parameter_defaults: ContainerImagePrepare: - push_destination: true set: ceph_image: acme-production-myosp15-osp15_containers-rhceph-4 ceph_namespace: satellite.example.com:5000 ceph_tag: latest name_prefix: acme-production-myosp15-osp15_containers- name_suffix: '' namespace: satellite.example.com:5000 neutron_driver: null tag: latest ... tag_from_label: '{version}-{release}'
언더클라우드 및 오버클라우드를 모두 생성하는 경우 이 환경 파일을 사용합니다.