17.3. 이미지 기반 설치를 사용하여 단일 노드 OpenShift 사전 설치
openshift-install 프로그램을 사용하여 베어 메탈 호스트에 단일 노드 OpenShift를 사전 설치하기 위한 라이브 설치 ISO를 생성합니다. 설치 프로그램을 다운로드하는 방법에 대한 자세한 내용은 "추가 리소스" 섹션의 "설치 프로세스"를 참조하십시오.
설치 프로그램은 시드 이미지 URL 및 시드 이미지 릴리스 버전 및 설치 프로세스에 사용할 디스크와 같은 기타 입력을 사용하여 라이브 설치 ISO를 생성합니다. 그런 다음 라이브 설치 ISO를 사용하여 호스트를 시작하여 사전 설치를 시작할 수 있습니다. 사전 설치가 완료되면 호스트는 최종 사이트별 구성 및 배포를 위해 원격 사이트에 제공됩니다.
다음은 이미지 기반 설치를 사용하여 단일 노드 OpenShift 클러스터를 사전 설치하는 고급 단계입니다.
- 시드 이미지를 생성합니다.
-
openshift-install설치 프로그램을 사용하여 라이브 설치 ISO를 만듭니다. - 라이브 설치 ISO를 사용하여 호스트를 부팅하여 호스트를 사전 설치합니다.
17.3.1. 단일 노드 OpenShift 이미지 기반 설치를 위한 라이브 설치 ISO 생성 링크 복사링크가 클립보드에 복사되었습니다!
openshift-install 프로그램을 사용하여 라이브 설치 ISO에 단일 노드 OpenShift 시드 이미지 URL 및 기타 설치 아티팩트를 포함할 수 있습니다.
image-based-installation-config.yaml 매니페스트의 사양에 대한 자세한 내용은 " image-based-installation-config.yaml 매니페스트에 대한 참조 사양" 섹션을 참조하십시오.
사전 요구 사항
- 단일 노드 OpenShift 시드 클러스터에서 시드 이미지를 생성했습니다.
-
openshift-install프로그램을 다운로드했습니다.openshift-install프로그램의 버전은 시드 이미지의 OpenShift Container Platform 버전과 일치해야 합니다. - 대상 호스트는 시드 이미지 URL 및 기타 모든 설치 아티팩트에 대한 네트워크 액세스 권한이 있습니다.
-
정적 네트워킹이 필요한 경우 라이브 설치 ISO를 생성하는 호스트에
nmstatectl라이브러리를 설치해야 합니다.
프로세스
라이브 설치 ISO를 생성하고 단일 노드 OpenShift 시드 이미지 URL 및 기타 설치 아티팩트를 포함합니다.
다음을 실행하여 작업 디렉터리를 생성합니다.
$ mkdir <working_directory>여기서
<working_directory>는 작업 디렉터리의 이름입니다(예:ibi-iso-workdir).선택 사항:
ImageBasedInstallationConfig리소스를 구성할 때 참조로 사용할 설치 구성 템플릿을 생성합니다.$ openshift-install image-based create image-config-template --dir <working_directory>여기서
<working_directory>는 작업 디렉터리의 이름입니다(예:ibi-iso-workdir). 작업 디렉터리를 지정하지 않으면 명령에서 현재 디렉터리를 사용합니다.출력 예:
INFO Image-Config-Template created in: ibi-iso-workdir
+ 명령은 대상 디렉터리에 image-based-installation-config.yaml 설치 구성 템플릿을 생성합니다.
+
#
# Note: This is a sample ImageBasedInstallationConfig file showing
# which fields are available to aid you in creating your
# own image-based-installation-config.yaml file.
#
apiVersion: v1beta1
kind: ImageBasedInstallationConfig
metadata:
name: example-image-based-installation-config
# The following fields are required
seedImage: quay.io/openshift-kni/seed-image:4.22.0
seedVersion: 4.22.0
installationDisk: /dev/vda
pullSecret: '<your_pull_secret>'
# networkConfig is optional and contains the network configuration for the host in NMState format.
# See https://nmstate.io/examples.html for examples.
# networkConfig:
# interfaces:
# - name: eth0
# type: ethernet
# state: up
# mac-address: 00:00:00:00:00:00
# ipv4:
# enabled: true
# address:
# - ip: 192.168.122.2
# prefix-length: 23
# dhcp: false
설치 구성 파일을 편집합니다.
image-based-installation-config.yaml파일의 예:
apiVersion: v1beta1
kind: ImageBasedInstallationConfig
metadata:
name: example-image-based-installation-config
seedImage: quay.io/repo-id/seed:latest
seedVersion: "4.22.0"
extraPartitionStart: "-240G"
installationDisk: /dev/disk/by-id/wwn-0x62c...
sshKey: 'ssh-ed25519 AAAA...'
pullSecret: '{"auths": ...}'
networkConfig:
interfaces:
- name: ens1f0
type: ethernet
state: up
ipv4:
enabled: true
dhcp: false
auto-dns: false
address:
- ip: 192.168.200.25
prefix-length: 24
ipv6:
enabled: false
dns-resolver:
config:
server:
- 192.168.15.47
- 192.168.15.48
routes:
config:
- destination: 0.0.0.0/0
metric: 150
next-hop-address: 192.168.200.254
next-hop-interface: ens1f0
다음 명령을 실행하여 라이브 설치 ISO를 생성합니다.
$ openshift-install image-based create image --dir ibi-iso-workdir출력 예:
INFO Consuming Image-based Installation ISO Config from target directory
INFO Creating Image-based Installation ISO with embedded ignition
검증
작업 디렉터리의 출력을 확인합니다.
ibi-iso-workdir/ └── rhcos-ibi.iso
17.3.1.1. 대상 호스트에서 추가 파티션 구성 링크 복사링크가 클립보드에 복사되었습니다!
설치 ISO는 이미지 기반 설치 프로세스의 일부로 /var/lib/containers 디렉터리의 파티션을 생성합니다.
coreosInstallerArgs 사양을 사용하여 추가 파티션을 생성할 수 있습니다. 예를 들어 적절한 스토리지가 있는 하드 디스크에서 LVM(Logical Volume Manager) 스토리지와 같은 스토리지 옵션에 대한 추가 파티션이 필요할 수 있습니다.
사전 캐시된 이미지에 적절한 디스크 공간을 보장하기 위해 /var/lib/containers 파티션에는 최소 500GB가 필요합니다. /var/lib/containers 의 파티션보다 큰 시작 위치가 있는 추가 파티션을 생성해야 합니다.
프로세스
image-based-installation-config.yaml파일을 편집하여 추가 파티션을 구성합니다.image-based-installation-config.yaml파일의 예:
apiVersion: v1beta1
kind: ImageBasedInstallationConfig
metadata:
name: example-extra-partition
seedImage: quay.io/repo-id/seed:latest
seedVersion: "4.22.0"
installationDisk: /dev/sda
pullSecret: '{"auths": ...}'
# ...
skipDiskCleanup: <skip_disk_cleanup>
coreosInstallerArgs:
- "--save-partindex"
- "<partition_index>"
ignitionConfigOverride: |
{
"ignition": {
"version": "3.2.0"
},
"storage": {
"disks": [
{
"device": "<installation_disk>",
"partitions": [
{
"label": "<partition_label>",
"number": <partition_number>,
"sizeMiB": <partition_size>,
"startMiB": <starting_position>
}
]
}
]
}
}
+ 위치:
+ <skip_disk_cleanup > :: 설치 프로세스 중에 디스크 형식을 건너뛸지 여부를 지정합니다. 건너뛰려면 true 로 설정합니다. "--save-partindex":: 파티션을 유지하기 위해 인수를 지정합니다. <partition_index > :: 보존할 추가 파티션을 지정합니다. 라이브 설치 ISO에는 5개의 파티션이 필요합니다. 5보다 큰 숫자를 설정합니다 (예: 6 ). <installation_disk > : 대상 호스트에 설치 디스크를 지정합니다(예: /dev/sda ). <partition_label > :: 파티션의 레이블을 지정합니다(예: storage ). <partition_number > :: 파티션의 번호를 지정합니다(예: 6 ). <partition_size > :: 파티션 크기를 MiB 단위로 지정합니다(예: 380000). <starting_position > :: 추가 파티션의 경우 디스크의 시작 위치를 MiB로 지정합니다. /var/lib/containers 의 파티션보다 큰 시작점을 지정해야 합니다(예: 500000 ).
검증
라이브 설치 ISO를 사용하여 호스트 사전 설치를 완료하면 대상 호스트에 로그인하고 다음 명령을 실행하여 파티션을 확인합니다.
$ lsblk출력 예:
sda 8:0 0 140G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 127M 0 part
├─sda3 8:3 0 384M 0 part /var/mnt/boot
├─sda4 8:4 0 120G 0 part /var/mnt
├─sda5 8:5 0 500G 0 part /var/lib/containers
└─sda6 8:6 0 380G 0 part