-
-
Save rahulmr/974655a642455128625679b8f7e8f81d to your computer and use it in GitHub Desktop.
Install Microk8s on Ubuntu machine
This file contains 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
# Install microk8s from the edge channel (Rancher requires Helm 2.15.1 or above) | |
sudo snap install microk8s --classic | |
# Enable useful plugins | |
sudo microk8s.enable dns dashboard storage ingress helm | |
# Allow running priviledged Pods (required by Rancher's `cattle-node-agent`) | |
sudo sh -c 'echo "--allow-privileged=true" >> /var/snap/microk8s/current/args/kube-apiserver' | |
sudo systemctl restart snap.microk8s.daemon-apiserver.service | |
# Setup and install Tiller (part of Helm) | |
sudo microk8s.kubectl create serviceaccount tiller --namespace kube-system | |
sudo microk8s.kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller | |
sudo microk8s.helm init --service-account=tiller | |
# Install cert-manager user by Rancher | |
sudo microk8s.helm repo add jetstack https://charts.jetstack.io | |
sudo microk8s.kubectl apply -f https://github.com/jetstack/cert-manager/releases/latest/download/cert-manager.crds.yaml | |
sudo microk8s.kubectl create namespace cert-manager | |
sudo microk8s.kubectl label namespace cert-manager certmanager.k8s.io/disable-validation=true | |
sudo microk8s.helm install --name cert-manager --namespace cert-manager jetstack/cert-manager | |
# Install stable Rancher | |
sudo microk8s.helm repo add rancher-stable https://releases.rancher.com/server-charts/stable | |
sudo microk8s.helm install rancher-stable/rancher --name rancher --namespace cattle-system --set replicas=1 --set hostname=${HOSTNAME} | |
# Alias | |
sudo snap alias microk8s.kubectl kubectl | |
sudo snap alias microk8s.helm helm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment