Kubernetes Service
The Kubernetes object that gives a changing set of pods one stable name and address, and spreads traffic across the ready ones.
In more detail
Pods come and go and their IP addresses change, so clients talk to the Service instead. A label selector chooses the pods, EndpointSlices list the ready ones, and cluster DNS gives the Service a name. The type, ClusterIP, NodePort, LoadBalancer or ExternalName, decides where it can be reached from.
Example
kubectl get svc webRelated terms
- label selector — A query that picks objects by their labels, such as every pod with app=web; controllers and Services depend on it.
- blue-green deployment — Running two complete environments, blue for the current release and green for the candidate, and switching traffic between them in one step.
- port — A number from 1 to 65535 that picks out one service on a machine, such as 22 for SSH or 80 for plain web traffic.
- NodePort — A Service type that opens the same port, by default in the range 30000 to 32767, on every node and forwards it to the Service.
- EndpointSlice — The object that lists the actual pod addresses behind a Service and whether each one is ready.
- CoreDNS — The DNS server that runs inside a Kubernetes cluster and resolves Service and pod names.
- ClusterIP — The default Service type: a stable virtual IP address reachable only from inside the cluster.
- LoadBalancer Service — A Service type that asks the platform, usually a cloud provider, to create an external load balancer with its own address pointing at the Service.
- ExternalName — A Service type that has no pods behind it and simply answers DNS lookups with another host name.
- Ingress — A Kubernetes object that describes how outside HTTP traffic reaches services inside the cluster, by host name and URL path.
- transport layer — The layer that carries data between programs on two machines, identified by port numbers, using TCP or UDP.
- load balancer — A server that spreads incoming requests across several copies of a service so no single copy is overloaded.
Related guides
- CKA vs CKAD: which Kubernetes exam should you take first?
- Kubernetes Services: ClusterIP vs NodePort vs LoadBalancer
Taught in
- Sync Waves and Dependency Management — Continuous Integration & Continuous Delivery Pipelines
- Blue-Green Deployments — Continuous Integration & Continuous Delivery Pipelines
- Rolling Back Blue-Green — Continuous Integration & Continuous Delivery Pipelines
- Generators Write The YAML, You Decide — Certified Kubernetes Administrator (CKA) Exam Prep
- Node NotReady: Kubelet, Runtime And Certificates — Certified Kubernetes Administrator (CKA) Exam Prep
- What A Container Said Before It Died — Certified Kubernetes Administrator (CKA) Exam Prep
- A Service With Nobody Behind It — Certified Kubernetes Administrator (CKA) Exam Prep
- The Name That Will Not Resolve — Certified Kubernetes Administrator (CKA) Exam Prep
- Blocked On Purpose: Opening One Path Through Default Deny — Certified Kubernetes Administrator (CKA) Exam Prep
- Four Faults, Twelve Minutes — Certified Kubernetes Administrator (CKA) Exam Prep
- RBAC: From Everything To Exactly Enough — Certified Kubernetes Administrator (CKA) Exam Prep
- Services And Empty Endpoints — Certified Kubernetes Application Developer (CKAD) Exam Prep
- One Command, Six Programs — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Who Owns The Symptom: Control Plane And Nodes — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Five Jobs, Five Workloads — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- A Name That Outlives Its Pods: Services And DNS — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Not The Admin Certificate: RBAC And ServiceAccounts — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Fundamentals Sprint: Four Tickets Before The Doors Open — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Who May Call Payments: Pod Networking And Policy — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- The Status Tells You Where To Look: Troubleshooting Pods — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Orchestration Sprint: Four Fixes, No Walls Removed — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Always A Way Back: Rolling, Blue/Green And Canary — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Running, Green And Still Broken: Debugging Applications — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Delivery Sprint: Friday At Five — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Architecture Sprint: The Refunds Review — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Forty Four Of Sixty: The Full Mock, And How To Read It — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- The Festival, End To End: Final Review — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Worker Nodes: kubelet, Runtime, CNI And kube-proxy — Kubernetes: Production-Grade Container Orchestration
- Pods, Init Containers And Sidecars — Kubernetes: Production-Grade Container Orchestration
- DaemonSets And Node Services — Kubernetes: Production-Grade Container Orchestration
- ClusterIP, Selectors, EndpointSlices And DNS — Kubernetes: Production-Grade Container Orchestration
- NodePort, LoadBalancer And ExternalName — Kubernetes: Production-Grade Container Orchestration
- Ingress: Controllers, Hosts, Paths And TLS — Kubernetes: Production-Grade Container Orchestration
- Gateway API: GatewayClass, Gateway And HTTPRoute — Kubernetes: Production-Grade Container Orchestration
- NetworkPolicy And The Consul Service Mesh Boundary — Kubernetes: Production-Grade Container Orchestration
- Requirements: The Constraints That Shape The System — Scalable System Design & Distributed Architecture
- Back Of The Envelope Estimation: Storage And Bandwidth — Scalable System Design & Distributed Architecture
- Latency Numbers Every Engineer Should Know — Scalable System Design & Distributed Architecture
- The Storage Decision: Key Value, Search And Blob — Scalable System Design & Distributed Architecture
- Replication, Failover And Leader Election — Scalable System Design & Distributed Architecture
- The Difference Between A Queue And A Log — Scalable System Design & Distributed Architecture
- Load Balancing And The Failure Modes It Introduces — Scalable System Design & Distributed Architecture
- Timeouts, And Avoiding Cascaded Failure — Scalable System Design & Distributed Architecture
- Retries, Backoff And Jitter — Scalable System Design & Distributed Architecture
- Backpressure And Load Shedding — Scalable System Design & Distributed Architecture
- Monolith Versus Services: The Honest Trade Offs — Scalable System Design & Distributed Architecture
- Observability As A Design Input — Scalable System Design & Distributed Architecture
- Capacity Planning As A Design Input — Scalable System Design & Distributed Architecture
- Worked Design Two: A Global Chat System — Scalable System Design & Distributed Architecture