Post

[OpenShift 오픈시프트] RHOCP 4.14.15 Installation - 7. Master 노드 구성

RHOCP 4.14.15 설치 (오픈시프트 설치) - Master 노드 구성


Test Environment


Red Hat Enterprise Linux 9.2 (Plow)


1. Master 노드 생성


앞서 생성한 템플릿을 복제하여 Master 노드를 생성한다.

image-20240717162705073


master01, 02, 03 시스템을 동일한 방식으로 생성한다.

image-20240719112813626


image-20240717162759161


image-20240717162820657


image-20240717162840969


image-20240717162849091


image-20240719113214096


[설정 편집]의 [VM 옵션] > [구성 편집] 메뉴로 간다.

image-20240719113302936


image-20240717163057020

image-20240717163040984


부트스트랩 노드와 마찬가지로 매개변수 4개를 추가하고 그에 해당하는 값들을 추가한다.

master01, master02, master03은 서로 다른 ip로 설정한다.

구성 매개 변수 변수 설정값 (bootstrap 노드)
guestinfo.ignition.config.data <base64 인코딩한 master ignition 파일 (m.ign_base64) 내용>
guestinfo.ignition.config.data.encoding base64
disk.EnableUUID TRUE
guestinfo.afterburn.initrd.network-kargsmaster01ip=172.16.0.173::172.16.0.1:255.255.255.0:::none nameserver=172.16.0.171
 master02ip=172.16.0.174::172.16.0.1:255.255.255.0:::none nameserver=172.16.0.171
 master03ip=172.16.0.175::172.16.0.1:255.255.255.0:::none nameserver=172.16.0.171


image-20240717163613765


image-20240719113801684


모두 시작 버튼을 눌러 실행시킨다.

image-20240719113829049


VM이 완전히 켜지면 Bastion 서버에서 각 마스터노드 ip를 통해 SSH로 접속할 수 있다.

  • ssh core@172.16.0.173
  • ssh core@172.16.0.174
  • ssh core@172.16.0.175


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
The authenticity of host '172.16.0.173 (172.16.0.173)' can't be established.
ED25519 key fingerprint is SHA256:rUqEmUIqE2it5P4xqI6g1NNT6PQmaAG6WRLKKH93nG0.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '172.16.0.173' (ED25519) to the list of known hosts.
Red Hat Enterprise Linux CoreOS 414.92.202402261929-0
  Part of OpenShift 4.14, RHCOS is a Kubernetes native operating system
  managed by the Machine Config Operator (`clusteroperator/machine-config`).

WARNING: Direct SSH access to machines is not recommended; instead,
make configuration changes via `machineconfig` objects:
  https://docs.openshift.com/container-platform/4.14/architecture/architecture-rhcos.html

---


임시 ControlPlane 역할을 수행하는 Bootstrap 노드가 Master 노드에게 권한을 넘겨주는 과정을 Bootstrapping 이라고 하며, 이 과정이 끝나면 Bootstrap 노드의 역할은 없어지기 때문에 제거하면 된다.


Bastion 노드에서 Bootstrap 진행 상황을 모니터링 할 수 있다.

1
2
3
export KUBECONFIG=/var/www/html/ocp/auth/kubeconfig
[root@bastion auth]# oc get nodes
No resources found.


NotReady 상태로 master 노드가 인식되었다.

1
2
3
4
5
[root@bastion auth]# oc get nodes
NAME                          STATUS     ROLES                  AGE     VERSION
master01.openshift.ig.local   NotReady   control-plane,master   3m21s   v1.27.10+c79e5e2
master02.openshift.ig.local   NotReady   control-plane,master   3m24s   v1.27.10+c79e5e2
master03.openshift.ig.local   NotReady   control-plane,master   3m22s   v1.27.10+c79e5e2


기다리면 Ready 상태로 변한다.

1
2
3
4
NAME                          STATUS   ROLES                  AGE   VERSION
master01.openshift.ig.local   Ready    control-plane,master   99m   v1.27.10+c79e5e2
master02.openshift.ig.local   Ready    control-plane,master   99m   v1.27.10+c79e5e2
master03.openshift.ig.local   Ready    control-plane,master   99m   v1.27.10+c79e5e2


bootstrap-complete 명령어로 Bootstrap 리소스를 제거해도 안전하다는 메세지를 확인한다.

openshift-install wait-for bootstrap-complete --dir=/var/www/html/ocp --log-level debug

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
DEBUG OpenShift Installer 4.14.15
DEBUG Built from commit 6ee6900a509dfb4a3fd568f741e163655bd3f45c
INFO Waiting up to 20m0s (until 3:57PM KST) for the Kubernetes API at https://api.openshift.ig.local:6443...
DEBUG Loading Agent Config...
INFO API v1.27.10+c79e5e2 up
DEBUG Loading Install Config...
DEBUG   Loading SSH Key...
DEBUG   Loading Base Domain...
DEBUG     Loading Platform...
DEBUG   Loading Cluster Name...
DEBUG     Loading Base Domain...
DEBUG     Loading Platform...
DEBUG   Loading Networking...
DEBUG     Loading Platform...
DEBUG   Loading Pull Secret...
DEBUG   Loading Platform...
DEBUG Using Install Config loaded from state file
INFO Waiting up to 30m0s (until 4:07PM KST) for bootstrapping to complete...
DEBUG Bootstrap status: complete
INFO It is now safe to remove the bootstrap resources
INFO Time elapsed: 0s

INFO It is now safe to remove the bootstrap resources -> 이 메세지가 보이면 bootstrap의 권한을 master 노드로 완전히 넘기는 것이기 때문에 bootstrap 노드를 끄고 제거해도 된다는 뜻이다.


이제 bootstrap 노드를 제거하기 위해 vSphere에서 bootstrap 서버 전원을 끈다.

image-20240814154614785


우클릭을 눌러 디스크에서 삭제를 클릭한다.

image-20240814154742786

image-20240814154721183


Bastion 서버에서 Bootstrap에 해당하는 행을 주석처리 혹은 삭제해주자.

vi /etc/haproxy/haproxy.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..SKIP..
backend openshift-api-server
    balance source
    mode tcp
 #   server bootstrap 172.16.0.172:6443 check
    server master01 172.16.0.173:6443 check
    server master02 172.16.0.174:6443 check
    server master03 172.16.0.175:6443 check

frontend machine-config-server
    bind *:22623
    default_backend machine-config-server
    mode tcp
    option tcplog

backend machine-config-server
    balance source
    mode tcp
 #   server bootstrap 172.16.0.172:22623 check
    server master01 172.16.0.173:22623 check
    server master02 172.16.0.174:22623 check
    server master03 172.16.0.175:22623 check
..SKIP..


haproxy 서버를 재시작한다.

systemctl restart haproxy

systemctl status haproxy

1
Active: active (Running)


References


https://docs.openshift.com/container-platform/4.14/installing/installing_bare_metal/installing-bare-metal-network-customizations.html

https://docs.openshift.com/container-platform/4.14/installing/installing_bare_metal/installing-bare-metal.html


This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.