Steps to deploy image into kubernetes (Minikube)



STEPS TO DEPLOY IMAGE INTO KUBERNETES-MINIKUBE
==================================================

Note: Confirm you have installed the
VirtualBox,
Docker Toolbox,
minikube, (kubectl, kubeadm)

1) Open docker command line
2) Push the created image into the docker hub
(Note: As in windows we are not able to locote the local image. We will push the image on docker hub and will get it back from the same for running it in minikube)
PUSH IMAGE ON DOCKER HUB:(create account on docker hub and create one repository)
$ docker tag image_id hugusername/image_name:tag_name
$ docker tag image_id rajkirpalsinh/myapp:v1
$ docker push rajkirpalsinh/myapp

3) Start Minikube:
$ minikube start

4) Run the image into minukube from the docker hub repository(v1 is the tag name and rajkirpalsinh/myapp is the hub_username/repository_name):
$ kubectl run myapp1 --image=rajkirpalsinh/myapp:v1 --port=8080
(It will find the v1 tag image from the rajkirpalsinh/myapp repository and will run it in your local minikube)

5) check the status of the pods (Note: status should be running):
$ kubectl get pods

6) One it is in running state expose the deployment:
$ kubectl expose deployment myapp1 --type=LoadBalancer --port=8080 --target-port=8080
(You should get 'service/myapp1 exposed' as a result)

7) Get the URL of the exposed Service to view the Service details:
$ minikube service myapp1 --url

You will get the IP:port of the exposed service.
You can try the IP:PORT in the browser and check your service.

8) View the number of deployments
$ kubectl get deployments

9) Scale the deployments
$ kubectl scale deployments/myapp1 --replicas=2

10) Check if the number of Pods
$ kubectl get pods -o wide

11) describe the deployment
$ kubectl describe deployments/myapp1

12) TO view the IP:port of the new scaled instances
$ kubectl describe services/myapp1