Skip to content

Commit

Permalink
Updated install files for Fedora 39
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Ravelo <[email protected]>
  • Loading branch information
gandazgul committed Feb 8, 2025
1 parent 83c3c3b commit a341e65
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 45 deletions.
1 change: 1 addition & 0 deletions .idea/k8s-infrastructure.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions charts/cronjob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ A Helm chart for creating cron jobs
| schedule | string | `"*/5 * * * *"` | |
| successfulJobsHistoryLimit | int | `3` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
2 changes: 0 additions & 2 deletions charts/hostpath-provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ A chart to install a storage provisioner for single node installs.
| resources | object | `{}` | |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
2 changes: 0 additions & 2 deletions charts/mosca/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,3 @@ A Helm chart for the Mosca.io MQTT Broker
| volumeMounts | list | `[]` | |
| volumes | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
2 changes: 0 additions & 2 deletions charts/smartthings-mqtt-bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ A Helm chart for the smartthings-mqtt-bridge
| service.type | string | `"ClusterIP"` | |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
2 changes: 1 addition & 1 deletion install-k8s/1-fedoraPostInstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ printf "Upgrade ================================================================
sudo dnf -y update || exit 1

printf "Install screen, and other tools =============================================================================\n"
sudo dnf -y install screen htop git p7zip rdiff-backup fail2ban
sudo dnf -y install screen htop nano iproute-tc fail2ban

printf "Setting up fail2ban for sshd ================================================================================\n"
sudo cp ./jail.local /etc/fail2ban/jail.local
Expand Down
1 change: 1 addition & 0 deletions install-k8s/2-configK8SControlPlane.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ printf "\nInstalling kubernetes ================================================
# Check if kubeadm already ran, do kubeadm reset to re-run
if [[ ! -f "/etc/kubernetes/kubelet.conf" ]]; then
sudo systemctl enable kubelet.service
sudo hostnamectl set-hostname --static k8s-control-plane
sudo kubeadm config images pull
sudo kubeadm init --config=./kubeadm.yaml || exit 1
else
Expand Down
60 changes: 26 additions & 34 deletions install-k8s/configNode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@ if [[ $EUID = 0 ]]; then
exit 1
fi

printf "\nInstalling cri-o from its repo ==================================================================\n"
if ! dnf list installed cri-o > /dev/null 2>&1; then
printf "\nInstall cri-o and crun ================================================================================\n"
sudo dnf -y module enable cri-o:1.24 || exit 1
sudo dnf -y install crun cri-o || exit 1
sudo dnf update --exclude="cri-*" || exit 1

printf "\nRaising user watches to the highest number to allow kubelet to work with lots of containers ===========\n"
echo fs.inotify.max_user_watches=1048576 | sudo tee --append /etc/sysctl.conf
echo fs.inotify.max_user_instances=1048576 | sudo tee --append /etc/sysctl.conf
fi;
sudo bash -c 'cat <<EOF | tee /etc/yum.repos.d/cri-o.repo
[cri-o]
name=CRI-O
baseurl=https://pkgs.k8s.io/addons:/cri-o:/stable:/v1.28/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/addons:/cri-o:/stable:/v1.28/rpm/repodata/repomd.xml.key
EOF'

printf "\nInstalling cri-o dependencies\n"
sudo dnf install -y \
conntrack \
container-selinux \
ebtables \
ethtool \
iptables \
socat

cat /etc/crio/crio.conf | grep default_runtime | grep crun
GREP_RE=$?
if [ $GREP_RE != 0 ]; then
printf "\nChange cri-o's config to work with crun ===============================================================\n"
sudo sed -c -i "s/\(default_runtime *= *\).*/\1\"crun\"/" /etc/crio/crio.conf || exit 1
echo "[crio.runtime.runtimes.crun]" | sudo tee --append /etc/crio/crio.conf || exit 1
echo "runtime_path = \"/usr/bin/crun\"" | sudo tee --append /etc/crio/crio.conf || exit 1
echo "runtime_type = \"oci\"" | sudo tee --append /etc/crio/crio.conf || exit 1
echo "runtime_root = \"/run/crun\"" | sudo tee --append /etc/crio/crio.conf || exit 1
printf "\nInstalling cri-o\n"
sudo dnf install -y --repo cri-o cri-o

printf "\nEnable cri-o ==========================================================================================\n"
sudo systemctl daemon-reload || exit 1
Expand All @@ -40,28 +42,19 @@ fi;

printf "\nInstalling Kubernetes packages from repo ==================================================================\n"
if [[ ! -f /etc/yum.repos.d/kubernetes.repo ]]; then
printf "\nInstall kubelet, kubeadm, crictl(needed by kubelet), cockpit (nice fedora dashboard):"
printf "\nInstall kubelet, kubeadm and kubectl"
sudo bash -c 'cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
baseurl=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kube*
[kubernetes-unstable]
name=Kubernetes-unstable
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64-unstable
enabled=0
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kube*
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.28/rpm/repodata/repomd.xml.key
exclude=kubelet kubeadm kubectl cri-tools kubernetes-cni
EOF'

sudo dnf -y install --enablerepo=kubernetes kubelet-1.24.11-0 kubectl-1.24.11-0 kubeadm-1.24.11-0 --disableexcludes=kubernetes || exit 1
sudo dnf -y install --enablerepo=kubernetes kubelet kubectl kubeadm --disableexcludes=kubernetes || exit 1
# cockpit-pcp enables the metric graphs in cockpit
sudo dnf -y install cockpit-pcp || exit 1

# enable cni plugins
Expand All @@ -75,7 +68,6 @@ sudo systemctl enable --now cockpit.socket || exit 1
if dnf list installed zram-generator-defaults > /dev/null 2>&1; then
printf "\nDisabling swap ==========================================================================================\n"
sudo dnf -y remove zram-generator-defaults
sudo systemctl stop swap-create@zram0 || exit 1
sudo swapoff /dev/zram0 || exit 1
fi

Expand Down
2 changes: 0 additions & 2 deletions temp-files/grafana-prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ A chart for installing grafana config maps
| ---- | ------ | --- |
| gandazgul | <[email protected]> | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)

0 comments on commit a341e65

Please sign in to comment.