Skip to content

Commit 72b9f09

Browse files
Tim Bannisterdivya-mohan0209
andcommitted
Revise introduction to Service page
Co-authored-by: Divya Mohan <[email protected]>
1 parent 6d47dee commit 72b9f09

File tree

1 file changed

+43
-20
lines changed
  • content/en/docs/concepts/services-networking

1 file changed

+43
-20
lines changed

content/en/docs/concepts/services-networking/service.md

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,23 @@ weight: 10
1818

1919
{{< glossary_definition term_id="service" length="short" >}}
2020

21-
With Kubernetes you don't need to modify your application to use an unfamiliar service discovery mechanism.
22-
Kubernetes gives Pods their own IP addresses and a single DNS name for a set of Pods,
23-
and can load-balance across them.
21+
A key aim of Services in Kubernetes is that you don't need to modify your existing
22+
application to use an unfamiliar service discovery mechanism.
23+
You can run code in Pods, whether this is a code designed for a cloud-native world, or
24+
an older app you've containerized. You use a Service to make that set of Pods available
25+
on the network so that clients can interact with it.
2426

25-
<!-- body -->
26-
27-
## Motivation
28-
29-
Kubernetes {{< glossary_tooltip term_id="pod" text="Pods" >}} are created and destroyed
30-
to match the desired state of your cluster. Pods are nonpermanent resources.
3127
If you use a {{< glossary_tooltip term_id="deployment" >}} to run your app,
32-
it can create and destroy Pods dynamically.
28+
that Deployment can create and destroy Pods dynamically. From one moment to the next,
29+
you don't know how many of those Pods are working and healthy; you might not even know
30+
what those healthy Pods are named.
31+
Kubernetes {{< glossary_tooltip term_id="pod" text="Pods" >}} are created and destroyed
32+
to match the desired state of your cluster. Pods are emphemeral resources (you should not
33+
expect that an individual Pod is reliable and durable).
3334

34-
Each Pod gets its own IP address, however in a Deployment, the set of Pods
35-
running in one moment in time could be different from
36-
the set of Pods running that application a moment later.
35+
Each Pod gets its own IP address (Kubernetes expects network plugins to ensure this).
36+
For a given Deployment in your cluster, the set of Pods running in one moment in
37+
time could be different from the set of Pods running that application a moment later.
3738

3839
This leads to a problem: if some set of Pods (call them "backends") provides
3940
functionality to other Pods (call them "frontends") inside your cluster,
@@ -42,14 +43,13 @@ to, so that the frontend can use the backend part of the workload?
4243

4344
Enter _Services_.
4445

45-
## Service resources {#service-resource}
46+
<!-- body -->
4647

47-
In Kubernetes, a Service is an abstraction which defines a logical set of Pods
48-
and a policy by which to access them (sometimes this pattern is called
49-
a micro-service). The set of Pods targeted by a Service is usually determined
50-
by a {{< glossary_tooltip text="selector" term_id="selector" >}}.
51-
To learn about other ways to define Service endpoints,
52-
see [Services _without_ selectors](#services-without-selectors).
48+
## Services in Kubernetes
49+
50+
The Service API, part of Kubernetes, is an abstraction to help you expose groups of
51+
Pods over a network. Each Service object defines a logical set of endpoints (usually
52+
these endpoints are Pods) along with a policy about how to make those pods accessible.
5353

5454
For example, consider a stateless image-processing backend which is running with
5555
3 replicas. Those replicas are fungible&mdash;frontends do not care which backend
@@ -59,6 +59,26 @@ track of the set of backends themselves.
5959

6060
The Service abstraction enables this decoupling.
6161

62+
The set of Pods targeted by a Service is usually determined
63+
by a {{< glossary_tooltip text="selector" term_id="selector" >}} that you
64+
define.
65+
To learn about other ways to define Service endpoints,
66+
see [Services _without_ selectors](#services-without-selectors).
67+
68+
If your workload speaks HTTP, you might choose to use an
69+
[Ingress](/docs/concepts/services-networking/ingress/) to control how web traffic
70+
reaches that workload.
71+
Ingress is not a Service type, but it acts as the entry point for your
72+
cluster. An Ingress lets you consolidate your routing rules into a single resource, so
73+
that you can expose multiple components of your workload, running separately in your
74+
cluster, behind a single listener.
75+
76+
The [Gateway](https://gateway-api.sigs.k8s.io/#what-is-the-gateway-api) API for Kubernetes
77+
provides extra capabilities beyond Ingress and Service. You can add Gateway to your cluster -
78+
it is a family of extension APIs, implemented using
79+
{{< glossary_tooltip term_id="CustomResourceDefinition" text="CustomResourceDefinitions" >}} -
80+
and then use these to configure access to network services that are running in your cluster.
81+
6282
### Cloud-native service discovery
6383

6484
If you're able to use Kubernetes APIs for service discovery in your application,
@@ -69,6 +89,9 @@ whenever the set of Pods in a Service changes.
6989
For non-native applications, Kubernetes offers ways to place a network port or load
7090
balancer in between your application and the backend Pods.
7191

92+
Either way, your workload can use these [service discovery](#discovering-services)
93+
mechanisms to find the target it wants to connect to.
94+
7295
## Defining a Service
7396

7497
A Service in Kubernetes is a REST object, similar to a Pod. Like all of the

0 commit comments

Comments
 (0)