Backport of docs: Fix invalid JSON into release/1.16.x (#18960)

Backport of Fix invalid JSON into release/1.16.x

backport of commit cc40e084bb
pull/18973/head
Blake Covarrubias 2023-09-21 15:20:41 -07:00 committed by GitHub
parent 100fbed860
commit 54be594b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 240 additions and 192 deletions

View File

@ -947,7 +947,7 @@ $ curl \
"Port": 8000, "Port": 8000,
"Namespace": "default" "Namespace": "default"
} }
} ]
} }
``` ```

View File

@ -52,14 +52,18 @@ once you have their coordinates. Here's a sample coordinate, as returned from th
<CodeBlockConfig heading="Sample coordinate from Coordinate endpoint" hideClipboard> <CodeBlockConfig heading="Sample coordinate from Coordinate endpoint" hideClipboard>
```json ```json
... [
"Coord": { {
"Adjustment": 0.1, "Node": "agent-one",
"Error": 1.5, "Segment": "",
"Height": 0.02, "Coord": {
"Vec": [0.34,0.68,0.003,0.01,0.05,0.1,0.34,0.06] "Adjustment": 0.1,
"Error": 1.5,
"Height": 0.02,
"Vec": [0.34,0.68,0.003,0.01,0.05,0.1,0.34,0.06]
}
} }
... ]
``` ```
</CodeBlockConfig> </CodeBlockConfig>

View File

