Skip to content

hkolvenbach/kubernetes-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Initial setup

Based on: https://www.packtpub.com/mapt/book/virtualization_and_cloud/9781787283367/1/ch01lvl1sec11/our-first-cluster

sudo apt-get install phython curl

Set up local Kubernetes cluster (Minikube)

https://kubernetes.io/docs/tasks/tools/install-minikube/ https://kubernetes.io/docs/getting-started-guides/minikube/#quickstart

Set up KVM for Minikube

https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm-driver

sudo apt-get install libvirt-bin qemu-kvm
# Debian/Ubuntu (NOTE: For Ubuntu 17.04 change the group to `libvirt`)
sudo usermod -a -G libvirtd $(whoami)
newgrp libvirtd

Set up docker-machine

https://github.com/docker/machine/releases

sudo apt-get install docker.io
curl -L https://github.com/docker/machine/releases/download/v0.12.0-rc2/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine &&
    chmod +x /tmp/docker-machine &&
    sudo cp /tmp/docker-machine /usr/local/bin/docker-machine

Set up docker-machine-driver-kvm

https://github.com/dhiltgen/docker-machine-kvm/releases

curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.10.0/docker-machine-driver-kvm-ubuntu16.04 > /tmp/docker-machine-driver-kvm && 
  chmod +x /tmp/docker-machine-driver-kvm &&
  sudo cp /tmp/docker-machine-driver-kvm /usr/local/bin/docker-machine-driver-kvm

Set up kubectl

On Ubuntu: sudo snap install kubectl --classic
Or using Google SDK: https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu

export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install google-cloud-sdk
gcloud init
gcloud components install kubectl

Or using bash: curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl

Install Minikube

https://kubernetes.io/docs/tasks/tools/install-minikube/ https://github.com/kubernetes/minikube/releases

curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.20.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

Start minikube

minikube start --vm-driver=kvm

Test your setup

kubectl cluster-info #should return Kubernetes master is running at https://<ip>:8443
kubectl config view #should return a list of configurations
minikube dashboard #should open a browser and go to the dashboard

Using Minikube

To open the dashboard

minikube dashboard

To SSH into the Minikube VM

minikube ssh #minikube ssh -v 7 to show the full command

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published