Skip to content

Instantly share code, notes, and snippets.

@waja
Last active June 18, 2020 09:05
Show Gist options
  • Save waja/d42986c5bdfeac8ed279395e2a6065dc to your computer and use it in GitHub Desktop.
Save waja/d42986c5bdfeac8ed279395e2a6065dc to your computer and use it in GitHub Desktop.
#!/bin/sh
# install needed curl package
sudo apt install --no-install-recommends curl -y
# install kubectl
# https://github.com/kubernetes/minikube/issues/3437#issuecomment-449408316, maybe use https://storage.googleapis.com/minikube/releases/v0.30.0/docker-machine-driver-kvm2
curl -Lo /tmp/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x /tmp/kubectl && \
sudo mv /tmp/kubectl /usr/local/bin/kubectl
# kubectl tab completion
sudo sh -c 'echo "source <(kubectl completion bash)" > /etc/bash_completion.d/kubectl'
# install needed packages for kvm (see https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver)
sudo apt install --no-install-recommends curl libvirt-bin qemu-kvm -y
sudo usermod -a -G libvirtd $(whoami)
newgrp libvirtd
# download and install the kvm docker machine driver
curl -Lo /tmp/docker-machine-driver-kvm2 https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 && \
chmod +x /tmp/docker-machine-driver-kvm2 && \
sudo mv /tmp/docker-machine-driver-kvm2 /usr/bin/
# install minikube
curl -Lo /tmp/minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \
chmod +x /tmp/minikube && \
sudo mv /tmp/minikube /usr/local/bin/minikube
minikube start --vm-driver=kvm2
#!/bin/sh
# install needed
sudo apt-get install curl -y
# install kubectl
# https://github.com/kubernetes/minikube/issues/3437#issuecomment-449408316, maybe use https://storage.googleapis.com/minikube/releases/v0.30.0/docker-machine-driver-kvm2
curl -Lo /tmp/kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x /tmp/kubectl && \
sudo mv /tmp/kubectl /usr/local/bin/kubectl
# kubectl tab completion
sudo sh -c 'echo "source <(kubectl completion bash)" >> /etc/bash_completion.d/kubectl'
# install minikube
curl -Lo /tmp/minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \
chmod +x /tmp/minikube && \
sudo mv /tmp/minikube /usr/local/bin/minikube
# be lazy and use UNSECURE vm driver "none"
export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
export MINIKUBE_HOME=$HOME
export CHANGE_MINIKUBE_NONE_USER=true
mkdir -p $HOME/.kube || true
touch $HOME/.kube/config
export KUBECONFIG=$HOME/.kube/config
sudo minikube start --vm-driver=none
#!/bin/sh
# deloying helm (https://helm.sh/)
HELM_VER=$(curl -s -o /dev/null -I -w "%{redirect_url}\n" https://github.com/helm/helm/releases/latest | grep -oP "[0-9]+(\.[0-9]+)+$")
TAR_FILE="helm-v$HELM_VER-linux-amd64.tar.gz"
curl -o /tmp/$TAR_FILE https://storage.googleapis.com/kubernetes-helm/$TAR_FILE && \
mkdir -p /tmp/helm && tar -zxvf /tmp/$TAR_FILE -C /tmp/helm && \
sudo mv /tmp/helm/linux-amd64/helm /usr/local/bin/helm && \
rm -rf /tmp/$TAR_FILE /tmp/helm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment