From 70c8f9de31fc928c46712c7b726404d67ad7ee36 Mon Sep 17 00:00:00 2001 From: Nitya Dhanushkodi Date: Mon, 20 Jun 2022 09:34:59 -0700 Subject: [PATCH 1/6] upstream annotation --- .../docs/k8s/annotations-and-labels.mdx | 125 ++++++++++++------ 1 file changed, 87 insertions(+), 38 deletions(-) diff --git a/website/content/docs/k8s/annotations-and-labels.mdx b/website/content/docs/k8s/annotations-and-labels.mdx index b98346563d..9f5608fba0 100644 --- a/website/content/docs/k8s/annotations-and-labels.mdx +++ b/website/content/docs/k8s/annotations-and-labels.mdx @@ -69,53 +69,102 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje local port to listen for those connections. When transparent proxy is enabled, this annotation is optional. - - Services + - There are a few formats this annotation can take: - The name of the service is the name of the service registered with Consul. You can optionally specify datacenters with this annotation. + - Unlabeled: + The unlabeled annotation format supports specifying service name, Consul Enterprise Namespaces and Partitions, + and datacenter. To use [cluster peering](/docs/connect/cluster-peering/k8s) with upstreams, use the labeled format below. + - Service Name + To specify the upstream service, you can provide the name of the service, and optionally, it's datacenter. + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter]" + ``` - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter]" - ``` + - Consul Enterprise Namespace + When using Consul Enterprise Namespaces [1.7+], your upstream services may be running in different namespaces. + The upstream namespace can be specified after the service name as `[service-name].[namespace]`. See [Consul + Enterprise Namespaces](#consul-enterprise-namespaces) below for more details on configuring the injector. + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace]:[port]:[optional datacenter]" + ``` + -> **NOTE:** If the namespace is not specified it will default to the namespace + of the source service. - - Consul Enterprise Namespaces + ~> **WARNING:** Setting a namespace when not using Consul Enterprise or using a version < 1.7 + is not supported. It will be treated as part of the service name. - If running Consul Enterprise 1.7+, your upstream services may be running in different - namespaces. The upstream namespace can be specified after the service name - as `[service-name].[namespace]`. See [Consul Enterprise Namespaces](#consul-enterprise-namespaces) - below for more details on configuring the injector. + - Consul Enterprise Admin Partition + When using Consul Enterprise Admin Partitions [1.11+], your upstream services may be running in a different + partition. You must specify the namespace when specifying a partition, and the datacenter must be your local + datacenter if specified. Communicating across partitions using this method is only supported within a + datacenter. For cross partition communication across datacenters, see [cluster + peering](/docs/connect/cluster-peering/k8s). + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace].[service-partition]:[port]:[optional datacenter]" + ``` + - [Prepared Query](/docs/connect/proxies#dynamic-upstreams-require-native-integration): + Prepared query upstreams can use the format below. + ```yaml + annotations: + 'consul.hashicorp.com/connect-service-upstreams': 'prepared_query:[query name]:[port]' + ``` - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace]:[port]:[optional datacenter]" - ``` + - Labeled (requires consul-k8s v0.45.0+): + The labeled format is required when using the cluster peering feature and specifying an upstream in another + peer. It also supports specifying Consul Enterprise Namespace, Partition, or Datacenter. Only one of peer, + datacenter, or partition can be specified. + - Service Name + To specify the upstream service, you can provide the name of the service, followed by `.svc`. + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc:[port]" + ``` + - Peer or Datacenter + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-peer].peer:[port]" + ``` + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-dc].dc:[port]" + ``` + - Consul Enterprise + You can specify a Consul Enterprise Namespace + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns:[port]" + ``` + When specifying a peer, datacenter or Consul Enterprise Admin Partition when namespaces are enabled, you must + provide the namespace and one of (peer, datacenter, partition). + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-peer].peer:[port]" + ``` + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-partition].ap:[port]" + ``` + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-dc].dc:[port]" + ``` - -> **NOTE:** If the namespace is not specified it will default to the namespace - of the source service. + - Multiple Upstreams - ~> **WARNING:** Setting a namespace when not using Consul Enterprise or using a version < 1.7 - is not supported. It will be treated as part of the service name. + If you would like to specify multiple services or upstreams, delimit them with commas. They can be of any of the Unlabeled, Labeled, or Prepared Query formats above when using the supported versions for the formats. - - [Prepared Query](/docs/connect/proxies#dynamic-upstreams-require-native-integration) + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter],[service-name]:[port]:[optional datacenter]" + ``` - ```yaml - annotations: - 'consul.hashicorp.com/connect-service-upstreams': 'prepared_query:[query name]:[port]' - ``` - - - Multiple Upstreams - - If you would like to specify multiple services or upstreams, delimit them with commas - - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter],[service-name]:[port]:[optional datacenter]" - ``` - - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter],prepared_query:[query name]:[port]" - ``` + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter],prepared_query:[query name]:[port],[service-name].svc:[port]" + ``` - `consul.hashicorp.com/envoy-extra-args` - A space-separated list of [arguments](https://www.envoyproxy.io/docs/envoy/latest/operations/cli) to be passed to the injected envoy binary. From 89f65a72d575332325ded42a9d9f4b62bdcef1b2 Mon Sep 17 00:00:00 2001 From: Nitya Dhanushkodi Date: Mon, 20 Jun 2022 17:15:33 -0700 Subject: [PATCH 2/6] Apply suggestions from code review Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> --- .../docs/k8s/annotations-and-labels.mdx | 46 +++++++------------ 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/website/content/docs/k8s/annotations-and-labels.mdx b/website/content/docs/k8s/annotations-and-labels.mdx index 9f5608fba0..e8b55dc31f 100644 --- a/website/content/docs/k8s/annotations-and-labels.mdx +++ b/website/content/docs/k8s/annotations-and-labels.mdx @@ -72,41 +72,32 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje - There are a few formats this annotation can take: - Unlabeled: - The unlabeled annotation format supports specifying service name, Consul Enterprise Namespaces and Partitions, - and datacenter. To use [cluster peering](/docs/connect/cluster-peering/k8s) with upstreams, use the labeled format below. - - Service Name - To specify the upstream service, you can provide the name of the service, and optionally, it's datacenter. + Use the unlabeled annotation format to specify a service name, Consul Enterprise namespaces and partitions, + and datacenters. To use [cluster peering](/docs/connect/cluster-peering/k8s) with upstreams, use the following labeled format. + - Service name: Place the service name at the beginning of the annotation to specify the upstream service. You can also append the datacenter where the service is deployed (optional). ```yaml annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter]" ``` - - Consul Enterprise Namespace - When using Consul Enterprise Namespaces [1.7+], your upstream services may be running in different namespaces. - The upstream namespace can be specified after the service name as `[service-name].[namespace]`. See [Consul - Enterprise Namespaces](#consul-enterprise-namespaces) below for more details on configuring the injector. + - Namespace (requires Consul Enterprise 1.7+): Upstream services may be running in different a namespace. Place the upstream namespace after the service name. Refer to [Consul Enterprise Namespaces](#consul-enterprise-namespaces) for additional details about configuring the injector. ```yaml annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace]:[port]:[optional datacenter]" ``` - -> **NOTE:** If the namespace is not specified it will default to the namespace - of the source service. + If the namespace is not specified, the annotation will default to the namespace of the source service. - ~> **WARNING:** Setting a namespace when not using Consul Enterprise or using a version < 1.7 - is not supported. It will be treated as part of the service name. + If you are not using Consul Enterprise 1.7+, Consul will interpret the value placed in the namespace position as part of the service name. - - Consul Enterprise Admin Partition - When using Consul Enterprise Admin Partitions [1.11+], your upstream services may be running in a different - partition. You must specify the namespace when specifying a partition, and the datacenter must be your local - datacenter if specified. Communicating across partitions using this method is only supported within a + - Admin partitions (requires Consul Enterprise 1.11+): Upstream services may be running in a different + partition. You must specify the namespace when specifying a partition. Place the partition name after the namespace. If you specify the name of the datacenter (optional), it must be the local datacenter. Communicating across partitions using this method is only supported within a datacenter. For cross partition communication across datacenters, see [cluster peering](/docs/connect/cluster-peering/k8s). ```yaml annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace].[service-partition]:[port]:[optional datacenter]" ``` - - [Prepared Query](/docs/connect/proxies#dynamic-upstreams-require-native-integration): - Prepared query upstreams can use the format below. + - [Prepared queries](/docs/connect/proxies#dynamic-upstreams-require-native-integration): Prepend the annotation with `prepared_query` and place the name of the query at the beginning of the string. ```yaml annotations: 'consul.hashicorp.com/connect-service-upstreams': 'prepared_query:[query name]:[port]' @@ -114,15 +105,13 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje - Labeled (requires consul-k8s v0.45.0+): The labeled format is required when using the cluster peering feature and specifying an upstream in another - peer. It also supports specifying Consul Enterprise Namespace, Partition, or Datacenter. Only one of peer, - datacenter, or partition can be specified. - - Service Name - To specify the upstream service, you can provide the name of the service, followed by `.svc`. + peer. You can specify a Consul Enterprise namespace, partition, or datacenter. The format supports only one peer, datacenter, or partition. + - Service name: Place the service name at the beginning of the annotation followed by `.svc` to specify the upstream service. ```yaml annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc:[port]" ``` - - Peer or Datacenter + - Peer or datacenter: Place the peer or datacenter after `svc.` followed by either `peer` or `dc` and the port number. ```yaml annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-peer].peer:[port]" @@ -131,14 +120,13 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-dc].dc:[port]" ``` - - Consul Enterprise - You can specify a Consul Enterprise Namespace + - Namespace (required Consul Enterprise): Place the namespace after `svc.` followed by `ns` and the port number. ```yaml annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns:[port]" ``` - When specifying a peer, datacenter or Consul Enterprise Admin Partition when namespaces are enabled, you must - provide the namespace and one of (peer, datacenter, partition). + When specifying a peer, datacenter, or admin partition when namespaces are enabled, you must + provide the namespace and a peer, datacenter, or partition. ```yaml annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-peer].peer:[port]" @@ -152,9 +140,7 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-dc].dc:[port]" ``` - - Multiple Upstreams - - If you would like to specify multiple services or upstreams, delimit them with commas. They can be of any of the Unlabeled, Labeled, or Prepared Query formats above when using the supported versions for the formats. + - Multiple upstreams: Delimit multiple services or upstreams with commas. You can specify any of the unlabeled, labeled, or prepared query formats when using the supported versions for the formats. ```yaml annotations: From ec717ddd1cdf9683f062fe50a193ef4cf0c6fb4e Mon Sep 17 00:00:00 2001 From: Nitya Dhanushkodi Date: Mon, 20 Jun 2022 17:21:55 -0700 Subject: [PATCH 3/6] un nest the sections --- .../docs/k8s/annotations-and-labels.mdx | 131 +++++++++--------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/website/content/docs/k8s/annotations-and-labels.mdx b/website/content/docs/k8s/annotations-and-labels.mdx index e8b55dc31f..1e4d5533c2 100644 --- a/website/content/docs/k8s/annotations-and-labels.mdx +++ b/website/content/docs/k8s/annotations-and-labels.mdx @@ -67,27 +67,27 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje - `consul.hashicorp.com/connect-service-upstreams` - The list of upstream services that this pod needs to connect to via Connect along with a static local port to listen for those connections. When transparent proxy is enabled, - this annotation is optional. + this annotation is optional. There are a few formats this annotation can take: - - There are a few formats this annotation can take: - - - Unlabeled: - Use the unlabeled annotation format to specify a service name, Consul Enterprise namespaces and partitions, - and datacenters. To use [cluster peering](/docs/connect/cluster-peering/k8s) with upstreams, use the following labeled format. - - Service name: Place the service name at the beginning of the annotation to specify the upstream service. You can also append the datacenter where the service is deployed (optional). - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter]" - ``` - - - Namespace (requires Consul Enterprise 1.7+): Upstream services may be running in different a namespace. Place the upstream namespace after the service name. Refer to [Consul Enterprise Namespaces](#consul-enterprise-namespaces) for additional details about configuring the injector. - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace]:[port]:[optional datacenter]" - ``` - If the namespace is not specified, the annotation will default to the namespace of the source service. - - If you are not using Consul Enterprise 1.7+, Consul will interpret the value placed in the namespace position as part of the service name. + - Unlabeled: + Use the unlabeled annotation format to specify a service name, Consul Enterprise namespaces and partitions, and + datacenters. To use [cluster peering](/docs/connect/cluster-peering/k8s) with upstreams, use the following + labeled format. + - Service name: Place the service name at the beginning of the annotation to specify the upstream service. You can + also append the datacenter where the service is deployed (optional). + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter]" + ``` + - Namespace (requires Consul Enterprise 1.7+): Upstream services may be running in different a namespace. Place + the upstream namespace after the service name. Refer to [Consul Enterprise + Namespaces](#consul-enterprise-namespaces) for additional details about configuring the injector. + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace]:[port]:[optional datacenter]" + ``` + If the namespace is not specified, the annotation will default to the namespace of the source service. + If you are not using Consul Enterprise 1.7+, Consul will interpret the value placed in the namespace position as part of the service name. - Admin partitions (requires Consul Enterprise 1.11+): Upstream services may be running in a different partition. You must specify the namespace when specifying a partition. Place the partition name after the namespace. If you specify the name of the datacenter (optional), it must be the local datacenter. Communicating across partitions using this method is only supported within a @@ -97,60 +97,61 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace].[service-partition]:[port]:[optional datacenter]" ``` - - [Prepared queries](/docs/connect/proxies#dynamic-upstreams-require-native-integration): Prepend the annotation with `prepared_query` and place the name of the query at the beginning of the string. + - [Prepared queries](/docs/connect/proxies#dynamic-upstreams-require-native-integration): Prepend the annotation + with `prepared_query` and place the name of the query at the beginning of the string. + ```yaml + annotations: + 'consul.hashicorp.com/connect-service-upstreams': 'prepared_query:[query name]:[port]' + ``` + + - Labeled (requires consul-k8s v0.45.0+): + The labeled format is required when using the cluster peering feature and specifying an upstream in another + peer. You can specify a Consul Enterprise namespace, partition, or datacenter. The format supports only one peer, datacenter, or partition. + - Service name: Place the service name at the beginning of the annotation followed by `.svc` to specify the upstream service. ```yaml annotations: - 'consul.hashicorp.com/connect-service-upstreams': 'prepared_query:[query name]:[port]' + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc:[port]" ``` - - - Labeled (requires consul-k8s v0.45.0+): - The labeled format is required when using the cluster peering feature and specifying an upstream in another - peer. You can specify a Consul Enterprise namespace, partition, or datacenter. The format supports only one peer, datacenter, or partition. - - Service name: Place the service name at the beginning of the annotation followed by `.svc` to specify the upstream service. - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc:[port]" - ``` - - Peer or datacenter: Place the peer or datacenter after `svc.` followed by either `peer` or `dc` and the port number. - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-peer].peer:[port]" - ``` - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-dc].dc:[port]" - ``` - - Namespace (required Consul Enterprise): Place the namespace after `svc.` followed by `ns` and the port number. - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns:[port]" - ``` - When specifying a peer, datacenter, or admin partition when namespaces are enabled, you must - provide the namespace and a peer, datacenter, or partition. - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-peer].peer:[port]" - ``` - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-partition].ap:[port]" - ``` - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-dc].dc:[port]" - ``` - - - Multiple upstreams: Delimit multiple services or upstreams with commas. You can specify any of the unlabeled, labeled, or prepared query formats when using the supported versions for the formats. - + - Peer or datacenter: Place the peer or datacenter after `svc.` followed by either `peer` or `dc` and the port number. ```yaml annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter],[service-name]:[port]:[optional datacenter]" + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-peer].peer:[port]" ``` - ```yaml annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter],prepared_query:[query name]:[port],[service-name].svc:[port]" + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-dc].dc:[port]" ``` + - Namespace (required Consul Enterprise): Place the namespace after `svc.` followed by `ns` and the port number. + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns:[port]" + ``` + When specifying a peer, datacenter, or admin partition when namespaces are enabled, you must + provide the namespace and a peer, datacenter, or partition. + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-peer].peer:[port]" + ``` + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-partition].ap:[port]" + ``` + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-dc].dc:[port]" + ``` + + - Multiple upstreams: Delimit multiple services or upstreams with commas. You can specify any of the unlabeled, labeled, or prepared query formats when using the supported versions for the formats. + + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter],[service-name]:[port]:[optional datacenter]" + ``` + + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter],prepared_query:[query name]:[port],[service-name].svc:[port]" + ``` - `consul.hashicorp.com/envoy-extra-args` - A space-separated list of [arguments](https://www.envoyproxy.io/docs/envoy/latest/operations/cli) to be passed to the injected envoy binary. From d0f7a75fd1ed13aa0e49c70ab81eab53defed15d Mon Sep 17 00:00:00 2001 From: Nitya Dhanushkodi Date: Mon, 20 Jun 2022 17:28:19 -0700 Subject: [PATCH 4/6] unnest partitions --- .../content/docs/k8s/annotations-and-labels.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/website/content/docs/k8s/annotations-and-labels.mdx b/website/content/docs/k8s/annotations-and-labels.mdx index 1e4d5533c2..c036bb77e2 100644 --- a/website/content/docs/k8s/annotations-and-labels.mdx +++ b/website/content/docs/k8s/annotations-and-labels.mdx @@ -89,14 +89,14 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje If the namespace is not specified, the annotation will default to the namespace of the source service. If you are not using Consul Enterprise 1.7+, Consul will interpret the value placed in the namespace position as part of the service name. - - Admin partitions (requires Consul Enterprise 1.11+): Upstream services may be running in a different - partition. You must specify the namespace when specifying a partition. Place the partition name after the namespace. If you specify the name of the datacenter (optional), it must be the local datacenter. Communicating across partitions using this method is only supported within a - datacenter. For cross partition communication across datacenters, see [cluster - peering](/docs/connect/cluster-peering/k8s). - ```yaml - annotations: - "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace].[service-partition]:[port]:[optional datacenter]" - ``` + - Admin partitions (requires Consul Enterprise 1.11+): Upstream services may be running in a different + partition. You must specify the namespace when specifying a partition. Place the partition name after the namespace. If you specify the name of the datacenter (optional), it must be the local datacenter. Communicating across partitions using this method is only supported within a + datacenter. For cross partition communication across datacenters, see [cluster + peering](/docs/connect/cluster-peering/k8s). + ```yaml + annotations: + "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace].[service-partition]:[port]:[optional datacenter]" + ``` - [Prepared queries](/docs/connect/proxies#dynamic-upstreams-require-native-integration): Prepend the annotation with `prepared_query` and place the name of the query at the beginning of the string. ```yaml From 1a537389498f473dc54b4aa3cb2ae06ab159fd31 Mon Sep 17 00:00:00 2001 From: Tu Nguyen Date: Wed, 22 Jun 2022 00:05:32 -0700 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> --- .../content/docs/k8s/annotations-and-labels.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/website/content/docs/k8s/annotations-and-labels.mdx b/website/content/docs/k8s/annotations-and-labels.mdx index c036bb77e2..750581b3e2 100644 --- a/website/content/docs/k8s/annotations-and-labels.mdx +++ b/website/content/docs/k8s/annotations-and-labels.mdx @@ -80,18 +80,18 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje "consul.hashicorp.com/connect-service-upstreams":"[service-name]:[port]:[optional datacenter]" ``` - Namespace (requires Consul Enterprise 1.7+): Upstream services may be running in different a namespace. Place - the upstream namespace after the service name. Refer to [Consul Enterprise - Namespaces](#consul-enterprise-namespaces) for additional details about configuring the injector. + the upstream namespace after the service name. For additional details about configuring the injector, refer to + [Consul Enterprise Namespaces](#consul-enterprise-namespaces) . ```yaml annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].[service-namespace]:[port]:[optional datacenter]" ``` - If the namespace is not specified, the annotation will default to the namespace of the source service. - If you are not using Consul Enterprise 1.7+, Consul will interpret the value placed in the namespace position as part of the service name. + If the namespace is not specified, the annotation defaults to the namespace of the source service. + If you are not using Consul Enterprise 1.7+, Consul interprets the value placed in the namespace position as part of the service name. - Admin partitions (requires Consul Enterprise 1.11+): Upstream services may be running in a different partition. You must specify the namespace when specifying a partition. Place the partition name after the namespace. If you specify the name of the datacenter (optional), it must be the local datacenter. Communicating across partitions using this method is only supported within a - datacenter. For cross partition communication across datacenters, see [cluster + datacenter. For cross partition communication across datacenters, refer to [cluster peering](/docs/connect/cluster-peering/k8s). ```yaml annotations: @@ -104,7 +104,7 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje 'consul.hashicorp.com/connect-service-upstreams': 'prepared_query:[query name]:[port]' ``` - - Labeled (requires consul-k8s v0.45.0+): + - Labeled (requires Consul for Kubernetes v0.45.0+): The labeled format is required when using the cluster peering feature and specifying an upstream in another peer. You can specify a Consul Enterprise namespace, partition, or datacenter. The format supports only one peer, datacenter, or partition. - Service name: Place the service name at the beginning of the annotation followed by `.svc` to specify the upstream service. @@ -127,7 +127,7 @@ Resource annotations could be used on the Kubernetes pod to control connect-inje "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns:[port]" ``` When specifying a peer, datacenter, or admin partition when namespaces are enabled, you must - provide the namespace and a peer, datacenter, or partition. + provide the namespace . ```yaml annotations: "consul.hashicorp.com/connect-service-upstreams":"[service-name].svc.[service-namespace].ns.[service-peer].peer:[port]" From 768b440fcfd2691497bce4a2b26a8b3321358eeb Mon Sep 17 00:00:00 2001 From: David Yu Date: Wed, 22 Jun 2022 00:23:22 -0700 Subject: [PATCH 6/6] slight update to retrigger tests --- website/content/docs/k8s/annotations-and-labels.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/docs/k8s/annotations-and-labels.mdx b/website/content/docs/k8s/annotations-and-labels.mdx index 750581b3e2..d08b82ee69 100644 --- a/website/content/docs/k8s/annotations-and-labels.mdx +++ b/website/content/docs/k8s/annotations-and-labels.mdx @@ -17,7 +17,7 @@ This allows the user to configure natively configure Consul on select Kubernetes ## Annotations -Resource annotations could be used on the Kubernetes pod to control connect-inject behavior. +The following Kubernetes resource annotations could be used on a pod to control connect-inject behavior: - `consul.hashicorp.com/connect-inject` - If this is "true" then injection is enabled. If this is "false" then injection is explicitly disabled.