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

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
Navigate to the server and create a service.yaml file.
Write the Service.yaml file.

Run the service.yaml file using the below command.

Check the service is running or not.

Now check if the URL is running on the server.


Task-2: Create a ClusterIP Service
Add the Cluster IP settings to the service.yaml file.

Run the service.yaml file.

Navigate to a Pod and run the CURL command to access the URL.
kubectl exec -it <pod-name> -n <namespace> -- bashcurl -L <cluster-ip>:<service-port>
Task-3: Create a LoadBalancer Service
Configure the loadbalancer setting in the service.yml file.

Run and check the loadbalancer service.

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

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


