16.4.2. 단일 노드 OpenShift에 대한 이미지 기반 배포에 관하여
openshift-install 프로그램을 사용하여 구성 ISO를 수동으로 생성할 수 있습니다. 배포를 완료하려면 사전 설치된 대상 호스트에 구성 ISO를 첨부하세요.
16.4.2.1. openshift-install 프로그램을 사용하여 단일 노드 OpenShift 클러스터 배포 링크 복사링크가 클립보드에 복사되었습니다!
openshift-install 프로그램을 사용하면 이미지 기반 설치로 사전 설치한 호스트를 구성하고 배포할 수 있습니다. 사이트별 세부 정보로 대상 호스트를 구성하려면 다음 리소스를 만들어야 합니다.
-
install-config.yaml설치 매니페스트 -
image-based-config.yaml매니페스트
openshift-install 프로그램은 이러한 리소스를 사용하여 사전 설치된 대상 호스트에 첨부하여 배포를 완료하는 구성 ISO를 생성합니다.
image-based-config.yaml 매니페스트 사양에 대한 자세한 내용은 "image-based-config.yaml 매니페스트에 대한 참조 사양"을 참조하세요.
사전 요구 사항
- 이미지 기반 설치를 사용하여 단일 노드 OpenShift가 있는 호스트를 사전 설치했습니다.
-
openshift-install프로그램의 최신 버전을 다운로드했습니다. - 풀 리퀘스트를 인증하기 위해 풀 시크릿을 생성했습니다. 자세한 내용은 "이미지 풀 시크릿 사용"을 참조하세요.
프로세스
다음을 실행하여 작업 디렉토리를 만듭니다.
$ mkdir ibi-config-iso-workdir1 - 1
ibi-config-iso-workdir을작업 디렉토리의 이름으로 바꾸세요.
설치 매니페스트를 만듭니다.
install-config매니페스트를 정의하는 YAML 파일을 만듭니다.install-config.yaml파일 예시apiVersion: v1 metadata: name: sno-cluster-name baseDomain: host.example.com compute: - architecture: amd64 hyperthreading: Enabled name: worker replicas: 0 controlPlane: architecture: amd64 hyperthreading: Enabled name: master replicas: 1 networking: machineNetwork: - cidr: 192.168.200.0/24 platform: none: {} fips: false cpuPartitioningMode: "AllNodes" pullSecret: '{"auths":{"<your_pull_secret>"}}}' sshKey: 'ssh-rsa <your_ssh_pub_key>'중요클러스터 배포에 프록시 구성이 필요한 경우 다음을 수행해야 합니다.
- 프록시 구성을 특징으로 하는 시드 클러스터에서 시드 이미지를 만듭니다. 프록시 구성이 일치할 필요는 없습니다.
-
설치 매니페스트에서
machineNetwork필드를 구성합니다.
- 작업 디렉토리에 파일을 저장합니다.
선택 사항입니다. 다음 명령을 실행하여 작업 디렉토리에 구성 템플릿을 만듭니다.
$ openshift-install image-based create config-template --dir ibi-config-iso-workdir/출력 예
INFO Config-Template created in: ibi-config-iso-workdir이 명령은 작업 디렉토리에
image-based-config.yaml구성 템플릿을 생성합니다.# # Note: This is a sample ImageBasedConfig file showing # which fields are available to aid you in creating your # own image-based-config.yaml file. # apiVersion: v1beta1 kind: ImageBasedConfig metadata: name: example-image-based-config additionalNTPSources: - 0.rhel.pool.ntp.org - 1.rhel.pool.ntp.org hostname: change-to-hostname releaseRegistry: quay.io # networkConfig 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-config.yaml파일 예시# # Note: This is a sample ImageBasedConfig file showing # which fields are available to aid you in creating your # own image-based-config.yaml file. # apiVersion: v1beta1 kind: ImageBasedConfig metadata: name: sno-cluster-name additionalNTPSources: - 0.rhel.pool.ntp.org - 1.rhel.pool.ntp.org hostname: host.example.com releaseRegistry: quay.io # networkConfig contains the network configuration for the host in NMState format. # See https://nmstate.io/examples.html for examples. 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 config-image --dir ibi-config-iso-workdir/출력 예
INFO Adding NMConnection file <ens1f0.nmconnection> INFO Consuming Install Config from target directory INFO Consuming Image-based Config ISO configuration from target directory INFO Config-Image created in: ibi-config-iso-workdir/auth작업 디렉토리에서 출력을 확인하세요.
출력 예
ibi-config-iso-workdir/ ├── auth │ ├── kubeadmin-password │ └── kubeconfig └── imagebasedconfig.iso-
원하는 방법을 사용하여
imagebasedconfig.iso를 사전 설치된 호스트에 연결하고 호스트를 다시 시작하여 구성 프로세스를 완료하고 클러스터를 배포합니다.
검증
호스트에서 구성 프로세스가 완료되면 클러스터에 액세스하여 상태를 확인합니다.
다음 명령을 실행하여
kubeconfig환경 변수를 kubeconfig 파일에 내보냅니다.$ export KUBECONFIG=ibi-config-iso-workdir/auth/kubeconfig다음 명령을 실행하여 클러스터가 응답하는지 확인하세요.
$ oc get nodes출력 예
NAME STATUS ROLES AGE VERSION node/sno-cluster-name.host.example.com Ready control-plane,master 5h15m v1.32.3
16.4.2.1.1. image-based-config.yaml 매니페스트에 대한 참조 사양 링크 복사링크가 클립보드에 복사되었습니다!
다음 내용은 image-based-config.yaml 매니페스트에 대한 사양을 설명합니다.
openshift-install 프로그램은 image-based-config.yaml 매니페스트를 사용하여 단일 노드 OpenShift의 이미지 기반 배포를 위한 사이트별 구성 ISO를 만듭니다.
| 사양 | 유형 | 설명 |
|---|---|---|
|
|
| 단일 노드 OpenShift 클러스터의 노드 이름을 정의합니다. |
| 사양 | 유형 | 설명 |
|---|---|---|
|
|
| 호스트에 대한 네트워킹 구성을 지정합니다(예: networkConfig:
interfaces:
- name: ens1f0
type: ethernet
state: up
...
정적 네트워킹이 필요한 경우 라이브 설치 ISO를 만드는 호스트에 중요 인터페이스 이름은 운영 체제에 표시되는 실제 NIC 이름과 일치해야 합니다. |
|
|
| 모든 클러스터 호스트의 NTP 소스 목록을 지정합니다. 이러한 NTP 소스는 클러스터의 기존 NTP 소스에 추가됩니다. NTP 소스에 호스트 이름이나 IP 주소를 사용할 수 있습니다. |
|
|
| 시드 클러스터의 릴리스 이미지에 사용한 컨테이너 이미지 레지스트리를 지정합니다. |
|
|
| 단일 노드 OpenShift 노드에 대한 사용자 정의 노드 레이블을 지정합니다(예: nodeLabels:
node-role.kubernetes.io/edge: true
environment: production
|