Here we are putting the all commands, we have used in last lecture. This will help the user to settingup the Kubernetes with MiniKube.
********** Install Docker CE Edition **********
1. sudo apt-get update2. sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common 3. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -4. sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"5. sudo apt-get update6. sudo apt-get install docker-ce7. docker version
********** Install KubeCtl **********
1. curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl2. chmod +x ./kubectl3. sudo mv ./kubectl /usr/local/bin/kubectl4. kubectl version
********** Install MiniKube **********
1. curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube2. sudo install minikube /usr/local/bin
********** Install VirtualBox **********
1. wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -2. sudo apt-get update3. sudo apt-get install virtualbox
********** Execute MiniKube & Create Cluster **********
1. minikube start
********** Interact Cluster Using KubeCtl **********
Let’s create a Kubernetes Deployment using an existing image named echoserver, which is a simple HTTP server and expose it on port 8080 using --port.
1. kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.10 --port=8080
We can inspect the pods and the deployments
2. kubectl get pod3. kubectl get deployments
In order to access the hello-minikube service, we must first expose the deployment to an external IP via the command:
4. kubectl expose deployment hello-minikube --type=NodePort
Check if the service was exposed
5. kubectl get services
Get the URL of the exposed Service to view the Service details:
6. minikube service hello-minikube --url
Now we can either curl the service from the CLI, or hit it via the browser.
7. curl $(minikube service hello-minikube --url)8. curl <URL>
Delete the Service :
9. kubectl delete services hello-minikube10. kubectl delete deployment hello-minikube
Stop the local Minikube cluster:
11. minikube stop