Tuesday, 22 February 2022

Pods - Deploying pods and Exposing it as a Service

 

  1. Deploying Nginx Container

    kubectl create deployment sample-nginx --image=nginx --replicas=2 --port=80
    kubectl get pods
    kubectl get deployments
  2. Expose the deployment as service. This will create an ELB in front of those 2 containers and allow us to publicly access them.

    kubectl expose deployment sample-nginx --port=80 --type=LoadBalancer
    kubectl get services -o wide
    
    

    copy the loadbalancer into your Brower to access the nginx application




No comments:

Post a Comment

How to upgrade Maven

  java.lang.IllegalStateException I had installed maven in my ubuntu using command  apt install maven This installed maven in path /usr/shar...