Skip to main content

Command Palette

Search for a command to run...

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

Updated
2 min read
DevOps(Day-34) :  Working with Services in Kubernetes
B

I like to explore the technology in DevOps area where I write blog about my learning each day on the tools that is mostly used in Industries for DevOps practices. You can go through my blogs and reach me out in LinkedIn for any suggestions.

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.

     kubectl exec -it <pod-name> -n <namespace> -- bash
    
     curl -L <cluster-ip>:<service-port>
    

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.

    You can follow me on LinkedIn for my daily updates:- linkedin.com/in/bandan-kumar-sahoo-131412203

More from this blog

Untitled Publication

98 posts