@ -62,18 +62,20 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Name": "default", "Kind": "exported-services",
"Services": [ "Name": "default",
{ "Services": [
"Name": "<name of service to export>", {
"Consumers": [ "Name": "<name of service to export>",
{ "Consumers": [
"Peer": "<name of the peered cluster that dials the exported service>" {
} "Peer": "<name of the peered cluster that dials the exported service>"
] }
} ]
] }
]
}
``` ```
</CodeTabs> </CodeTabs>
@ -113,20 +115,22 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Partition": "<partition containing services to export>", "Kind": "exported-services",
"Name": "<partition containing services to export>", "Partition": "<partition containing services to export>",
"Services": [ "Name": "<partition containing services to export>",
{ "Services": [
"Name": "<name of service to export>", {
"Namespace": "<namespace in the partition containing the service to export>" "Name": "<name of service to export>",
"Consumers": [ "Namespace": "<namespace in the partition containing the service to export>",
{ "Consumers": [
"Peer": "<name of the peered cluster that dials the exported service>" {
} "Peer": "<name of the peered cluster that dials the exported service>"
] }
} ]
] }
]
}
``` ```
</CodeTabs> </CodeTabs>
@ -166,20 +170,22 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Partition": "<partition containing services to export>", "Kind": "exported-services",
"Name": "<partition containing services to export>", "Partition": "<partition containing services to export>",
"Services": [ "Name": "<partition containing services to export>",
{ "Services": [
"Name": "<name of service to export>", {
"Namespace": "<namespace in the partition containing the service to export>" "Name": "<name of service to export>",
"Consumers": [ "Namespace": "<namespace in the partition containing the service to export>",
{ "Consumers": [
"Partition": "<name of partition that dials the exported service>" {
} "Partition": "<name of partition that dials the exported service>"
] }
} ]
] }
]
}
``` ```
</CodeTabs> </CodeTabs>
@ -220,20 +226,22 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Partition": "<partition containing services to export>", "Kind": "exported-services",
"Name": "<partition containing services to export>", "Partition": "<partition containing services to export>",
"Services": [ "Name": "<partition containing services to export>",
{ "Services": [
"Name": "<name of service to export>", {
"Namespace": "<namespace in the partition containing the service to export>" "Name": "<name of service to export>",
"Consumers": [ "Namespace": "<namespace in the partition containing the service to export>",
{ "Consumers": [
"SamenessGroup": "<name of the sameness group that dials the exported service>" {
} "SamenessGroup": "<name of the sameness group that dials the exported service>"
] }
} ]
] }
]
}
``` ```
</CodeTabs> </CodeTabs>
@ -326,7 +334,8 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Kind": "exported-services",
"Name": "default", "Name": "default",
"Services": [ "Services": [
{ {
@ -334,8 +343,8 @@ spec:
"Consumers": [ "Consumers": [
{ {
"Peer": "web-shop" "Peer": "web-shop"
}, }
], ]
}, },
{ {
"Name": "refunds", "Name": "refunds",
@ -346,6 +355,7 @@ spec:
] ]
} }
] ]
}
``` ```
</CodeTabs> </CodeTabs>
@ -402,18 +412,19 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Kind": "exported-services",
"Partition": "finance", "Partition": "finance",
"Name": "finance", "Name": "finance",
"Services": [ "Services": [
{ {
"Name": "payments", "Name": "payments",
"Namespace": "billing" "Namespace": "billing",
"Consumers": [ "Consumers": [
{ {
"Peer": "web-shop" "Peer": "web-shop"
}, }
], ]
}, },
{ {
"Name": "refunds", "Name": "refunds",
@ -425,6 +436,7 @@ spec:
] ]
} }
] ]
}
``` ```
</CodeTabs> </CodeTabs>
@ -448,7 +460,7 @@ Services = [
Consumers = [ Consumers = [
{ {
Partition = "web-shop" Partition = "web-shop"
}, }
] ]
}, },
{ {
@ -481,18 +493,19 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Kind": "exported-services",
"Partition": "finance", "Partition": "finance",
"Name": "finance", "Name": "finance",
"Services": [ "Services": [
{ {
"Name": "payments", "Name": "payments",
"Namespace": "billing" "Namespace": "billing",
"Consumers": [ "Consumers": [
{ {
"Partition": "web-shop" "Partition": "web-shop"
}, }
], ]
}, },
{ {
"Name": "refunds", "Name": "refunds",
@ -504,6 +517,7 @@ spec:
] ]
} }
] ]
}
``` ```
</CodeTabs> </CodeTabs>
@ -545,7 +559,8 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Kind": "exported-services",
"Name": "default", "Name": "default",
"Services": [ "Services": [
{ {
@ -557,6 +572,7 @@ spec:
] ]
} }
] ]
}
``` ```
</CodeTabs> </CodeTabs>
@ -603,12 +619,13 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Kind": "exported-services",
"Name": "default", "Name": "default",
"Services": [ "Services": [
{ {
"Name": "*", "Name": "*",
"Namespace": "*" "Namespace": "*",
"Consumers": [ "Consumers": [
{ {
"Peer": "monitoring" "Peer": "monitoring"
@ -619,6 +636,7 @@ spec:
] ]
} }
] ]
}
``` ```
</CodeTabs> </CodeTabs>
@ -666,13 +684,14 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Kind": "exported-services",
"Partition": "finance", "Partition": "finance",
"Name": "finance", "Name": "finance",
"Services": [ "Services": [
{ {
"Name": "*", "Name": "*",
"Namespace": "*" "Namespace": "*",
"Consumers": [ "Consumers": [
{ {
"Peer": "monitoring" "Peer": "monitoring"
@ -683,6 +702,7 @@ spec:
] ]
} }
] ]
}
``` ```
</CodeTabs> </CodeTabs>
@ -730,13 +750,14 @@ spec:
``` ```
```json ```json
"Kind": "exported-services", {
"Kind": "exported-services",
"Partition": "finance", "Partition": "finance",
"Name": "finance", "Name": "finance",
"Services": [ "Services": [
{ {
"Name": "*", "Name": "*",
"Namespace": "*" "Namespace": "*",
"Consumers": [ "Consumers": [
{ {
"Partition": "monitoring" "Partition": "monitoring"
@ -747,6 +768,7 @@ spec:
] ]
} }
] ]
}
``` ```
</CodeTabs> </CodeTabs>
@ -813,7 +835,6 @@ node_prefix "" {
} }
} }
} }
``` ```
</CodeTabs> </CodeTabs>
@ -865,29 +886,30 @@ partition "frontend" {
{ {
"partition": { "partition": {
"frontend": { "frontend": {
"namespace": { "namespace": {
## The following could be any namespace ## The following could be any namespace
"dev": { "dev": {
"service": { "service": {
"web": { "web": {
"policy": "write" "policy": "write"
} }
} }
} }
} }
} }
} }
} }
## OR ## OR
{ {
"partition": { "partition": {
"frontend": { "frontend": {
"namespace": { "namespace": {
## The following could be any namespace ## The following could be any namespace
"dev": { "dev": {
"service_prefix": { "service_prefix": {
"": { "": {
"policy": "read" "policy": "read"
} }
@ -897,9 +919,9 @@ partition "frontend" {
"policy": "read" "policy": "read"
} }
} }
} }
} }
} }
} }
} }
``` ```
@ -953,17 +975,17 @@ partition "frontend" {
{ {
"partition": { "partition": {
"frontend": { "frontend": {
"namespace": { "namespace": {
## The following could be any namespace ## The following could be any namespace
"dev": { "dev": {
"service": { "service": {
"web": { "web": {
"policy": "write" "policy": "write"
} }
} }
} }
} }
} }
} }
} }
@ -972,10 +994,10 @@ partition "frontend" {
{ {
"partition": { "partition": {
"frontend": { "frontend": {
"namespace": { "namespace": {
## The following could be any namespace ## The following could be any namespace
"dev": { "dev": {
"service_prefix": { "service_prefix": {
"": { "": {
"policy": "read" "policy": "read"
} }
@ -985,9 +1007,9 @@ partition "frontend" {
"policy": "read" "policy": "read"
} }
} }
} }
} }
} }
} }
} }
``` ```

View File

@ -353,9 +353,11 @@ spec:
"MaxPendingRequests" : 0, "MaxPendingRequests" : 0,
"MaxConcurrentRequests": 0, "MaxConcurrentRequests": 0,
"PassiveHealthCheck" : { "PassiveHealthCheck" : {
"interval" : 10, "interval": "<the time between checks>",
"max_failures" : 5, "maxFailures": <number>,
"enforcing_consecutive_5xx" : 100 "enforcingConsecutive5xx": <number>,
"maxEjectionPercent": <number>,
"baseEjectionTime": "<the base time that a host is ejected for>"
} }
}, },
"Listeners" : [ "Listeners" : [
@ -402,9 +404,11 @@ spec:
"MaxPendingRequests" : <number>, "MaxPendingRequests" : <number>,
"MaxConcurrentRequests" : <number>, "MaxConcurrentRequests" : <number>,
"PassiveHealthCheck" : { "PassiveHealthCheck" : {
"interval" : 10, "interval": "<the time between checks>",
"max_failures" : 5, "maxFailures": <number>,
"enforcing_consecutive_5xx" : 100 "enforcingConsecutive5xx":<number>,
"maxEjectionPercent": <number>,
"baseEjectionTime": "<the base time that a host is ejected for>"
} }
} }
], ],

