Premier Commit

master
Thibodeau Bruno 3 years ago
commit 4ae0cf50d2

@ -0,0 +1,5 @@
Dédié à la documentation de l'installation de OKD.
Avec exemples, scripts et autres tests.
*scripts d'install incomplets, car trop de ressources demandées pour compléter.
Bien trop gros pour mes besoins...

@ -0,0 +1,14 @@
#!/bin/bash
#importation de la clé gpg
curl https://www.okd.io/vrutkovs.pub | gpg --import
#Télécharger l'archive et leclient
#Adresse: https://github.com/openshift/okd/releases
mkdir okd-install-files
wget https://github.com/openshift/okd/releases/download/4.10.0-0.okd-2022-06-10-131327/openshift-client-linux-4.10.0-0.okd-2022-06-10-131327.tar.gz
wget https://github.com/openshift/okd/releases/download/4.10.0-0.okd-2022-06-10-131327/openshift-install-linux-4.10.0-0.okd-2022-06-10-131327.tar.gz
tar xfz openshift-client-linux-4.10.0-0.okd-2022-06-10-131327.tar.gz
tar xfz openshift-install-linux-4.10.0-0.okd-2022-06-10-131327.tar.gz

@ -0,0 +1,91 @@
#!/bin/bash
#Pour Fedora
#Depuis: https://cgruver.github.io/okd4-single-node-cluster/
#Prep
dnf update -y
dnf -y module install virt
#Paquets requis
dnf in -y virt wget git net-tools bind bind-utils bash-completion rsync libguestfs-tools virt-install epel-release libvirt-devel httpd-tools snf nginx
#Prep Virtualization
systemctl enable libvirtd --now
mkdir /VirtualMachines
virsh pool-destroy default
virsh pool-undefine default
virsh pool-define-as --name default --type dir --target /VirtualMachines
virsh pool-autostart default
virsh pool-start default
#Prep nginx
systemctl enable nginx --now
mkdir -p /usr/share/nginx/html/install/fcos/ignition
#Prep Firewalld
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-service=dns
firewall-cmd --reload
#Prep SSh Key
ssh-keygen -t ed25519 -N "" -f /root/.ssh/id_ed25519
mkdir -p /root/okd4-snc
cd /root/okd4-snc
git clone https://github.com/cgruver/okd4-single-node-cluster.git
cd okd4-single-node-cluster
mkdir ~/bin
cp ./bin/* ~/bin
chmod 750 ~/bin/*
####################################
###################################
##################################
cat <<'EOF' > ~/bin/setSncEnv.sh
#The domain that you want for your lab. This will be part of your DNS setup
export SNC_DOMAIN=snc.test
#The IP address of your snc-host host.
export SNC_HOST=192.168.222.29
export SNC_NAMESERVER=${SNC_HOST}
export SNC_NETMASK=24
export SNC_GATEWAY=192.168.222.1
#The IP address for your SNC master node. Take a free local IP
export MASTER_HOST=192.168.222.28
#IP for antoher host. same.
export BOOTSTRAP_HOST=192.168.222.27
#Current network we will work in
export SNC_NETWORK=192.168.222.0/24
export INSTALL_HOST_IP=${SNC_HOST}
export INSTALL_ROOT=/usr/share/nginx/html/install
export INSTALL_URL=http://${SNC_HOST}/install
export OKD4_SNC_PATH=/root/okd4-snc
export OKD_REGISTRY=quay.io/openshift/okd
EOF
##############################
#############################
echo ". /root/bin/setSncEnv.sh" >> ~/.bashrc
./root/bin/setSncEnv.sh
#NETWORKING
PRIMARY_NIC="eno1"
#add bridge
nmcli connection add type bridge ifname br0 con-name br0 ipv4.method manual ipv4.address "${SNC_HOST}/${SNC_NETMASK}" ipv4.gateway "${SNC_GATEWAY}" ipv4.dns "${SNC_NAMESERVER}" ipv4.dns-search "${SNC_DOMAIN}" ipv4.never-default no connection.autoconnect yes bridge.stp no ipv6.method ignore
#add nic to bridge
nmcli con add type ethernet con-name br0-bind-1 ifname ${PRIMARY_NIC} master br0
nmcli con del ${PRIMARY_NIC}
nmcli con add type ethernet con-name ${PRIMARY_NIC} ifname ${PRIMARY_NIC} connection.autoconnect no ipv4.method disabled ipv6.method ignore
#apply network
systemctl restart NetworkManager.service
#quick test
ping -c4 redhat.com
reboot
Loading…
Cancel
Save