Spinning up a Kubernetes cluster (notes)

INSTALL

VirtualBox Instance via vagrant

mkdir ubuntu

vagrant init ubuntu/xenial64

vagrant up

vagrant ssh

OR

vagrant get-config????

kops

wget https://github.com/kubernetes/kops/releases/download/1.12.1/kops-linux-amd64

chmod +x kops-linux-amd64

sudo mv kops-linux-amd64 /usr/local/bin/kops

awscli

sudo apt-get update

sudo apt-get install python-pip

sudo pip install awscli

aws configure

kubectl

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl

Spin up kubernetes cluster

kops create cluster –name=kubernetes.intelligence.ws –state=s3://kops-state-joelgriffiths –zones=us-west-2a –node-count=2 –node-size=t2.micro –master-size=t2.micro –dns-zone=kubernetes.intelligence.ws

Edit if necessary

kops edit cluster kubernetes.intelligence.ws –state=s3://kops-state-joelgriffiths

Bring up the cluster

kops update cluster –name kubernetes.intelligence.ws –yes –state=s3://kops-state-joelgriffiths

Spinning up containers

kubectl run hello-minikube –image=k8s.gcr.io/echoserver:1.4 –port=8080

kubectl expose deployment hello-minikube –type=NodePort

kubectl get services

(CHECK FIREWALL IF PORT DOESN’T WORK)

Cleaning up and deleting k8s cluster

kops delete cluster kubernetes.intelligence.ws –state=s3://kops-state-joelgriffiths

kops delete cluster kubernetes.intelligence.ws –state=s3://kops-state-joelgriffiths –yes

Name (required)Email (required)Website

Leave a Reply