0
0
Kubernetesdevops~30 mins

Endpoints and endpoint slices in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Working with Kubernetes Endpoints and EndpointSlices
📖 Scenario: You are managing a Kubernetes cluster where you want to understand how services connect to pods. Kubernetes uses Endpoints and EndpointSlices to track which pods are behind a service.In this project, you will create a simple service and then explore its endpoints and endpoint slices to see how Kubernetes tracks pod IPs.
🎯 Goal: Learn how to list and inspect Kubernetes Endpoints and EndpointSlices for a service to understand pod connectivity.
📋 What You'll Learn
Use kubectl commands to create and inspect resources
Create a simple service and deployment
List endpoints and endpoint slices for the service
Understand the output showing pod IP addresses
💡 Why This Matters
🌍 Real World
Kubernetes uses Endpoints and EndpointSlices to keep track of which pods are available for a service. This helps route traffic correctly inside the cluster.
💼 Career
Understanding Endpoints and EndpointSlices is important for Kubernetes administrators and DevOps engineers to troubleshoot service connectivity and optimize cluster networking.
Progress0 / 4 steps
1
Create a Deployment with 2 Pods
Use kubectl create deployment to create a deployment named myapp with image nginx and scale it to 2 replicas using kubectl scale.
Kubernetes
Need a hint?

First create the deployment, then scale it to 2 pods.

2
Create a Service to Expose the Deployment
Create a service named myapp-service of type ClusterIP that targets the deployment myapp on port 80 using kubectl expose deployment.
Kubernetes
Need a hint?

Use kubectl expose deployment with the correct name, port, and type.

3
List Endpoints for the Service
Use kubectl get endpoints myapp-service to list the endpoints showing pod IPs behind the service.
Kubernetes
Need a hint?

This command shows the IP addresses of pods behind the service.

4
List EndpointSlices for the Service
Use kubectl get endpointslices -l kubernetes.io/service-name=myapp-service to list the EndpointSlices associated with the service.
Kubernetes
Need a hint?

Use the label selector to find EndpointSlices for the service.