RedHat/Openshift

Openshift 구축해보기 - 1 (DNS, Haproxy 설정)

황동리 2023. 12. 6. 09:41
반응형

Openshift란?

RedHat에서 개발한 PaaS(Platform as a Service) 솔루션 이다.
도커와 쿠버네티스를 제공하는 컨테이너 애플리케이션 플랫폼이고, enterprise-grade의 다양한 부가 기능이 추가되었고, Web-UI, 소스 빌드 자동화, 라우터 등을 사용할 수 있다.

구축에 앞서 아키텍처 이다.

아래의 그림과 같이 구축을 할 예정이다.

bastion 서버에 DNS, Haproxy를 구성해주고 포트에 따라 로드밸런싱을 해줄 예정이다.

 

 

위 표대로 bastion, master, worker 노드들을 구성했습니다.

 


1. bastion 설치 및 local repo 설정

1-1 cdrom에 rhel 마운트

1-2 rhel.repo 로컬 레포지토리 생성

1-3 로컬 레포지토지 경로 지정

 

2. httpd, haproxy, DNS 패키지 설치 및 설정

2-1 httpd, Haproxy, DNS 패키지 설치

명령어 : yum install -y httpd bind bind-utils bind-libs haproxy
2-2 httpd 기본 포트를 80 -> 8080 으로 변환

2-3 /etc/named.conf 파일에서 박스 친 곳을 any; 로 변경

2-4 named.rfc1912zones 설정

example.com은 정방향 DNS, 10.10.10.in-addr.arpa는 역방향 DNS file에는 zone 파일의 경로를 적어준다.

 

2-5 zone 파일 구성

정방향 zone 파일, 역방향 zone 파일
2-6 haproxy 설정

haproxy.cfg 설정파일 내용

global
        log 127.0.0.1 local2
        pidfile /var/run/haproxy.pid
        maxconn 4000
        daemon
defaults
        mode http
        log global
        option dontlognull
        option http-server-close
        option redispatch
        retries 3
        timeout http-request 10s
        timeout queue 1m
        timeout connect 10s
        timeout client 1m
        timeout server 1m
        timeout http-keep-alive 10s
        timeout check 10s
        maxconn 3000
frontend stats
        bind *:1936
        mode http
        log global
        maxconn 10
        stats enable
        stats hide-version
        stats refresh 30s
        stats show-node
        stats show-desc Stats for ocp5 cluster
        stats auth admin:ocp5
        stats uri /stats
listen api-server-6443
        bind *:6443
        mode tcp
        server master0 master0.ocp5.example.com:6443 check inter 1s
        server master1 master1.ocp5.example.com:6443 check inter 1s
        server master2 master2.ocp5.example.com:6443 check inter 1s
listen machine-config-server-22623
        bind *:22623
        mode tcp
        server master0 master0.ocp5.example.com:22623 check inter 1s
        server master1 master1.ocp5.example.com:22623 check inter 1s
        server master2 master2.ocp5.example.com:22623 check inter 1s
listen ingress-router-443
        bind *:443
        mode tcp
        balance source
        server worker0 worker0.ocp5.example.com:443 check inter 1s
        server worker1 worker1.ocp5.example.com:443 check inter 1s
listen ingress-router-80
        bind *:80
        mode tcp
        balance source
        server worker0 worker0.ocp5.example.com:80 check inter 1s
        server worker1 worker1.ocp5.example.com:80 check inter 1s

 

 

※ haproxy 오류

 

※ haproxy 오류 해결

 

후에 계속...

반응형