Created
September 29, 2021 14:42
-
-
Save sw360cab/1e6400025b981760e4259fede4dc687e to your computer and use it in GitHub Desktop.
Bash Script that enables a K8S cluster by installing Rancher K3S and Helm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run remotely with -> source <(curl -s http://<remote-address-of-this-script>.sh) | |
set -e | |
# Run as su | |
if [ `id -u` -ne 0 ] | |
then | |
echo "You need to be root to run this script" | |
exit 1 | |
fi | |
apt update && apt install -y apt-transport-https ca-certificates curl gnupg lsb-release | |
# Install K3S | |
curl -sfL https://get.k3s.io | sh - | |
# Change permission to Rancher file | |
chmod 775 /etc/rancher/k3s/k3s.yaml | |
# Install Helm | |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash - | |
echo "Cluster installed and active" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment