A workshop that works as a starting point to mess around with kubernetes.
By the end you should know how to run kubernetes in your PC and how to run different services in your kubernetes.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- [HyperKit]
brew install docker-machine-driver-hyperkit
# docker-machine-driver-hyperkit need root owner and uid
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
$ brew cask install minikube
$ minikube config set cpus 4
$ minikube config set memory 4096
$ minikube config set vm-driver hyperkit
$ minikube start
- Helm
$ brew install kubernetes-helm
## install helm on the kuberntes cluster
$ helm init
brew reinstall kubernetes-cli
Download from here: https://www.virtualbox.org/wiki/Download_Old_Builds_5_2
$ snap install minikube --classic
$ minikube config set cpus 4
$ minikube config set memory 4096
- Helm
$ snap install helm --classic
## install helm on the kuberntes cluster
$ helm init
snap install kubectl --classic
$ helm init
### Check if its running
$ kubectl get pods --all-namespaces
$ helm install --name grafana-release stable/grafana
...
NOTES:
1. Get your 'admin' user password by running:
kubectl get secret --namespace default grafana-release -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
2. The Grafana server can be accessed via port 80 on the following DNS name from within your cluster:
grafana-release.default.svc.cluster.local
Get the Grafana URL to visit by running these commands in the same shell:
export POD_NAME=$(kubectl get pods --namespace default -l "app=grafana,release=grafana-release" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace default port-forward $POD_NAME 3000
3. Login with the password from step 1 and the username: admin
#################################################################################
###### WARNING: Persistence is disabled!!! You will lose your data when #####
###### the Grafana pod is terminated. #####
#################################################################################
Check the status:
$ helm status grafana-release
Get the password
$ kubectl get secret --namespace default grafana-release -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
Forward the port
$ export POD_NAME=$(kubectl get pods --namespace default -l "app=grafana,release=grafana-release" -o jsonpath="{.items[0].metadata.name}")
$ kubectl --namespace default port-forward $POD_NAME 3000
Open http://localhost:3000/ and login with admin:{password}
Run h314to/hellogo:latest
on kubernetes by creating a deployment and a service.
Try to do it yourself. If you can't solutions are provided in hello.yaml
and the Makefile
Good starting points: