escrichov / kubernetes-tutorial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cluster Installation

  1. Create Kubernetes Cluster in digital Ocean
  2. Install Kubectl https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl
  3. Wait until all nodes start
  4. Download Kubernetes Config file
  5. Copy file to $HOME/.kube/config
  6. Test conection to kubernetes cluster
kubectl get nodes
  1. Install metrics-server
git clone https://github.com/kubernetes-incubator/metrics-server
cp metrics-server-deployment.yaml metrics-server/deploy/1.8+/
cd metrics-server && kubectl create -f deploy/1.8+/

Create or Update

kubectl apply -f autoscaling.yaml

Delete

kubectl apply -f autoscaling.yaml

View autoscaling

In terminal 1:

watch kubectl get hpa

View deployments

In terminal 2:

watch kubectl get deployment php-apache

Increase load

In terminal 3:

kubectl run -i --tty load-generator --image=busybox /bin/sh
while true; do wget -q -O- http://php-apache.default.svc.cluster.local; done

Decrease load

In terminal 3:

type <Ctrl> + C.

View usage of nodes (servers)

kubectl top node

Guides:

About

License:MIT License


Languages

Language:Dockerfile 100.0%