From f77d61aafc79c95a54bd9de5fb50ed1fbd2548cd Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Thu, 26 Oct 2023 16:52:45 -0400 Subject: [PATCH] Backport of Add note about service upstream env var dot broken into release/1.16.x (#19398) backport of commit 8a0896d379abf684e82a8a1f436a5758402e94f6 Co-authored-by: Tu Nguyen --- website/content/docs/k8s/annotations-and-labels.mdx | 8 +++++++- website/content/docs/k8s/connect/index.mdx | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/website/content/docs/k8s/annotations-and-labels.mdx b/website/content/docs/k8s/annotations-and-labels.mdx index 0735ede6c..78e9860a9 100644 --- a/website/content/docs/k8s/annotations-and-labels.mdx +++ b/website/content/docs/k8s/annotations-and-labels.mdx @@ -81,7 +81,13 @@ The following Kubernetes resource annotations could be used on a pod to control local port to listen for those connections. When transparent proxy is enabled, this annotation is optional. This annotation can be either _labeled_ or _unlabeled_. We recommend the labeled format because it has a more consistent syntax and can be used to reference cluster peers as upstreams. - - **Labeled**: + + + If the upstream annotation contains a dot (for example, `static-server.svc:8080`), you may not be able to reference the auto-generated environment variables (`_CONNECT_SERVICE_HOST` and `_CONNECT_SERVICE_PORT`) since the environment variables will also contain the dot. + + + + - **Labeled**: The labeled annotation format allows you to reference any service as an upstream. You can specify a Consul Enterprise namespace. You can also specify an admin partition in the same datacenter, a cluster peer, or a WAN-federated datacenter. diff --git a/website/content/docs/k8s/connect/index.mdx b/website/content/docs/k8s/connect/index.mdx index 393d509d5..a481b77e2 100644 --- a/website/content/docs/k8s/connect/index.mdx +++ b/website/content/docs/k8s/connect/index.mdx @@ -168,6 +168,12 @@ upstream. This is analogous to the standard Kubernetes service environment varia point instead to the correct local proxy port to establish connections via service mesh. + + +If the upstream annotation contains a dot (for example, `static-server.svc:8080`), you may not be able to reference the auto-generated environment variables (`_CONNECT_SERVICE_HOST` and `_CONNECT_SERVICE_PORT`) since the environment variables will also contain the dot. + + + You can verify access to the static text server using `kubectl exec`. Because transparent proxy is enabled by default, use Kubernetes DNS to connect to your desired upstream.