Created
January 24, 2022 14:30
-
-
Save ruzickap/31d16c3e9ad6a6d9f3f80da1ed8e99a0 to your computer and use it in GitHub Desktop.
Start k33 kubernetes cluster using k3d with Rancher
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
#!/usr/bin/env bash | |
set -euxo pipefail | |
CLUSTER_NAME="rancher-dev" | |
k3d cluster delete --all | |
k3d cluster create "${CLUSTER_NAME}" \ | |
--port "8080:80@loadbalancer" --port "8443:443@loadbalancer" \ | |
--k3s-arg "--disable=traefik@all" \ | |
--k3s-arg "--disable=local-storage@all" \ | |
--k3s-arg "--disable=metrics-server@all" \ | |
--kubeconfig-update-default=false --wait | |
k3d kubeconfig write ${CLUSTER_NAME} --overwrite --output /tmp/k3d-${CLUSTER_NAME} | |
KUBECONFIG="/tmp/k3d-${CLUSTER_NAME}" | |
export KUBECONFIG | |
## Rancher | |
# https://github.com/rancher/rancher/tree/master/chart) | |
# https://github.com/rancher/rancher/blob/master/chart/values.yaml | |
helm repo add --force-update rancher-latest https://releases.rancher.com/server-charts/latest | |
helm upgrade --install --version 2.6.2 --wait --namespace cattle-system --create-namespace --values - rancher rancher-latest/rancher << EOF | |
ingress: | |
enabled: false | |
tls: | |
source: secret | |
replicas: 1 | |
bootstrapPassword: "test123" | |
EOF | |
kubectl patch svc rancher -n cattle-system -p '{"spec": {"type": "LoadBalancer"}}' | |
echo "*** export KUBECONFIG=\"${KUBECONFIG}\"" | |
echo "*** https://localhost:8080" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment