본문으로 건너뛰기

[OKD 4.14] Deploy OKD cluster on AWS

openshift-install로 install-config를 생성하고 OKD 4.14 Cluster를 AWS 서울 리전에 배포하는 과정과 필요한 사전 준비 사항을 정리합니다.

요약

  • openshift-install create install-config와 create cluster로 OKD 4.14 Cluster를 AWS에 배포할 수 있으며, 테스트에서는 약 38분이 걸렸습니다.
  • 사전에 AWS Credential을 추가하고 Route53에 Base Domain을 등록해야 하며, OKD의 Pull Secret은 fake auth 값을 입력하면 됩니다.
  • 설치가 끝나면 kubeadmin 계정 정보와 OKD web-console URL, kubeconfig 경로가 출력됩니다.

테스트 환경 OKD 4.14.0-0.okd-2024-01-26-175629, AWS ap-northeast-2 리전

Deploy OKD cluster on AWS

OKD 4.14 를 AWS 에 배포 테스트 내역에 대해 기록해보도록 하겠습니다.

Install openshift-install

아래 Release 에서 해당 버전에 맞는 openshift-install 를 내려 받습니다.

$ wget https://github.com/okd-project/okd/releases/download/4.14.0-0.okd-2024-01-26-175629/openshift-install-linux-4.14.0-0.okd-2024-01-26-175629.tar.gz

$ tar xzvf openshift-install-linux-4.14.0-0.okd-2024-01-26-175629.tar.gz

Deploy Cluster

아래와 같이 Cluster 배포에 필요한 install-config 를 생성합니다.

$ mkdir ./okd

$ ./openshift-install create install-config --dir ./okd
? SSH Public Key /root/.ssh/id_rsa.pub                        <<<---!!! okd node 에 사용될 ssh public key
? Platform aws               <<<---!!! okd 가 설치될 환경 "AWS"
INFO Credentials loaded from the "default" profile in file "/root/.aws/credentials"    <<<---!!! 사전에 AWS Credentials 추가 진행 ($ aws configure)
? Region ap-northeast-2      <<<---!!! Region 선택
? Base Domain chhanz.xyz     <<<---!!! Route53 등록된 base domain 
? Cluster Name okd           <<<---!!! cluster name
? Pull Secret [? for help] ******************************************
INFO Install-Config created in: okd

위와 같이 install-config 에 필요한 정보를 추가합니다.
최소 OKD 를 AWS 에 배포하기 위해서는 사전에 AWS Credential 추가, Route53 에 사용할 Base domain 을 등록해야합니다.
또한 Pull Secret 은 OKD 의 경우, {"auths":{"fake":{"auth":"aWQ6cGFzcwo="}}} 를 입력하면 됩니다.
해당 부분은 Red Hat OpenShift 를 배포하는 경우, Red Hat 의 Repository 접근이 필요할 때 사용됩니다.

생성된 install-config 는 아래와 같습니다.

$ cat ./okd/install-config.yaml
additionalTrustBundlePolicy: Proxyonly
apiVersion: v1
baseDomain: chhanz.xyz
compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform: {}
  replicas: 3
controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  platform: {}
  replicas: 3
metadata:
  creationTimestamp: null
  name: okd
networking:
  clusterNetwork:
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  machineNetwork:
  - cidr: 10.0.0.0/16
  networkType: OVNKubernetes
  serviceNetwork:
  - 172.30.0.0/16
platform:
  aws:
    region: ap-northeast-2
publish: External
pullSecret: '{"auths":{"fake":{"auth":"aWQ6cGFzcwo="}}}'
sshKey: |
  ssh-rsa AAAAB3NzEXAMPLE

위와 같이 생성된 install-config 를 이용하여 Cluster 배포를 시작합니다.

$ ./openshift-install create cluster --dir ./okd
...
INFO To access the cluster as the system:admin user when using 'oc', run 'export KUBECONFIG=/root/okd/auth/kubeconfig'
INFO Access the OpenShift web-console here: https://console-openshift-console.apps.okd.chhanz.xyz
INFO Login to the console with user: "kubeadmin", and password: "*****-*****-*****-*****-*****"
DEBUG Time elapsed per stage:
DEBUG                     cluster: 5m8s
DEBUG                   bootstrap: 50s
DEBUG          Bootstrap Complete: 16m30s
DEBUG                         API: 6m13s
DEBUG           Bootstrap Destroy: 2m20s
DEBUG Cluster Operators Available: 12m10s
DEBUG    Cluster Operators Stable: 54s
INFO Time elapsed: 37m58s

위와 같이 kubeadmin 계정 정보 및 OKD web-console URL 정보가 나오면 설치가 완료된 것입니다.

이후 OKD Cluster 초기 작업은 아래 참고 자료를 이용하여 설정을 수행합니다.

참고 자료

자주 묻는 질문

OKD를 AWS에 설치할 때 Pull Secret에는 무엇을 입력하나요?

OKD의 경우 {"auths":{"fake":{"auth":"aWQ6cGFzcwo="}}}를 입력하면 됩니다. Pull Secret은 Red Hat OpenShift를 배포할 때 Red Hat의 Repository 접근에 사용됩니다.

OKD를 AWS에 배포하기 전에 준비해야 할 것은 무엇인가요?

aws configure로 AWS Credential을 추가하고 Route53에 사용할 Base Domain을 등록해야 합니다. OKD 노드에 사용할 SSH Public Key도 install-config 생성 시 지정합니다.

openshift-install로 생성한 install-config의 기본 노드 구성은 어떻게 되나요?

글에서 생성된 install-config.yaml 기준으로 master 3대, worker 3대이며 networkType은 OVNKubernetes입니다.

OKD 설치가 완료되었는지 어떻게 알 수 있나요?

openshift-install create cluster 출력에 kubeadmin 계정 정보와 OKD web-console URL이 나오면 설치가 완료된 것입니다.