View File

@ -187,7 +187,7 @@ spec:
"Services": [ "Services": [
{ {
"Name": "billing", "Name": "billing",
"CAFile": "/etc/certs/ca-chain.cert.pem" "CAFile": "/etc/certs/ca-chain.cert.pem",
"SNI": "billing.service.com" "SNI": "billing.service.com"
} }
] ]

View File

@ -34,8 +34,10 @@ connect {
``` ```
```json ```json
"connect": { {
"enabled": true "connect": {
"enabled": true
}
} }
``` ```
</CodeTabs> </CodeTabs>

View File

@ -22,7 +22,7 @@ for the built-in proxy.
```json ```json
{ {
"service": { "service": {
... "name": "example-service",
"connect": { "connect": {
"proxy": { "proxy": {
"config": { "config": {
@ -31,11 +31,11 @@ for the built-in proxy.
"local_service_address": "127.0.0.1:1234", "local_service_address": "127.0.0.1:1234",
"local_connect_timeout_ms": 1000, "local_connect_timeout_ms": 1000,
"handshake_timeout_ms": 10000, "handshake_timeout_ms": 10000,
"upstreams": [...] "upstreams": []
}, },
"upstreams": [ "upstreams": [
{ {
... "destination_name": "example-upstream",
"config": { "config": {
"connect_timeout_ms": 1000 "connect_timeout_ms": 1000
} }

View File

@ -72,25 +72,27 @@ EnvoyExtensions = [
<CodeBlockConfig filename="property-override-extension-service-defaults.json"> <CodeBlockConfig filename="property-override-extension-service-defaults.json">
```json ```json
"kind": "service-defaults", {
"name": "api", "kind": "service-defaults",
"protocol": "http", "name": "api",
"envoyExtensions": [{ "protocol": "http",
"name": "builtin/property-override", "envoyExtensions": [{
"arguments": { "name": "builtin/property-override",
"proxyType": "connect-proxy", "arguments": {
"patches": [{ "proxyType": "connect-proxy",
"resourceFilter": { "patches": [{
"resourceType": "cluster", "resourceFilter": {
"trafficDirection": "outbound", "resourceType": "cluster",
"services": [{ "name": "other-svc" }] "trafficDirection": "outbound",
}, "services": [{ "name": "other-svc" }]
"op": "add", },
"path": "/respect_dns_ttl", "op": "add",
"value": true "path": "/respect_dns_ttl",
}] "value": true
} }]
}] }
}]
}
``` ```
</CodeBlockConfig> </CodeBlockConfig>
</Tab> </Tab>

View File

@ -221,6 +221,7 @@ Then, open `bootstrap.json` and update the following sections with your ACL toke
<CodeBlockConfig filename="bootstrap.json" hideClipboard lineNumbers highlight="2,19"> <CodeBlockConfig filename="bootstrap.json" hideClipboard lineNumbers highlight="2,19">
```json ```json
{
"admin": { "admin": {
"access_log_path": "/dev/null", "access_log_path": "/dev/null",
"address": { "address": {

View File

@ -207,7 +207,7 @@ mesh_gateway = {
"mesh_gateway": { "mesh_gateway": {
"mode": "local" "mode": "local"
} }
}, }
``` ```
</CodeTabs> </CodeTabs>
@ -229,7 +229,7 @@ config = {}
"local_bind_address": "127.0.0.1", "local_bind_address": "127.0.0.1",
"local_bind_port": 1234, "local_bind_port": 1234,
"config": {} "config": {}
}, }
``` ```
</CodeTabs> </CodeTabs>
@ -462,13 +462,15 @@ upstreams = [
``` ```
```json ```json
"upstreams": [ {
{ "upstreams": [
"destination_name": "service-1", {
"local_bind_socket_path": "/tmp/socket_service_1", "destination_name": "service-1",
"local_bind_socket_mode": "0700" "local_bind_socket_path": "/tmp/socket_service_1",
} "local_bind_socket_mode": "0700"
] }
]
}
``` ```
</CodeTabs> </CodeTabs>
@ -499,9 +501,11 @@ services {
``` ```
```json ```json
"services": { {
"name": "service-2", "services": {
"socket_path": "/tmp/socket_service_2" "name": "service-2",
"socket_path": "/tmp/socket_service_2"
}
} }
``` ```
@ -519,7 +523,6 @@ services {
proxy { proxy {
name = "service-2" name = "service-2"
local_service_socket_path = "/tmp/socket_service_2" local_service_socket_path = "/tmp/socket_service_2"
...
} }
} }
} }
@ -527,17 +530,20 @@ services {
``` ```
```json ```json
"services": { {
"name": "socket_service_2", "services": [
"connect": { {
"sidecar_service": { "name": "socket_service_2",
"proxy": { "connect": {
"name": "service-2", "sidecar_service": {
"local_service_socket_path": "/tmp/socket_service_2" "proxy": {
... "name": "service-2",
"local_service_socket_path": "/tmp/socket_service_2"
}
}
} }
} }
} ]
} }
``` ```

View File

@ -682,8 +682,7 @@ An example of the output of this command:
"TagFilter": "", "TagFilter": "",
"Version": 1, "Version": 1,
"LTime": 18 "LTime": 18
}, }
...
] ]
``` ```

View File

@ -48,7 +48,7 @@ during task startup.
"name": "consul_binary" "name": "consul_binary"
} }
], ],
"containerDefinitions": [...] "containerDefinitions": [...],
"tags": [ "tags": [
{ {
"key": "consul.hashicorp.com/mesh", "key": "consul.hashicorp.com/mesh",

View File

@ -111,7 +111,7 @@ The registrator also requires the following IAM permissions to access the parame
"Effect": "Allow", "Effect": "Allow",
"Action": ["ssm:PutParameter","ssm:DeleteParameter"], "Action": ["ssm:PutParameter","ssm:DeleteParameter"],
"Resource": "arn:aws:ssm:us-east-2:123456789012:parameter/${var.consul_extension_data_prefix}/*" "Resource": "arn:aws:ssm:us-east-2:123456789012:parameter/${var.consul_extension_data_prefix}/*"
}, }
] ]
} }
``` ```

View File

@ -182,7 +182,7 @@ Response:
"null" "null"
], ],
"services": [ "services": [
"web", "web"
], ],
"events_url": "/v1/status/tasks/task_b?include=events", "events_url": "/v1/status/tasks/task_b?include=events",
"events": [ "events": [
@ -217,7 +217,7 @@ Response:
"null" "null"
], ],
"services": [ "services": [
"web", "web"
], ],
"module": "../modules/test_task" "module": "../modules/test_task"
} }

View File

@ -47,7 +47,7 @@ acl = {
```json ```json
{ {
"bootstrap_expect": N, "bootstrap_expect": 3,
"primary_datacenter": "PRIMARY_DATACENTER_VALUE", "primary_datacenter": "PRIMARY_DATACENTER_VALUE",
"acl": { "acl": {
"enabled": true, "enabled": true,

View File

@ -554,7 +554,7 @@ node "admin" {
"node_prefix": { "node_prefix": {
"": { "": {
"policy": "read" "policy": "read"
}, }
}, },
"node": { "node": {
"app": { "app": {

View File

@ -35,29 +35,27 @@ Specify the value of the `SecretID` attribute with the `token` parameter when co
<CodeTabs> <CodeTabs>
<CodeBlockConfig lineNumbers highlight="6"> <CodeBlockConfig lineNumbers highlight="5">
```hcl ```hcl
service = { service = {
id = "redis" id = "redis"
name = "redis" name = "redis"
...
namespace = "foo" namespace = "foo"
token = "233b604b-b92e-48c8-a253-5f11514e4b50" token = "233b604b-b92e-48c8-a253-5f11514e4b50"
} }
``` ```
</CodeBlockConfig> </CodeBlockConfig>
<CodeBlockConfig lineNumbers highlight="6"> <CodeBlockConfig lineNumbers highlight="5">
```json ```json
{ {
"service": { "service": {
"id": "redis", "id": "redis",
"name": "redis", "name": "redis",
... "namespace": "foo",
"token": "233b604b-b92e-48c8-a253-5f11514e4b50", "token": "233b604b-b92e-48c8-a253-5f11514e4b50"
"namespace": "foo"
} }
} }
``` ```

View File

@ -96,12 +96,14 @@ In the following example, the `env` key is set to `prod`:
```hcl ```hcl
meta = { meta = {
env = "prod" env = "prod"
} }
``` ```
```json ```json
"meta" : { {
"meta" : {
"env" : "prod" "env" : "prod"
}
} }
``` ```
@ -362,25 +364,29 @@ In the following example, service instances in a `passing` state respond to DNS
```hcl ```hcl
service { service {
## ... name = "redis"
address = "192.0.2.10"
port = 6379
weights = { weights = {
passing = 3 passing = 3
warning = 2 warning = 2
critical = 1 critical = 1
} }
## ...
} }
``` ```
```json ```json
"service": { {
## ... "service": {
"weights": { "name": "redis",
"passing": 3, "address": "192.0.2.10",
"warning": 2, "port": 6379,
"critical": 1 "weights": {
}, "passing": 3,
## ... "warning": 2,
"critical": 1
}
}
} }
``` ```
@ -585,7 +591,7 @@ service {
"tagged_addresses": { "tagged_addresses": {
"lan": { "lan": {
"address": "192.168.0.55", "address": "192.168.0.55",
"port": 8000, "port": 8000
}, },
"wan": { "wan": {
"address": "198.18.0.23", "address": "198.18.0.23",
@ -632,7 +638,7 @@ service {
}, },
"connect": { "connect": {
"native": false, "native": false,
"sidecar_service": {} "sidecar_service": {},
"proxy": { // Deprecated "proxy": { // Deprecated
"command": [], "command": [],
"config": {} "config": {}

View File

@ -57,8 +57,7 @@ checks = [
name = "cpu" name = "cpu"
args = ["/bin/check_cpu"] args = ["/bin/check_cpu"]
interval = "10s" interval = "10s"
}, }
...
] ]
``` ```
@ -82,8 +81,7 @@ checks = [
"name": "cpu", "name": "cpu",
"args": ["/bin/check_cpu"], "args": ["/bin/check_cpu"],
"interval": "10s" "interval": "10s"
}, }
...
] ]
} }
``` ```

View File

@ -380,8 +380,7 @@ services {
"timeout": "60s" "timeout": "60s"
} }
] ]
}, }
...
] ]
} }
``` ```
@ -397,25 +396,32 @@ Add the `enable_tag_override` option to the `service` block and set the value to
<CodeTabs tabs={[ "HCL","JSON" ]}> <CodeTabs tabs={[ "HCL","JSON" ]}>
<CodeBlockConfig highlight="4">
```hcl ```hcl
service { service {
## ... name = "redis"
port = 6379
enable_tag_override = true enable_tag_override = true
## ...
} }
``` ```
</CodeBlockConfig>
<CodeBlockConfig highlight="5">
```json ```json
{ {
"service": { "service": {
## ... "name": "redis",
"enable_tag_override": true, "port": 6379,
## ... "enable_tag_override": true
} }
} }
``` ```
</CodeBlockConfig>
</CodeTabs> </CodeTabs>
This configuration only applies to the locally registered service. Nodes that register the same service apply the `enable_tag_override` and other service configurations independently. The tags for a service registered on one node update are not affected by operations performed on services with the same name registered on other nodes. This configuration only applies to the locally registered service. Nodes that register the same service apply the `enable_tag_override` and other service configurations independently. The tags for a service registered on one node update are not affected by operations performed on services with the same name registered on other nodes.