CentOS Stream 8
Sponsored Link

OKD 4 : Install #22022/04/19

 
Install OKD 4 that is the upstream version of Red Hat OpenShift 4.
This example is based on the environment like follows.
--------------+----------------+-----------------+--------------
              |10.0.0.25       |                 |10.0.0.24
+-------------+-------------+  |  +--------------+-------------+
|   [mgr.okd4.srv.world]    |  |  | [bootstrap.okd4.srv.world] |
|        Manager Node       |  |  |       Bootstrap Node       |
|           DNS             |  |  |                            |
|          Nginx            |  |  |                            |
+---------------------------+  |  +----------------------------+
                               |
--------------+----------------+-----------------+--------------
              |10.0.0.40       |                 |10.0.0.41
+-------------+-------------+  |  +--------------+-------------+
| [master-0.okd4.srv.world] |  |  |  [master-1.okd4.srv.world] |
|      Control Plane#1      |  |  |      Control Plane#2       | 
|                           |  |  |                            |
|                           |  |  |                            |
+---------------------------+  |  +----------------------------+
                               |
--------------+----------------+
              |10.0.0.42
+-------------+-------------+
| [master-2.okd4.srv.world] |
|      Control Plane#3      |
|                           |
|                           |
+---------------------------+

  The system minimum requirements are follows. (by official doc)

  * Bootstrap Node      ⇒ 4 CPU, 16 GB RAM, 100 GB Storage, Fedora CoreOS
  * Control Plane Node  ⇒ 4 CPU, 16 GB RAM, 100 GB Storage, Fedora CoreOS
  * Compute Node        ⇒ 2 CPU,  8 GB RAM, 100 GB Storage, Fedora CoreOS

 
* Bootstrap Node is needed only when bootstraping cluster.
 
Configure Manager Node first like here, next, Create ignition file on Manager Node like follows.
[1]
Download Pull Secret from the RedHat officila site below.
It needs RedHat account to login there.
⇒ https://cloud.redhat.com/openshift/create/local
[2] Create ignition file.
# download OpenShift client
# make sure the latest version ⇒ https://github.com/openshift/okd/releases/

[root@mgr ~]#
wget https://github.com/openshift/okd/releases/download/4.10.0-0.okd-2022-03-07-131213/openshift-client-linux-4.10.0-0.okd-2022-03-07-131213.tar.gz \ https://github.com/openshift/okd/releases/download/4.10.0-0.okd-2022-03-07-131213/openshift-install-linux-4.10.0-0.okd-2022-03-07-131213.tar.gz

[root@mgr ~]#
tar zxvf openshift-client-linux-4.10.0-0.okd-2022-03-07-131213.tar.gz

[root@mgr ~]#
tar zxvf openshift-install-linux-4.10.0-0.okd-2022-03-07-131213.tar.gz

[root@mgr ~]#
mv oc kubectl openshift-install /usr/local/bin/

[root@mgr ~]#
chmod 755 /usr/local/bin/{oc,kubectl,openshift-install}

[root@mgr ~]#
oc version

Client Version: 4.10.0-0.okd-2022-03-07-131213
# generate SSH key-pair for Manager Node to each Node
# set passphrase if you need ⇒ if set it, it needs SSH-Agent, too (set no-passphrase on this example)

[root@mgr ~]#
ssh-keygen -q -N ""

Enter file in which to save the key (/root/.ssh/id_rsa):
# create ignition file

[root@mgr ~]#
mkdir okd4

[root@mgr ~]#
vi ./okd4/install-config.yaml
# [baseDomain] : specify base domain name
# [metadata.name] : specify any cluster name
# ⇒ (metadata.name).(baseDomain) is the same one with the name on DNSMasq you set like here
# [controlPlane.replicas] : specify number of Control Plane Nodes
# [pullSecret] : paste contents of Pull Secret you downloaded
# [sshKey] : paste contents of SSH key you generated above (public key)

apiVersion: v1
baseDomain: srv.world
compute:
- hyperthreading: Enabled
  name: worker
  replicas: 0
controlPlane:
  hyperthreading: Enabled
  name: master
  replicas: 3
metadata:
  name: okd4
networking:
  clusterNetwork:
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  networkType: OpenShiftSDN
  serviceNetwork:
  - 172.30.0.0/16
platform:
  none: {}
pullSecret: '{"auths":*****}'
sshKey: 'ssh-rsa *****'

[root@mgr ~]#
openshift-install create manifests --dir=okd4

INFO Consuming Install Config from target directory
WARNING Making control-plane schedulable by setting MastersSchedulable to true for Scheduler cluster settings
INFO Manifests created in: okd4/manifests and okd4/openshift

[root@mgr ~]#
openshift-install create ignition-configs --dir=okd4

INFO Consuming Master Machines from target directory
INFO Consuming Common Manifests from target directory
INFO Consuming Worker Machines from target directory
INFO Consuming Openshift Manifests from target directory
INFO Consuming OpenShift Install (Manifests) from target directory
INFO Ignition-Configs created in: okd4 and okd4/auth

[root@mgr ~]#
cp ./okd4/{bootstrap.ign,master.ign,worker.ign} /usr/share/nginx/html/

[root@mgr ~]#
chmod 644 /usr/share/nginx/html/{bootstrap.ign,master.ign,worker.ign}

Matched Content