From 07d137ee1c54b974a8cdbaa22480b71eecccf2db Mon Sep 17 00:00:00 2001 From: Joshua Perry Date: Tue, 7 Jun 2016 15:33:26 -0600 Subject: [PATCH 1/3] How selectors interact with headless services There was no information on how the system handles headless services differently. --- docs/user-guide/services/index.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/user-guide/services/index.md b/docs/user-guide/services/index.md index 334e53df8d..2084733810 100644 --- a/docs/user-guide/services/index.md +++ b/docs/user-guide/services/index.md @@ -317,18 +317,27 @@ Sometimes you don't need or want load-balancing and a single service IP. In this case, you can create "headless" services by specifying `"None"` for the cluster IP (`spec.clusterIP`). -For such `Services`, a cluster IP is not allocated. DNS is configured to return -multiple A records (addresses) for the `Service` name, which point directly to -the `Pods` backing the `Service`. Additionally, the kube proxy does not handle -these services and there is no load balancing or proxying done by the platform -for them. The endpoints controller will still create `Endpoints` records in -the API. - This option allows developers to reduce coupling to the Kubernetes system, if they desire, but leaves them freedom to do discovery in their own way. Applications can still use a self-registration pattern and adapters for other discovery systems could easily be built upon this API. +For such `Services` a cluster IP is not allocated, the kube proxy does not handle +these services, and there is no load balancing or proxying done by the platform +for them. How DNS is automatically configured depends on if the service has +selectors or not. + +### With selectors +For headless services that define selectors, the endpoints controller will still +create `Endpoints` records in the API, and DNS is configured to return multiple A +records (addresses) for the `Service` name which point directly to the `Pods` +backing the `Service`. + +### Without selectors +For headless services that do not define selectors, the endpoints controller does +not create `Endpoints` records. However, the DNS system looks for and configures +A records for any `Endpoints` that share a name with the service. + ## Publishing services - service types For some parts of your application (e.g. frontends) you may want to expose a From f066890632ddae67b0c496871d17704e3defb981 Mon Sep 17 00:00:00 2001 From: Joshua Perry Date: Thu, 9 Jun 2016 14:04:30 -0600 Subject: [PATCH 2/3] Delint --- docs/user-guide/services/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/user-guide/services/index.md b/docs/user-guide/services/index.md index 2084733810..587a740fea 100644 --- a/docs/user-guide/services/index.md +++ b/docs/user-guide/services/index.md @@ -328,12 +328,14 @@ for them. How DNS is automatically configured depends on if the service has selectors or not. ### With selectors + For headless services that define selectors, the endpoints controller will still create `Endpoints` records in the API, and DNS is configured to return multiple A records (addresses) for the `Service` name which point directly to the `Pods` backing the `Service`. ### Without selectors + For headless services that do not define selectors, the endpoints controller does not create `Endpoints` records. However, the DNS system looks for and configures A records for any `Endpoints` that share a name with the service. From 015ee234502865c6370df42c44ea4acebcbd2676 Mon Sep 17 00:00:00 2001 From: Joshua Perry Date: Thu, 9 Jun 2016 14:10:20 -0600 Subject: [PATCH 3/3] Wording update --- docs/user-guide/services/index.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/user-guide/services/index.md b/docs/user-guide/services/index.md index 587a740fea..b34ce10d7c 100644 --- a/docs/user-guide/services/index.md +++ b/docs/user-guide/services/index.md @@ -329,10 +329,9 @@ selectors or not. ### With selectors -For headless services that define selectors, the endpoints controller will still -create `Endpoints` records in the API, and DNS is configured to return multiple A -records (addresses) for the `Service` name which point directly to the `Pods` -backing the `Service`. +For headless services that define selectors, the endpoints controller creates +`Endpoints` records in the API, and modifies the DNS configuration to return A +records (addresses) which point directly to the `Pods` backing the `Service`. ### Without selectors