Skip to content

Commit

Permalink
Backport of docs: Fix HCL, JSON, and YAML syntax errors into release/…
Browse files Browse the repository at this point in the history
…1.14.x (#18889)

docs: Fix HCL, JSON, and YAML syntax errors (#18879)

This commit fixes syntax errors in HCL, JSON, and YAML example
configurations. In some cases, it replaces the code example with the
proper format for the code block.

Also fixes HCL formatting and misc opportunistic updates to codeblock.

Co-authored-by: Blake Covarrubias <blake@covarrubi.as>
Co-authored-by: Tu Nguyen <im2nguyen@gmail.com>
  • Loading branch information
3 people authored Sep 19, 2023
1 parent d1fd088 commit 486d2f3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
39 changes: 17 additions & 22 deletions website/content/docs/connect/transparent-proxy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ connectInject:
Apply the `consul.hashicorp.com/transparent-proxy=true` label to enable transparent proxy for a Kubernetes namespace. The label overrides the `connectInject.transparentProxy.defaultEnabled` Helm value and defines the default behavior of Pods in the namespace. The following example enables transparent proxy for Pods in the `my-app` namespace:

```bash
kubectl label namespaces my-app "consul.hashicorp.com/transparent-proxy=true"
```shell-session
$ kubectl label namespaces my-app "consul.hashicorp.com/transparent-proxy=true"
```
#### Individual service

Expand Down Expand Up @@ -149,12 +149,11 @@ The [`consul.hashicorp.com/transparent-proxy-exclude-inbound-ports`](/docs/k8s/a
<CodeBlockConfig heading="Exclude inbound port numbers from redirection">

```yaml
"metadata": {
"annotations": {
"consul.hashicorp.com/transparent-proxy-exclude-inbound-ports" : "8200, 8201”
}
}
metadata:
annotations:
consul.hashicorp.com/transparent-proxy-exclude-inbound-ports: "8200, 8201"
```

</CodeBlockConfig>

#### Exclude outbound ports
Expand All @@ -164,11 +163,9 @@ The [`consul.hashicorp.com/transparent-proxy-exclude-outbound-ports`](/docs/k8s/
<CodeBlockConfig heading="Exclude outbound port numbers from redirection">

```yaml
"metadata": {
"annotations": {
"consul.hashicorp.com/transparent-proxy-exclude-outbound-ports" : "8200, 8201”
}
}
metadata:
annotations":
consul.hashicorp.com/transparent-proxy-exclude-outbound-ports: "8200, 8201"
```

</CodeBlockConfig>
Expand All @@ -182,11 +179,9 @@ In the following example, services in the `3.3.3.3/24` IP range are not redirect
<CodeBlockConfig heading="Exclude outbound CIDR blocks from redirection">

```yaml
"metadata": {
"annotations": {
"consul.hashicorp.com/transparent-proxy-exclude-outbound-cidrs" : "3.3.3.3,3.3.3.3/24"
}
}
metadata:
annotations:
consul.hashicorp.com/transparent-proxy-exclude-outbound-cidrs: "3.3.3.3,3.3.3.3/24"
```
</CodeBlockConfig>

Expand All @@ -199,9 +194,9 @@ In the following example, services with the IDs `4444 ` and `44444 ` are not red
<CodeBlockConfig heading="Exclude user IDs from redirection">

```yaml
"metadata": {
"annotations": {
"consul.hashicorp.com/transparent-proxy-exclude-uids" : "4444,44444
metadata:
annotations:
consul.hashicorp.com/transparent-proxy-exclude-uids: "4444,44444"
}
}
```
Expand Down Expand Up @@ -229,7 +224,7 @@ then you must configure services in one Kubernetes cluster to explicitly dial a
The following example configures the service to dial an upstream service called `my-service` in datacenter `dc2` on port `1234`:

```yaml
"consul.hashicorp.com/connect-service-upstreams": "my-service:1234:dc2"
consul.hashicorp.com/connect-service-upstreams: "my-service:1234:dc2"
```

If your Consul cluster is deployed to a [single datacenter spanning multiple Kubernetes clusters](/docs/k8s/deployment-configurations/single-dc-multi-k8s),
Expand All @@ -238,7 +233,7 @@ then you must configure services in one Kubernetes cluster to explicitly dial a
The following example configures the service to dial an upstream service called `my-service` in another Kubernetes cluster on port `1234`:

```yaml
"consul.hashicorp.com/connect-service-upstreams": "my-service:1234"
consul.hashicorp.com/connect-service-upstreams: "my-service:1234"
```

You do not need to configure services to explicitly dial upstream services if your Consul clusters are connected with a [peering connection](/docs/connect/cluster-peering).
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/nia/cli/task.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ task_example.hcl:
task {
name = "task_a"
description = ""
enabled = true,
enabled = true
providers = []
module = "org/example/module"
version = "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/nia/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ A `task` block configures which task to execute in automation. Use the `conditi
task {
name = "taskA"
description = ""
enabled = true,
enabled = true
providers = []
module = "org/example/module"
version = "1.0.0"
Expand Down

0 comments on commit 486d2f3

Please sign in to comment.