okd4
Differences
This shows you the differences between two versions of the page.
| okd4 [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadm | okd4 [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== OKD 4 - Openshift ====== | ||
| - | ===== Requerimento ===== | ||
| - | ^Papel^IP^CPU^RAM^Storage^OS^ | ||
| - | |Load Balance|10.0.0.10|2|2|-|Oracle Linux 8| | ||
| - | |Bootstrap Node|10.0.0.11|4|16|100|Fedora CoreOS| | ||
| - | |Control Plane Node|10.0.0.12|4|16|100|Fedora CoreOS| | ||
| - | |Compute Node|10.0.0.13|2|8|100|Fedora CoreOS| | ||
| - | ===== dnsmasq ===== | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo dnf install dnsmasq | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo vim / | ||
| - | [...] | ||
| - | 19 domain-needed | ||
| - | 20 # Never forward addresses in the non-routed address spaces. | ||
| - | 21 bogus-priv | ||
| - | [...] | ||
| - | 53 strict-order | ||
| - | [...] | ||
| - | 67 server=8.8.8.8 | ||
| - | [...] | ||
| - | 80 address=/ | ||
| - | [...] | ||
| - | 135 expand-hosts | ||
| - | [...] | ||
| - | 145 domain=okd4.example.com | ||
| - | [...] | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo vim /etc/hosts | ||
| - | [...] | ||
| - | 10.0.0.10 | ||
| - | 10.0.0.11 | ||
| - | 10.0.0.12 | ||
| - | 10.0.0.13 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo systemctl enable --now dnsmasq | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ echo " | ||
| - | $ sudo chattr +i / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ dig api.okd4.example.com +short | ||
| - | 10.0.0.10 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ dig -x 10.0.0.10 +short | ||
| - | api.okd4.example.com. | ||
| - | </ | ||
| - | |||
| - | ===== Nginx ===== | ||
| - | <file bash> | ||
| - | $ sudo dnf install nginx nginx-mod-stream | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | |||
| - | [...] | ||
| - | server { | ||
| - | listen | ||
| - | listen | ||
| - | [...] | ||
| - | |||
| - | # Adicionar no final | ||
| - | stream { | ||
| - | upstream k8s-api { | ||
| - | server 10.0.0.11: | ||
| - | server 10.0.0.12: | ||
| - | } | ||
| - | upstream machine-config { | ||
| - | server 10.0.0.11: | ||
| - | server 10.0.0.12: | ||
| - | } | ||
| - | upstream ingress-http { | ||
| - | server 10.0.0.12: | ||
| - | server 10.0.0.13: | ||
| - | } | ||
| - | upstream ingress-https { | ||
| - | server 10.0.0.12: | ||
| - | server 10.0.0.13: | ||
| - | } | ||
| - | upstream ingress-health { | ||
| - | server 10.0.0.12: | ||
| - | server 10.0.0.13: | ||
| - | } | ||
| - | server { | ||
| - | listen 6443; | ||
| - | proxy_pass k8s-api; | ||
| - | } | ||
| - | server { | ||
| - | listen 22623; | ||
| - | proxy_pass machine-config; | ||
| - | } | ||
| - | server { | ||
| - | listen 80; | ||
| - | proxy_pass ingress-http; | ||
| - | } | ||
| - | server { | ||
| - | listen 443; | ||
| - | proxy_pass ingress-https; | ||
| - | } | ||
| - | server { | ||
| - | listen 1936; | ||
| - | proxy_pass ingress-health; | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo setsebool -P httpd_can_network_connect on | ||
| - | $ sudo setsebool -P httpd_graceful_shutdown on | ||
| - | $ sudo setsebool -P httpd_can_network_relay on | ||
| - | $ sudo setsebool -P nis_enabled on | ||
| - | $ sudo semanage port -a -t http_port_t -p tcp 6443 | ||
| - | $ sudo semanage port -a -t http_port_t -p tcp 22623 | ||
| - | $ sudo semanage port -a -t http_port_t -p tcp 1936 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo firewall-cmd --add-service={dns, | ||
| - | $ sudo firewall-cmd --add-port={6443/ | ||
| - | $ sudo firewall-cmd --runtime-to-permanent | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo systemctl start nginx | ||
| - | $ sudo systemctl enable nginx | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ ss -nltp | ||
| - | State Recv-Q | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | LISTEN | ||
| - | </ | ||
| - | |||
| - | ===== Criando o ignition ===== | ||
| - | <file bash> | ||
| - | wget https:// | ||
| - | https:// | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ tar zxvf openshift-client-linux-4.10.0-0.okd-2022-03-07-131213.tar.gz | ||
| - | $ tar zxvf openshift-install-linux-4.10.0-0.okd-2022-03-07-131213.tar.gz | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo mv oc kubectl openshift-install / | ||
| - | $ sudo chmod 755 / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ oc version | ||
| - | Client Version: 4.10.0-0.okd-2022-03-07-131213 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ ssh-keygen -q -N "" | ||
| - | Enter file in which to save the key (/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ mkdir okd4 | ||
| - | </ | ||
| - | |||
| - | <file yaml install-config.yaml> | ||
| - | $ vim okd4/ | ||
| - | apiVersion: v1 | ||
| - | baseDomain: example.com | ||
| - | compute: | ||
| - | - hyperthreading: | ||
| - | name: worker | ||
| - | replicas: 0 | ||
| - | controlPlane: | ||
| - | hyperthreading: | ||
| - | name: master | ||
| - | replicas: 1 | ||
| - | metadata: | ||
| - | name: okd4 | ||
| - | networking: | ||
| - | clusterNetwork: | ||
| - | - cidr: 10.128.0.0/ | ||
| - | hostPrefix: 23 | ||
| - | networkType: | ||
| - | serviceNetwork: | ||
| - | - 172.30.0.0/ | ||
| - | platform: | ||
| - | none: {} | ||
| - | pullSecret: '' | ||
| - | sshKey: ' | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ 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/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ openshift-install create ignition-configs --dir=okd4 | ||
| - | INFO Consuming OpenShift Install (Manifests) from target directory | ||
| - | INFO Consuming Worker Machines from target directory | ||
| - | INFO Consuming Master Machines from target directory | ||
| - | INFO Consuming Openshift Manifests from target directory | ||
| - | INFO Consuming Common Manifests from target directory | ||
| - | INFO Ignition-Configs created in: okd4 and okd4/auth | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo cp okd4/ | ||
| - | $ sudo chmod 644 / | ||
| - | </ | ||
| - | |||
| - | ===== Install Fedora CoreOS ===== | ||
| - | Download: [[https:// | ||
| - | |||
| - | ===== Referências ===== | ||
| - | [[https:// | ||
okd4.1753560544.txt.gz · Last modified: by wikiadm
