Created
December 4, 2022 17:37
-
-
Save sniederm/f2674cb6b383c38d77914d0029481a26 to your computer and use it in GitHub Desktop.
Create new KinD cluster with NGINX Ingress and 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
echo "Creating Cluster..." | |
cat <<EOF | kind create cluster --config=- | |
kind: Cluster | |
apiVersion: kind.x-k8s.io/v1alpha4 | |
nodes: | |
- role: control-plane | |
kubeadmConfigPatches: | |
- | | |
kind: InitConfiguration | |
nodeRegistration: | |
kubeletExtraArgs: | |
node-labels: "ingress-ready=true" | |
extraPortMappings: | |
- containerPort: 80 | |
hostPort: 80 | |
protocol: TCP | |
- containerPort: 443 | |
hostPort: 443 | |
protocol: TCP | |
EOF | |
echo "Installing Ingress..." | |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml | |
echo "Installing Dashboard..." | |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml | |
kubectl create serviceaccount -n kubernetes-dashboard admin-user | |
kubectl create clusterrolebinding -n kubernetes-dashboard admin-user --clusterrole cluster-admin --serviceaccount=kubernetes-dashboard:admin-user | |
token=$(kubectl -n kubernetes-dashboard create token admin-user) | |
echo "Dashboard token: ${token}" | |
echo "Dashboard url: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/" | |
kubectl proxy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment