DevOps, Day - 34

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.

instead of the todo-app, I have chosen the vk-notes-app to complete this task.

Step 1: Create a Service YAML File (service.yml)

Step 2: Apply the Service Definition

kubectl apply -f service.yml -n <namespace-name>

Step 3: Verify the Service

minikube service notes-app-service -n <namespace-name>


Step 1: Update the ClusterIP Service YAML File (cluster-ip-service.yml)

Step 2: Apply the Updated ClusterIP Service Definition

kubectl apply -f cluster-ip-service.yml -n <namespace-name>

Step 3: create a simple test Pod

Step 4: Apply the test Pod YAML

kubectl apply -f test-pod.yml -n <namespace-name>

Step 5: Once the test Pod is running, you can use kubectl exec to access it

kubectl exec -it test-pod -n <namespace-name> -- /bin/sh

Yes, it appears that we have successfully accessed the test Pod named "test-pod" within the "my-notes-app" namespace. we are now inside the test Pod, as indicated by the / # prompt.


Step 1: Create a NodePort Service YAML File (load-balancer-service.yml)

Step 2: Apply the LoadBalancer Service Definition

Step 3: Verify the LoadBalancer Service


Thank you so much for reading

Follow me on LinkedIn to see interesting posts like this : )

Linkedin

12
Subscribe to my newsletter

Read articles from Vrishni Shree V B directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vrishni Shree V B
Vrishni Shree V B

๐Ÿ’ป Python | Docker | Jenkins | Networking | Git | Linux ๐Ÿ’ป Passionate about leveraging technology to drive efficiency and deliver innovative solutions. Proficient in Python development, Docker containerization, Jenkins automation, computer networking, Git version control, and Linux administration. Skilled in collaborating with diverse teams to deliver high-quality software products. Proficient in AWS EC2 instance management and deployment. Seeking new opportunities to apply my expertise and contribute to impactful projects. Let's connect and explore how we can work together! Inter-personal Skills: Communication, Adaptability, Emotional intelligence, Active listening, Collaboration. Happy To Connect๐Ÿ”—๐Ÿ˜Š Feel free to reach me out๐Ÿ˜ƒ@ --> vrishnishreevb531@gmail.com ๐Ÿ“ฌ