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

Bash Script to Install Artifactory in Ubuntu 22

JFrog Artifactory OSS 7.21.5 — Install (Bash Script) This script installs Artifactory OSS (no Docker, no Pro, works on Ubuntu 22 EC2). ...