Backport of docs: Fix HCL, JSON, and YAML syntax errors into release/1.16.x (#18891)

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>
This commit is contained in:
hc-github-team-consul-core 2023-09-19 14:22:23 -04:00 committed by GitHub
parent 2d26ebc264
commit 8ecd7faa73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 158 additions and 158 deletions

View File

@ -41,19 +41,23 @@ When every field is defined, a control plane request limit configuration entry h
```hcl ```hcl
kind = "control-plane-request-limit" kind = "control-plane-request-limit"
mode = "permissive"
name = "<name-for-the-entry>" name = "<name-for-the-entry>"
mode = "permissive"
read_rate = 100 read_rate = 100
write_rate = 100 write_rate = 100
kv = { kv = {
read_rate = 100 read_rate = 100
write_rate = 100 write_rate = 100
} }
acl = { acl = {
read_rate = 100 read_rate = 100
write_rate = 100 write_rate = 100
mode = "permissive"
} }
catalog = { catalog = {
read_rate = 100 read_rate = 100
write_rate = 100 write_rate = 100
@ -63,8 +67,8 @@ catalog = {
```json ```json
{ {
"kind": "control-plane-request-limit", "kind": "control-plane-request-limit",
"mode": "permissive",
"name": "<name-for-the-entry>", "name": "<name-for-the-entry>",
"mode": "permissive",
"read_rate": 100, "read_rate": 100,
"write_rate": 100, "write_rate": 100,
"kv": { "kv": {
@ -75,7 +79,7 @@ catalog = {
"read_rate": 100, "read_rate": 100,
"write_rate": 100 "write_rate": 100
}, },
"catalog: { "catalog": {
"read_rate": 100, "read_rate": 100,
"write_rate": 100 "write_rate": 100
} }

View File

@ -243,6 +243,7 @@ CacheConfig = {
"InlineString": "<inline-string>", "InlineString": "<inline-string>",
"InlineBytes": "\302\000\302\302\302\302" "InlineBytes": "\302\000\302\302\302\302"
}, },
},
"TLSCertificates": { "TLSCertificates": {
"CaCertificateProviderInstance": { "CaCertificateProviderInstance": {
"InstanceName": "<instance-name>", "InstanceName": "<instance-name>",

View File

@ -177,16 +177,16 @@ EnvoyExtensions = [
ProxyType = "connect-proxy", ProxyType = "connect-proxy",
Patches = [ Patches = [
{ {
"ResourceFilter" = { ResourceFilter = {
"ResourceType" = "cluster", ResourceType = "cluster"
"TrafficDirection" = "outbound", TrafficDirection = "outbound"
"Service" = { Service = {
"Name" = "other-svc" Name = "other-svc"
}, }
}, }
"Op" = "add", Op = "add"
"Path" = "/respect_dns_ttl", Path = "/respect_dns_ttl"
"Value" = true, Value = true
} }
] ]
} }

View File

@ -43,8 +43,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: 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 ```shell-session
kubectl label namespaces my-app "consul.hashicorp.com/transparent-proxy=true" $ kubectl label namespaces my-app "consul.hashicorp.com/transparent-proxy=true"
``` ```
### Individual service ### Individual service
@ -121,12 +121,11 @@ The [`consul.hashicorp.com/transparent-proxy-exclude-inbound-ports`](/consul/doc
<CodeBlockConfig heading="Exclude inbound port numbers from redirection"> <CodeBlockConfig heading="Exclude inbound port numbers from redirection">
```yaml ```yaml
"metadata": { metadata:
"annotations": { annotations:
"consul.hashicorp.com/transparent-proxy-exclude-inbound-ports" : "8200, 8201” consul.hashicorp.com/transparent-proxy-exclude-inbound-ports: "8200, 8201"
}
}
``` ```
</CodeBlockConfig> </CodeBlockConfig>
### Exclude outbound ports ### Exclude outbound ports
@ -136,11 +135,9 @@ The [`consul.hashicorp.com/transparent-proxy-exclude-outbound-ports`](/consul/do
<CodeBlockConfig heading="Exclude outbound port numbers from redirection"> <CodeBlockConfig heading="Exclude outbound port numbers from redirection">
```yaml ```yaml
"metadata": { metadata:
"annotations": { annotations":
"consul.hashicorp.com/transparent-proxy-exclude-outbound-ports" : "8200, 8201” consul.hashicorp.com/transparent-proxy-exclude-outbound-ports: "8200, 8201"
}
}
``` ```
</CodeBlockConfig> </CodeBlockConfig>
@ -154,11 +151,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"> <CodeBlockConfig heading="Exclude outbound CIDR blocks from redirection">
```yaml ```yaml
"metadata": { metadata:
"annotations": { annotations:
"consul.hashicorp.com/transparent-proxy-exclude-outbound-cidrs" : "3.3.3.3,3.3.3.3/24" consul.hashicorp.com/transparent-proxy-exclude-outbound-cidrs: "3.3.3.3,3.3.3.3/24"
}
}
``` ```
</CodeBlockConfig> </CodeBlockConfig>
@ -171,9 +166,9 @@ In the following example, services with the IDs `4444 ` and `44444 ` are not red
<CodeBlockConfig heading="Exclude user IDs from redirection"> <CodeBlockConfig heading="Exclude user IDs from redirection">
```yaml ```yaml
"metadata": { metadata:
"annotations": { annotations:
"consul.hashicorp.com/transparent-proxy-exclude-uids" : "4444,44444” consul.hashicorp.com/transparent-proxy-exclude-uids: "4444,44444"
} }
} }
``` ```
@ -201,7 +196,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`: The following example configures the service to dial an upstream service called `my-service` in datacenter `dc2` on port `1234`:
```yaml ```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](/consul/docs/k8s/deployment-configurations/single-dc-multi-k8s), If your Consul cluster is deployed to a [single datacenter spanning multiple Kubernetes clusters](/consul/docs/k8s/deployment-configurations/single-dc-multi-k8s),
@ -210,7 +205,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`: The following example configures the service to dial an upstream service called `my-service` in another Kubernetes cluster on port `1234`:
```yaml ```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](/consul/docs/connect/cluster-peering). You do not need to configure services to explicitly dial upstream services if your Consul clusters are connected with a [peering connection](/consul/docs/connect/cluster-peering).

View File

@ -34,7 +34,7 @@ task_example.hcl:
task { task {
name = "task_a" name = "task_a"
description = "" description = ""
enabled = true, enabled = true
providers = [] providers = []
module = "org/example/module" module = "org/example/module"
version = "1.0.0" version = "1.0.0"

View File

@ -277,7 +277,7 @@ A `task` block configures which task to execute in automation. Use the `conditi
task { task {
name = "taskA" name = "taskA"
description = "" description = ""
enabled = true, enabled = true
providers = [] providers = []
module = "org/example/module" module = "org/example/module"
version = "1.0.0" version = "1.0.0"