Skip to content

Latest commit

 

History

History
135 lines (97 loc) · 2.99 KB

0_quickstart.adoc

File metadata and controls

135 lines (97 loc) · 2.99 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.7.2/minikube-darwin-amd64

chmod +x minikube

./minikube version

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.15.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
Tip
"minikube profile 11steps" will set that as the default, make it sticky, therefore you will not have to type "minikube --profile 11steps" for subsequent commands

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