DevOps(Day-34) : Working with Services in Kubernetes

DevOps(Day-34) : Working with Services in Kubernetes

TABLE OF CONTENTS

What are Services in K8s In Kubernetes?

Services are objects that provide stable network identities to Pods and abstract away the details of Pod IP addresses. Services allow Pods to receive traffic from other Pods, Services, and external clients.

Task-1: Create a Service for your app Deployment

  1. Navigate to the server and create a service.yaml file.

  2. Write the Service.yaml file.

  3. Run the service.yaml file using the below command.

  4. Check the service is running or not.

  5. Now check if the URL is running on the server.

Task-2: Create a ClusterIP Service

  1. Add the Cluster IP settings to the service.yaml file.

  2. Run the service.yaml file.

3. Navigate to a Pod and run the CURL command to access the URL.

Task-3: Create a LoadBalancer Service

  1. Configure the loadbalancer setting in the service.yml file.

  2. Run and check the loadbalancer service.

  3. Check the service list to find the IP and port to be able to access.

  4. Now use the CURL command to access the LB URL.

    curl -L <cluster-ip>:<service-port>

    Thanks for reading my article. Have a nice day.

WRITTEN BY Biswaraj Sahoo --AWS Community Builder | DevOps Engineer | Docker | Linux | Jenkins | AWS | Git | Terraform | Docker | kubernetes

Empowering communities via open source and education. Connect with me over linktree: linktr.ee/biswaraj333