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
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.
3. Navigate to a Pod and run the CURL command to access the URL.
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.
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