Day 34 : Working with Services in Kubernetes

Day 34 : Working with Services in Kubernetes


Task-1:

- Create a Service for your todo-app Deployment from Day-32

- Create a Service definition for your todo-app Deployment in a YAML file.

- Apply the Service definition to your K8s (minikube) cluster using the `kubectl apply -f service.yml -n <namespace-name>` command.

- Verify that the Service is working by accessing the todo-app using the Service's IP and Port in your Namespace.


kubectl apply -f service.yml -n <namespace-name>
kubectl get svc -n <namespace>
minikube service <service_name> -n=<namespace> --url
curl -L <service-ip>:<service-port>
curl -L https://192.168.49.2:30080
        


No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image


Task-2:

- Create a ClusterIP Service for accessing the todo-app from within the cluster

- Create a ClusterIP Service definition for your todo-app Deployment in a YAML file.

- Apply the ClusterIP Service definition to your K8s (minikube) cluster using the `kubectl apply -f cluster-ip-service.yml -n <namespace-name>` command.

- Verify that the ClusterIP Service is working by accessing the todo-app from another Pod in the cluster in your Namespace.


kubectl get services -n <namespace>
kubectl get pods -n <namespace> 
kubectl exec -it <pod-name> -n <namespace> -- bash 
curl -L <cluster-ip>:<service-port> 
curl -L 10.102.44.73:8000         


No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image


Task-3:

- Create a LoadBalancer Service for accessing the todo-app from outside the cluster

- Create a LoadBalancer Service definition for your todo-app Deployment in a YAML file.

- Apply the LoadBalancer Service definition to your K8s (minikube) cluster using the `kubectl apply -f load-balancer-service.yml -n <namespace-name>` command.

- Verify that the LoadBalancer Service is working by accessing the todo-app from outside the cluster in your Namespace.


kubectl get services -n <namespace>
minikube service list
curl -L <load-balancer-ip>:<service-port> 
curl -L https://192.168.49.2:30625         


No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Service List:

No alt text provided for this image
Anup D Ghattikar

Software Developer | Python | Django | Mysql | Devops

2 年

This is my first Challenge and this is going to be make a more opportunity in my life Shubham Londhe thank you brother for making this type of Challenge and building a community for #devops #thankyou

回复

要查看或添加评论,请登录

Anup D Ghattikar的更多文章

  • Django Rest Framework

    Django Rest Framework

    Introduction to Django Rest Framework Django REST framework (DRF) is a powerful and elegant toolkit built on top of the…

    11 条评论
  • Docker Tool Mastering

    Docker Tool Mastering

    What is Docker? Docker is a platform and toolset that simplifies the process of developing, deploying, and running…

    4 条评论
  • Devop's Bits & Byte's - By Anup Ghattikar

    Devop's Bits & Byte's - By Anup Ghattikar

    Medium Link: https://medium.com/@aghattikar82/devops-bits-bytes-by-anup-ghattikar-9a8c6b788ec9 HashNode Link:…

    10 条评论
  • Kubernetes Troubleshooting

    Kubernetes Troubleshooting

    Cluster Management Display endpoint information about the master and services in the cluster kubectl cluster-info…

    3 条评论
  • Kubernetes Cluster Maintenance

    Kubernetes Cluster Maintenance

    Kubernetes Cluster Upgrade Upgrade master Upgrading the control plane consist of the following steps: Upgrade kubeadm…

    2 条评论
  • Day 05:Kubernetes Storage Kubernetes Security

    Day 05:Kubernetes Storage Kubernetes Security

    Persistent Volumes Managing storage is a distinct problem from managing compute instances. The PersistentVolume…

  • Kubernetes services and service discovery

    Kubernetes services and service discovery

    Kubernetes is a powerful platform for deploying, scaling, and managing containerized applications. However, once you…

  • Day 03:Kubernetes Workloads

    Day 03:Kubernetes Workloads

    Kubernetes Deployment with YAML YAML (which stands for YAML Ain’t Markup Language) is a language used to provide…

    2 条评论
  • Kubernetes Networking

    Kubernetes Networking

    Topics Are: Services, Ingress, Network Policies, DNS, CNI Plugins Services Services provide a way to expose a set of…

    7 条评论
  • Day 70 - Terraform Modules

    Day 70 - Terraform Modules

    Modules are containers for multiple resources that are used together. A module consists of a collection of .

    2 条评论

社区洞察

其他会员也浏览了