Skip to content

Latest commit

 

History

History
133 lines (96 loc) · 2.83 KB

0_quickstart.adoc

File metadata and controls

133 lines (96 loc) · 2.83 KB

Step 0: Quickstart

Create a Directory

mkdir ~/11steps
cd ~/11steps

git clone materials

git clone https://github.com/burrsutter/9stepsawesome

Make a directory for executables

mkdir bin
cd bin

Download minikube & kubectl

Some lines are Mac OS based, but if you are on Linux, change darwin to linux.

curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.4.0/minikube-darwin-amd64

chmod +x minikube

./minikube version

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/darwin/amd64/kubectl

chmod +x kubectl

cd ..

Set Environment Variables

export MINIKUBE_HOME=/Users/burrsutter/11steps;
export PATH=$MINIKUBE_HOME/bin:$PATH
export KUBECONFIG=$MINIKUBE_HOME/.kube/config
export KUBE_EDITOR="code -w"

Startup Minikube

minikube --profile 11steps config set memory 6144
minikube --profile 11steps config set cpus 2
minikube --profile 11steps config set vm-driver virtualbox
minikube --profile 11steps config set kubernetes-version v1.14.0
minikube start --profile 11steps

Run kubectl commands

kubectl cluster-info
kubectl get nodes
kubectl get nodes --show-labels
kubectl get namespaces
kubectl config view
cat $KUBECONFIG
kubectl config current-context
minikube --profile 11steps config view
kubectl get pods --all-namespaces
kubectl get pods --all-namespaces --show-labels
kubectl get pods --all-namespaces -o wide

minikube --profile 11steps dashboard

Deploy Something

kubectl create deployment myapp --image=quay.io/burrsutter/myboot:v1

kubectl get events
kubectl get events --sort-by=.metadata.creationTimestamp
kubectl get all
kubectl logs -l app=myapp

kubectl expose deployment myapp --port=8080 --type=LoadBalancer

kubectl get services

Talk to App

minikube --profile 11steps ip

minikube --profile 11steps service myapp --url

curl http://192.168.99.100:31045

minikube --profile 11steps service myapp

curl $(minikube -p 11steps ip):$(kubectl get service/myapp -o jsonpath="{.spec.ports[*].nodePort}" -n default)

watch kubectl get pods

while true; do curl $(minikube -p 11steps ip):$(kubectl get service/myapp -o jsonpath="{.spec.ports[*].nodePort}" -n default); sleep .3; done

kubectl scale deployment myapp --replicas=3

Update the App

kubectl set image deployment/myapp myboot=quay.io/burrsutter/myboot:v2

Update the App Again

kubectl set image deployment/myapp myboot=quay.io/burrsutter/quarkus-demo:1.0.0

Clean Up

kubectl delete service myapp

kubectl delete deployment myapp

minikube --profile 11steps stop

ls -lh ~/11steps/.minikube/machines/11steps

minikube --profile 11steps delete