Created
January 8, 2022 07:01
-
-
Save ruzickap/82c9779d5528bd41680653fad4554d8c to your computer and use it in GitHub Desktop.
Quickly start k3d k8s cluster with Traefik dashboard
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
#!/usr/bin/env bash | |
set -euxo pipefail | |
CLUSTER_NAME="dev" | |
k3d cluster delete --all | |
k3d cluster create "${CLUSTER_NAME}" \ | |
--port "8080:80@loadbalancer" --port "8443:443@loadbalancer" \ | |
--kubeconfig-update-default=false --wait | |
KUBECONFIG="$(k3d kubeconfig write ${CLUSTER_NAME})" | |
export KUBECONFIG | |
( | |
sleep 100 | |
kubectl wait pod --namespace kube-system --for=condition=Ready --timeout=5m -l app.kubernetes.io/name=traefik | |
kubectl patch ingressroute -n kube-system traefik-dashboard --type=merge -p '{"spec":{"entryPoints":["web"]}}' | |
) &> /dev/null & | |
echo "*** export KUBECONFIG=\"\$(k3d kubeconfig write ${CLUSTER_NAME})\"" | |
echo "*** http://localhost:8080/dashboard/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment