Configurare l'ambiente

Questi passi descrivono come configurare l'ambiente prima di poter installare Oracle Cloud Native Environment su Oracle Private Cloud Appliance.

Si presume che sia già stato eseguito il provisioning delle seguenti risorse:

  • Compartimento nella tenancy.
  • Una rete cloud virtuale (VCN) nel compartimento con un'etichetta DNS (con l'opzione Usa nomi host DNS abilitata in questa VCN).
  • Istanze di computazione per tre nodi di lavoro, un nodo di controllo e un nodo operatore.

Imposta proxy

Impostare il proxy vars in etc bashrc su tutti i nodi in modo che tutte le sessioni shell future abbiano il vantaggio delle variabili di ambiente proxy. Sostituire il nome e la porta appropriati del server proxy con http://proxy-host:proxy-port.

if [ ! -f /etc/bashrc.bak ]; then
 cp -p /etc/bashrc /etc/bashrc.bak
else
 cp -p /etc/bashrc.bak /etc/bashrc
fizz=/tmp/ocne.setup.sh.on_host_to_be_setup
cat <<EOD > $zz
export http_proxy=http://proxy-host:proxy-port
export https_proxy=http://proxy-host:proxy-port
# substitute your domain name for "dm.com"
HOSTNAME=`hostname`
first_3_octets_of_LAN=`nslookup $HOSTNAME.dm.com | grep Address | tail -1 | sed -e 's/Address: //' -e 's/\.[0-9]*$//'`
export 
no_proxy='localhost,127.0.0.1,.proxy-host,.oraclecorp.com,.oraclevcn.com,$first_3_octets_of_LAN.0/24,.svc,/var/run/crio/crio.sock,10.96.0.0/12'EOD
cat $zz >> /etc/bashrc

Applica aggiornamenti del sistema operativo

Applica le patch del sistema operativo per aggiornare la sicurezza e il funzionamento di tutti i nodi.

Identificare il sistema operativo.

Identify Oracle Linux major release 
uname -a | sed -e 's/.*\.el//' -e 's/^\(.\).*/\1/'

Se il risultato di questo comando è 8, si esegue Oracle Linux 8. Se si esegue Oracle Linux 7, utilizzare yum anziché dnf e non passare l'argomento aggiuntivo --best --allowerasing.

Ad esempio, se le istruzioni dicono:

yum --setopt=keepcache=1 xyz

In alternativa, se si è in esecuzione su Oracle Linux 7, è necessario eseguire il comando:

dnf --best --setopt=keepcache=1 --allowerasing xyz

Applicare gli aggiornamenti del sistema operativo su tutti i nodi dopo aver configurato yum ed eventualmente dnf per essere a conoscenza del server proxy.

if [ ! -f /etc/yum.conf.bak ]; then
 cp /etc/yum.conf /etc/yum.conf.bak
else
 cp /etc/yum.conf.bak /etc/yum.conf
fi
echo proxy=http://proxy-host:proxy-port >> /etc/yum.conf
if [ -d /etc/dnf ]; then
 if [ ! -f /etc/dnf/dnf.conf.bak ]; then
 sudo cp /etc/dnf/dnf.conf /etc/dnf/dnf.conf.bak
 else
 sudo cp /etc/dnf/dnf.conf.bak /etc/dnf/dnf.conf
 fi
 cp /etc/dnf/dnf.conf.bak /tmp/dnf.conf
 echo proxy=http://proxy-host:proxy-port:80 >> /tmp/dnf.conf
 sudo mv /tmp/dnf.conf /etc/dnf/dnf.conf
fi
dnf --best --setopt=keepcache=1 --allowerasing update -y
reboot

Configura repository su tutti i nodi

Configurare i repository yum su tutti i nodi.

configure repos 
# if we are on OEL7, do the following:
sudo yum-config-manager --enable ol7_olcne15 ol7_kvm_utils ol7_addons ol7_latest ol7_UEKR6
sudo yum-config-manager --disable ol7_olcne14 ol7_olcne13 ol7_olcne12 ol7_olcne11 ol7_olcne
ol7_developer
# but if we are on Oracle Linux 8, do the following:
sudo dnf -y install oracle-olcne-release-el8
sudo yum config-manager --enable ol8_olcne15 ol8_addons ol8_baseos_latest ol8_appstream 
ol8_UEKR6
sudo yum config-manager --disable ol8_olcne12 ol8_olcne13 ol8_olcne14 ol8_developer

Installa Chrony

#Install chrony on all nodes.
sudo dnf --best --setopt=keepcache=1 --allowerasing -y install chrony
sudo systemctl enable --now chronyd.service

Disabilita swap su tutti i nodi

no swap 
swapoff -a
if [ ! -f /etc/fstab.bak ]; then
 sudo cp /etc/fstab /etc/fstab.bak
fi
cat /etc/fstab.bak | sed '/[\t ]swap[\t ]/d' > /tmp/fstab
echo diff /etc/fstab.bak /tmp/fstab
diff /etc/fstab.bak /tmp/fstab
sudo cp /tmp/fstab /etc/fstab
echo cat /etc/fstab
cat /etc/fstab

Configura firewall sul nodo operatore

operator node firewall 
sudo firewall-cmd --add-port=8091/tcp --permanent
sudo firewall-cmd --reload

Configura firewall su nodi di lavoro

worker node firewall 
sudo firewall-cmd --zone=trusted --add-interface=cni0 --permanent
sudo firewall-cmd --add-port=8090/tcp --permanent
sudo firewall-cmd --add-port=10250/tcp --permanent
sudo firewall-cmd --add-port=10255/tcp --permanent
sudo firewall-cmd --add-port=8472/udp --permanent
sudo firewall-cmd --add-masquerade --permanent
sudo systemctl restart firewalld.service

Configura regola di entrata lista di sicurezza subnet

È necessario regolare la lista di sicurezza della subnet per consentire il traffico di Oracle Cloud Native Environment e Kubernetes sul nuovo cluster.
  1. Eseguire il drill-down nella lista di sicurezza per aggiungere regole di entrata.
  2. Aggiungere regole di entrata alla lista di sicurezza per la subnet utilizzata per le istanze di computazione dei nodi per consentire il traffico sulle porte necessarie.
  3. Consentire il traffico alle seguenti porte:
    • 2.379-2.380
    • 6.443-6.444
    • 8.090-8.091
    • 8.472
    • 10.250-10.252
    • 10.255