INTRO
RHOCP 설치를 위한 설정 파일(install-config.yaml)와 Ignition 파일을 생성하는 단계입니다.
설치 단계에 대한 자세한 내용은 아래의 문서를 참고 바랍니다.
Installing a user-provisioned bare metal cluster on a restricted network - Installing on bare metal | Installing | OpenShift Con
alibabacloud, aws, azure, gcp, ibmcloud, nutanix, openstack, ovirt, powervs, vsphere, or {}
docs.openshift.com
Install config 파일 생성 (Bastion1 서버에서 진행)
Bastion1, Bastion2 아무 서버에서 진행해도 상관 없지만 쉽게 기억하기 위해서 Bastion1 서버에서 진행하였습니다.
Install config 생성시 필요한 SSH key를 생성합니다.
# echo | ssh-keygen -t rsa -b 4096 -N ''
Install config를 작성합니다.
Parameter | 설명 | 적용 값 |
apiVersion | API 버전을 정의하며 현재 버전은 v1 | v1 |
baseDomain | 클러스터에 사용하는 도메인 | example.com |
metadata.name | 클러스터 이름을 정의 (clustername.basedomain) | ocp4 |
pullSecret | 컨테이너 이미지 미러링하기 위해 사용되는 RedHat에서 발급한 auth + Private Registry auth | # cat ~/ocp/pull_secret/registry-secret.json |jq -c . |
ssgKey | SSH Public key | # cat /root/.ssh/id_rsa.pub |
networking.clusterNetwork.cidr | Pod의 CIDR을 정의 | 10.128.0.0/16 |
networking.clusterNetwork.hostPrefix | 각 노드에 할당할 서브넷을 정의 | 23 |
networking.serviceNetwork | 서비스 CIDR을 정의 | 172.30.0.0/16 |
additionalTrustBundle | CA 인증서 추가 (설치시에는 Private Registry CA 사용) | # cat /etc/pki/ca-trust/source/anchors/harbor.example.com.crt |
controlPlane.hyperthreading | - Control Plane(Master 서버)의 Hyperthreading 기능 설정 여부 - Disable시 성능 저하 |
Enabled |
compute.hyperthreading | - Compute node(Worker 서버)의 Hyperthreading 기능 설정 여부 - Disable시 성능 저하 |
Enabled |
compute.replicas | - 프로비저닝할 Compute node 수 (기본값: 3) - 설치하면서 join할 예정이기 때문에 이 글에서는 0 |
0 |
imageContentSources | - 이미지 콘텐츠의 소스 및 Repository를 정의 - mirror를 설정하여 source의 image는 Private Registry에서 Pulling할 수 있게 설정 |
mirror |
# mkdir -p /root/ocp/config
# cat << EOF > /root/ocp/config/install-config.yaml
apiVersion: v1
baseDomain: example.com
compute:
- hyperthreading: Enabled
name: worker
replicas: 0
controlPlane:
hyperthreading: Enabled
name: master
replicas: 3
metadata:
name: ocp4
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
networkType: OVNKubernetes
serviceNetwork:
- 172.30.0.0/16
platform:
none: {}
fips: false
pullSecret: '{"auths":{"harbor.example.com:443":{"auth":"...(생략)="}}}'
sshKey: 'ssh-rsa ...(생략)== root@bastion1.ocp4.example.com'
imageContentSources:
- mirrors:
- harbor.example.com:443/ocp4/openshift4
source: quay.io/openshift-release-dev/ocp-release
- mirrors:
- harbor.example.com:443/ocp4/openshift4
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
EOF
additionalTrustBundle에 Private Registry(Harbor) CA 인증서의 내용을 추가합니다. YAML 파일의 문법상 두번의 띄어쓰기가 있어야 되므로 sed 명령을 이용해서 기입하려고 합니다.
# sed -e 's/^/ /' /etc/pki/ca-trust/source/anchors/harbor.example.com.crt >> /root/ocp/config/install-config.yaml
# cat /root/ocp/config/install-config.yaml
apiVersion: v1
baseDomain: example.com
compute:
- hyperthreading: Enabled
name: worker
replicas: 0
controlPlane:
hyperthreading: Enabled
name: master
replicas: 3
metadata:
name: ocp4
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
networkType: OVNKubernetes
serviceNetwork:
- 172.30.0.0/16
platform:
none: {}
fips: false
pullSecret: '{"auths":{"harbor.example.com:443":{"auth":"...(생략)="}}}'
sshKey: 'ssh-rsa ...(생략)== root@bastion1.ocp4.example.com'
imageContentSources:
- mirrors:
- harbor.example.com:443/ocp4/openshift4
source: quay.io/openshift-release-dev/ocp-release
- mirrors:
- harbor.example.com:443/ocp4/openshift4
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
additionalTrustBundle: |
-----BEGIN CERTIFICATE-----
..(생략)
-----END CERTIFICATE-----
openshift-install 명령어를 이용해 manifests를 만들면 install-config.yaml 내용이 사라지기 때문에 manifests를 만들기 전에 config 디렉토리를 복사해야됩니다.
# cp -a /root/ocp/config /root/ocp/config_bak
openshift-install 명령어를 이용해 manifests를 만듭니다.
# openshift-install create manifests --dir /root/ocp/config
# ls -l /root/ocp/config
total 8
drwxr-x--- 2 root root 4096 Jul 25 14:34 manifests
drwxr-x--- 2 root root 4096 Jul 25 14:34 openshift
ignition 파일을 생성하기 위해 아래의 명령을 수행합니다.
ignition 파일을 생성한 후 24시간 이내에 클러스터 구축을 끝내야 합니다. 그렇지 않으면 ignition 파일을 다시 생성하고 클러스터 구축을 다시 해야되는 상황이 벌어집니다.
# openshift-install create ignition-configs --dir /root/ocp/config
# chmod 755 /root/ocp/config/*.ign
# ls -l /root/ocp/config
total 296
drwxr-x--- 2 root root 50 Jul 25 14:38 auth
-rwxr-xr-x 1 root root 287467 Jul 25 14:38 bootstrap.ign
-rwxr-xr-x 1 root root 1718 Jul 25 14:38 master.ign
-rw-r----- 1 root root 96 Jul 25 14:38 metadata.json
-rwxr-xr-x 1 root root 1718 Jul 25 14:38 worker.ign
Ignition 파일을 HTTP 서버의 DocumentRoot (/var/www/html)로 이동시킵니다.
이 글에서는 Bastion1 서버에 구축되어 있어서 cp 명령을 이용하여 파일을 복사합니다.
# mkdir -p /var/www/html/ign
# cp -a /root/ocp/config/*.ign /var/www/html/ign
'Linux > OpenShift' 카테고리의 다른 글
RHOCP) RBAC이란? (Rules, Roles 포함) (0) | 2023.07.26 |
---|---|
RHOCP Installation (9) - OCP 클러스터 설치 (1) | 2023.07.25 |
RHOCP Installation (7) - Cluster Image Mirroring (0) | 2023.07.24 |
RHOCP Installation (6) - HAProxy + KeepAlived 이중화 구성 (0) | 2023.07.23 |
RHOCP Installation (5) - DNS 서버 구축 및 이중화 (0) | 2023.07.22 |