Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of docs: Change heading to filename in CodeBlockConfig into release/1.16.x #18969

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You must manually register the ingress gateway with Consul proxy to define extra
In the following example, the `public-ingress` gateway includes a static cluster named `sds-cluster` that specifies paths to the SDS certificate and SDS certification validation files:


<CodeBlockConfig heading="public-ingress-service.hcl">
<CodeBlockConfig filename="public-ingress-service.hcl">

```hcl
Services {
Expand Down Expand Up @@ -133,7 +133,7 @@ Store TLS client authentication files, certificate files, and keys on disk where
The following example specifies certificate chain:


<CodeBlockConfig heading="certs/sds-auth-cert.json">
<CodeBlockConfig filename="certs/sds-auth-cert.json">

```json
{
Expand All @@ -158,7 +158,7 @@ The following example specifies certificate chain:

The following example specifies the validation context:

<CodeBlockConfig heading="/certs/sds-validation.json">
<CodeBlockConfig filename="/certs/sds-validation.json">

```json
{
Expand Down Expand Up @@ -209,7 +209,7 @@ Refer to [Ingress gateway configuration entry reference](/consul/docs/connect/co

The following example directs Consul to retrieve `example.com-public-cert` certificates from an SDS cluster named `sds-cluster` and serve them to all listeners:

<CodeBlockConfig heading="public-ingress-cfg.hcl">
<CodeBlockConfig filename="public-ingress-cfg.hcl">

```hcl
Kind = "ingress-gateway"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,5 @@ service {
}
}
```
</CodeTabs>

</CodeTabs>
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Refer to the `/connect/intentions/exact` [HTTP API endpoint documentation](/cons

For L7 intentions, specify the `Permissions` in the request payload to configure attributes for dynamically enforcing intentions. In the following example payload, Consul allows HTTP GET requests if the request body is empty:

<CodeBlockConfig heading="payload.json">
<CodeBlockConfig filename="payload.json">

```json
{
Expand Down
4 changes: 2 additions & 2 deletions website/content/docs/k8s/l7-traffic/failover-tproxy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The default ACLs that the Consul Helm chart configures are suitable for most cas

Specify the target failover in the [`spec.failover.targets`](/consul/docs/connect/config-entries/service-resolver#failover-targets-service) field in the service resolver configuration entry. In the following example, the `api-beta` service is configured to failover to the `api` service in any service subset:

<CodeBlockConfig heading="api-beta-failover.yaml">
<CodeBlockConfig filename="api-beta-failover.yaml">

```yaml
apiversion: consul.hashicorp.com/v1alpha1
Expand Down Expand Up @@ -61,7 +61,7 @@ $ kubectl apply -f api-beta-failover.yaml
If intentions are not already defined, create and apply intentions that allow the appropriate downstream to access the target service and the failover service. In the following examples, the `frontend` service is allowed to send messages to the `api` service, which is allowed to send messages to the `api-beta` failover service.


<CodeBlockConfig heading="frontend-api-api-beta-allow.yaml">
<CodeBlockConfig filename="frontend-api-api-beta-allow.yaml">

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The default ACLs that the Consul Helm chart configures are suitable for most cas

Specify the target failover in the [`spec.redirect.service`](/consul/docs/connect/config-entries/service-resolver#spec-redirect-service) field in the service resolver configuration entry. In the following example, the `virtual-api` service is configured to redirect to the `real-api`:

<CodeBlockConfig heading="virtual-api-redirect.yaml">
<CodeBlockConfig filename="virtual-api-redirect.yaml">

```yaml
apiversion: consul.hashicorp.com/v1alpha1
Expand All @@ -61,7 +61,7 @@ $ kubectl apply -f virtual-api-redirect.yaml
If intentions are not already defined, create and apply intentions that allow the appropriate downstream to access the real service and the target redirect service. In the following examples, the `frontend` service is allowed to send messages to the `virtual-api` and `real-api` services:


<CodeBlockConfig heading="frontend-api-api-beta-allow.yaml">
<CodeBlockConfig filename="frontend-api-api-beta-allow.yaml">

```yaml
apiversion: consul.hashicorp.com/v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Refer to the [prepared query reference](/consul/api-docs/query#create-prepared-q

1. Specify the prepared query options in JSON format. The following prepared query targets all instances of the `redis` service in `dc1` and `dc2`:

<CodeBlockConfig filename="payload.json">

```json
{
"Name": "my-query",
Expand Down Expand Up @@ -58,6 +60,8 @@ Refer to the [prepared query reference](/consul/api-docs/query#create-prepared-q
}
```

</CodeBlockConfig>

Refer to the [prepared query configuration reference](/consul/api-docs/query#create-prepared-query) for information about all available options.

1. Send the query in a POST request to the [`/query` API endpoint](/consul/api-docs/query). If the request is successful, Consul prints an ID for the prepared query.
Expand Down
4 changes: 2 additions & 2 deletions website/content/docs/services/usage/define-services.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ For Kubernetes environments, you can enable the [`connectInject`](/consul/docs/
The following example defines a service named `redis` that is available on port `80`. By default, the service has the IP address of the agent node.

<CodeTabs>
<CodeBlockConfig heading="service.hcl">
<CodeBlockConfig filename="service.hcl">

```hcl
service {
Expand Down Expand Up @@ -72,7 +72,7 @@ service {
```

</CodeBlockConfig>
<CodeBlockConfig heading="service.json">
<CodeBlockConfig filename="service.json">

```json
{
Expand Down