Created
June 21, 2019 17:26
-
-
Save gnagel/d473d6dce375c08ee68b8857d3209562 to your computer and use it in GitHub Desktop.
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 | |
# | |
# 1. Install the hyperkit VM for local kubernetes development | |
# | |
# > https://github.com/moby/hyperkit | |
# | |
brew install hyperkit jq | |
brew link --overwrite hyperkit | |
# | |
# 2. Install the hyperkit <-> Docker drivers | |
# | |
brew install docker-machine-driver-hyperkit | |
sudo chown root:wheel /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit | |
sudo chmod u+s /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit | |
# | |
# 3. Install minikube | |
# | |
# > https://kubernetes.io/docs/tasks/tools/install-minikube/ | |
# > https://github.com/kubernetes/minikube | |
# | |
brew cask install minikube | |
minikube config set vm-driver hyperkit | |
# | |
# 3a. Install and deploy the Kubernetes dashboard | |
# | |
# > https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/ | |
# | |
kubectl apply -f ./kubernetes/kubernetes-dashboard.yaml | |
open 'http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/' && kubectl proxy | |
# Select token | |
# Create An Authentication Token | |
# > https://github.com/kubernetes/dashboard#create-an-authentication-token-rbac | |
kubectl apply -f kubernetes/kubernetes-dashboard-adminuser.yaml | |
# Copy the token from this command into your browser: | |
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}') | |
# | |
# 4. Create a new profile for the `vte_id`: | |
# | |
minikube profile vte_id | |
# > β minikube profile was successfully set to vte_id | |
# NOTE: | |
# If you get into trouble and need to remove a profile, you can find the list of profiles here: | |
# > ls ~/.minikube/profiles/ | |
# | |
# And delete them with this command: | |
# > minikube delete -p <profile_name> | |
# | |
# 5. Now try starting your minikube cluster: | |
# | |
# > https://medium.com/faun/using-minikube-profiles-def2477e968a | |
# | |
minikube start -p vte_id --vm-driver=hyperkit [11:27:19] | |
# π minikube v1.1.1 on darwin (amd64) | |
# π₯ Creating hyperkit VM (CPUs=2, Memory=2048MB, Disk=20000MB) ... | |
# π³ Configuring environment for Kubernetes v1.14.3 on Docker 18.09.6 | |
# πΎ Downloading kubelet v1.14.3 | |
# πΎ Downloading kubeadm v1.14.3 | |
# π Pulling images ... | |
# π Launching Kubernetes ... | |
# β Verifying: apiserver proxy etcd scheduler controller dns | |
# π Done! kubectl is now configured to use "vte_id" | |
# On mac the initial cluster will need to be stopped and re-created | |
# > https://github.com/kubernetes/minikube/issues/1151 | |
# | |
minikube stop && minikube delete && minikube start | |
# | |
# 6. Take a look at the minikube dashboard | |
# | |
# > https://medium.com/@wisegain/minikube-cheat-sheet-a273385e66c9 | |
# | |
kubectl version | |
# > Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:44:30Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"} | |
# > Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:36:19Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"} | |
kubectl cluster-info | |
# > Kubernetes master is running at https://192.168.64.3:8443 | |
# > KubeDNS is running at https://192.168.64.3:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy | |
# > | |
# > To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. | |
# | |
kubectl cluster-info dump | |
# .... | |
kubectl --context=vte_id get componentstatus [10:37:36] | |
# > NAME STATUS MESSAGE ERROR | |
# > controller-manager Healthy ok | |
# > scheduler Healthy ok | |
# > etcd-0 Healthy {"health":"true"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment