Speeeechh
s lide :Why do we need
Services?
Pods in Kubernetes are ephemeral—they can be created,
destroyed, or moved around frequently. This means their IP
addresses can change.
If you directly relied on Pod IPs to communicate with your
application, you’d run into problems every time a Pod is
replaced or rescheduled.
A Service solves this problem by providing a stable IP
address and DNS name that doesn’t change, even if the
Pods behind it do.
lide What is a Service in
s
Kubernetes?
A Service in Kubernetes is like a "front door" or a "stable
address" for a group of Pods. It allows you to access a set of
Pods (which are running your application) in a
predictable and reliable way,even if the Pods themselves
are constantly changing.
Key Differences Between Namespaces, DNS, and Services
Feature Namespace DNS Service
Purpose Organizes and isolates Resolves names to IP Provides stable access to pods.
resources. addresses.
Scope Logical grouping of Cluster-wide name Defines access to a set of
resources. resolution. pods.
Example dev, prod, test namespa my- ClusterIP, NodePort, LoadBala
ces. service.dev.svc.cluster.lo ncer.
cal.
Isolation Yes (resources are No (DNS is cluster-wide). No (Services are scoped to a
isolated by namespace). namespace).
Dependen Independent. Depends on Services for Depends on pods and
cy DNS records. namespaces.
Slide scenario : prometheus
A specific server ran out of memory and stopped a running container. This container was
responsible for synchronizing data between two database pods in a Kubernetes cluster. As a
result, both database pods failed.
These databases were used by an authentication service, which also stopped working because
it could no longer access the data. Consequently, the application that depended on this
authentication service could no longer authenticate users.
From the user's perspective, all they saw was an error in the UI, preventing them from logging
in.
Slide pull basedd
This statement means that for Prometheus to collect and monitor your application’s data, your
application containers must expose their internal metrics via a dedicated API endpoint. In practical
terms, you need to instrument your application—that is, add code (using a Prometheus client library)
that creates an HTTP endpoint (typically at “/metrics”) where metrics data (such as request counts,
error rates, response times, etc.) is formatted in a way that Prometheus understands. Without this
metric API in your containers, Prometheus wouldn’t have any data to scrape, and you wouldn’t be
able to monitor the application’s performance or trigger alerts based on those metrics.