Created
May 16, 2019 04:43
-
-
Save tom-butler/e512243b29a27878223cd488798e84b0 to your computer and use it in GitHub Desktop.
Local kubernetes cluster using k3d, with pvc support
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
#!/bin/bash | |
# Install k3d | |
k3d --version || wget -q -O - https://raw.githubusercontent.com/rancher/k3d/master/install.sh | bash | |
# verify it | |
k3d check-tools | |
# create a volume and cluster | |
docker volume create kube-volume | |
k3d create --workers 3 --volume kube-volume:/opt/local-path-provisioner --wait | |
# connect to the cluster | |
export KUBECONFIG="$(k3d get-kubeconfig --name='k3s-default')" | |
# install helm | |
kubectl apply -f https://raw.githubusercontent.com/opendatacube/datacube-k8s-eks/master/infra/tiller.yaml | |
helm init --service-account tiller --wait | |
# install strorageClass | |
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml | |
# mark it as default | |
kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uses k3d to create a k3s cluster locally in docker containers.