Skip to content

Commit

Permalink
docs: Remove unnecessary use of CodeBlockConfig (hashicorp#12974)
Browse files Browse the repository at this point in the history
Remove empty CodeBlockConfig elements. These elements are not
providing any benefit for the enclosed code blocks. This PR removes
the elements so so that the source is easier to read.
  • Loading branch information
blake authored May 11, 2022
1 parent 88449b1 commit 9378880
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 229 deletions.
1 change: 0 additions & 1 deletion website/content/docs/agent/config/config-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ Valid time units are 'ns', 'us' (or 'µs'), 'ms', 's', 'm', 'h'."

- `response_headers` This object allows adding headers to the HTTP API and UI responses. For example, the following config can be used to enable [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) on the HTTP API endpoints:


<CodeTabs heading="Enable CORS on the HTTP API endpoints">

```hcl
Expand Down
12 changes: 0 additions & 12 deletions website/content/docs/api-gateway/consul-api-gateway-install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ Ensure that the environment you are deploying Consul API Gateway in meets the re

1. Issue the following command to install the CRDs:

<CodeBlockConfig>

```shell-session
$ kubectl apply --kustomize="github.com/hashicorp/consul-api-gateway/config/crd?ref=vVERSION"
```

</CodeBlockConfig>

1. Create a `values.yaml` file for your Consul API Gateway deployment. Copy the content below into the `values.yaml` file. The `values.yaml` will be used by the Consul Helm chart. Available versions of the [Consul](https://hub.docker.com/r/hashicorp/consul/tags) and [Consul API Gateway](https://hub.docker.com/r/hashicorp/consul-api-gateway/tags) Docker images can be found on DockerHub, with additional context on version compatibility published in [GitHub releases](https://github.com/hashicorp/consul-api-gateway/releases). See [Helm Chart Configuration - apiGateway](https://www.consul.io/docs/k8s/helm#apigateway) for more available options on how to configure your Consul API Gateway deployment via the Helm chart.

<CodeBlockConfig hideClipboard filename="values.yaml">
Expand All @@ -47,14 +43,10 @@ Ensure that the environment you are deploying Consul API Gateway in meets the re
1. Install Consul API Gateway using the standard Consul Helm chart and specify the custom values file. Available versions of the [Consul Helm chart](https://github.com/hashicorp/consul-k8s/releases) can be found in GitHub releases.
<CodeBlockConfig>
```shell-session
$ helm install consul hashicorp/consul --version 0.43.0 --values values.yaml --create-namespace --namespace consul
```

</CodeBlockConfig>

## Usage

1. Verify that the [requirements](#requirements) have been met.
Expand All @@ -73,14 +65,10 @@ Ensure that the environment you are deploying Consul API Gateway in meets the re
1. Issue the `kubectl apply` command to implement the configurations, e.g.:

<CodeBlockConfig>

```shell-session
$ kubectl apply -f gateway.yaml routes.yaml
```

</CodeBlockConfig>

<!--- Commented out per https://github.com/hashicorp/consul/pull/11951/files#r791204596

### Using the Consul API Gateway Binary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ You can configure the settings defined in the `exported-services` configuration
Configure the following parameters to define a `exported-services` configuration entry:

<CodeTabs heading="Exported services configuration syntax" tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
<CodeBlockConfig>

```hcl
Kind = "exported-services"
Expand All @@ -57,9 +56,6 @@ Services = [
]
```

</CodeBlockConfig>
<CodeBlockConfig>

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ExportedServices
Expand All @@ -73,9 +69,6 @@ spec:
- partition: <name of the partition that will dial the exported service>
```
</CodeBlockConfig>
<CodeBlockConfig>
```json
"Kind": "exported-services",
"Partition": "<partition containing services to export>",
Expand All @@ -93,7 +86,6 @@ spec:
]
```

</CodeBlockConfig>
</CodeTabs>

### Configuration Parameters
Expand All @@ -120,8 +112,7 @@ The `Services` parameter contains one or more lists of parameters that specify w

The following example configures the agent to export the `billing` service from the `default` namespace of the `finance` admin partition to the `frontend` and `backend` partitions. Additionally, all services in all namespaces within the `finance` partition will be exported to the `monitoring` partition.

<CodeTabs heading="" tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
<CodeBlockConfig>
<CodeTabs heading="Example exported services configuration" tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>

```hcl
Kind = "exported-services"
Expand Down Expand Up @@ -153,9 +144,6 @@ Services = [
]
```

</CodeBlockConfig>
<CodeBlockConfig>

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
Kind: ExportedServices
Expand All @@ -174,9 +162,6 @@ spec:
- partition: backend
```
</CodeBlockConfig>
<CodeBlockConfig>
```json
"Kind": "exported-services",
"Partition": "finance",
Expand Down Expand Up @@ -206,7 +191,6 @@ spec:
]
```

</CodeBlockConfig>
</CodeTabs>

## Reading Services
Expand Down
48 changes: 0 additions & 48 deletions website/content/docs/connect/config-entries/proxy-defaults.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Configure the following parameters to define a `proxy-defaults` configuration en
<Tab heading="Consul OSS">

<CodeTabs heading="Proxy defaults configuration syntax" tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
<CodeBlockConfig>

```hcl
Kind = "proxy-defaults"
Expand Down Expand Up @@ -80,9 +79,6 @@ Expose {
}
```

</CodeBlockConfig>
<CodeBlockConfig>

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
Expand All @@ -108,9 +104,6 @@ spec:
protocol:= <protocol of the listener>
```

</CodeBlockConfig>
<CodeBlockConfig>

```json
{
"Kind": "proxy-defaults",
Expand Down Expand Up @@ -143,7 +136,6 @@ spec:
}
```

</CodeBlockConfig>
</CodeTabs>

</Tab>
Expand All @@ -153,7 +145,6 @@ spec:
namespace and it will configure proxies in **all** namespaces.

<CodeTabs heading="Proxy defaults configuration syntax" tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
<CodeBlockConfig>

```hcl
Kind = "proxy-defaults"
Expand Down Expand Up @@ -187,9 +178,6 @@ Expose {
}
```

</CodeBlockConfig>
<CodeBlockConfig>

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
Expand All @@ -216,9 +204,6 @@ spec:
protocol:= <protocol of the listener>
```

</CodeBlockConfig>
<CodeBlockConfig>

```json
{
"Kind": "proxy-defaults",
Expand Down Expand Up @@ -252,7 +237,6 @@ spec:
}
```

</CodeBlockConfig>
</CodeTabs>

</Tab>
Expand Down Expand Up @@ -441,7 +425,6 @@ The following example configures the default protocol for all sidecar proxies.
<Tab heading="Consul OSS">

<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
<CodeBlockConfig>

```hcl
Kind = "proxy-defaults"
Expand All @@ -451,9 +434,6 @@ Config {
}
```

</CodeBlockConfig>
<CodeBlockConfig>

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
Expand All @@ -464,9 +444,6 @@ spec:
protocol: http
```
</CodeBlockConfig>
<CodeBlockConfig>
```json
{
"Kind": "proxy-defaults",
Expand All @@ -477,7 +454,6 @@ spec:
}
```

</CodeBlockConfig>
</CodeTabs>

</Tab>
Expand All @@ -487,7 +463,6 @@ spec:
namespace and it will configure proxies in **all** namespaces.

<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
<CodeBlockConfig>

```hcl
Kind = "proxy-defaults"
Expand All @@ -498,9 +473,6 @@ Config {
}
```

</CodeBlockConfig>
<CodeBlockConfig>

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
Expand All @@ -512,9 +484,6 @@ spec:
protocol: http
```
</CodeBlockConfig>
<CodeBlockConfig>
```json
{
"Kind": "proxy-defaults",
Expand All @@ -526,7 +495,6 @@ spec:
}
```

</CodeBlockConfig>
</CodeTabs>

</Tab>
Expand All @@ -537,7 +505,6 @@ spec:
The following example configures all sidecar proxies to expose Prometheus metrics.

<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
<CodeBlockConfig>

```hcl
Kind = "proxy-defaults"
Expand All @@ -547,9 +514,6 @@ Config {
}
```

</CodeBlockConfig>
<CodeBlockConfig>

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
Expand All @@ -560,9 +524,6 @@ spec:
envoy_prometheus_bind_addr: '0.0.0.0:9102'
```
</CodeBlockConfig>
<CodeBlockConfig>
```json
{
"Kind": "proxy-defaults",
Expand All @@ -573,15 +534,13 @@ spec:
}
```

</CodeBlockConfig>
</CodeTabs>

### Proxy-specific defaults

The following example configures some custom default values for all sidecar proxies.

<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
<CodeBlockConfig>

```hcl
Kind = "proxy-defaults"
Expand All @@ -592,9 +551,6 @@ Config {
}
```

</CodeBlockConfig>
<CodeBlockConfig>

```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
Expand All @@ -606,9 +562,6 @@ spec:
handshake_timeout_ms: 10000
```
</CodeBlockConfig>
<CodeBlockConfig>
```json
{
"Kind": "proxy-defaults",
Expand All @@ -620,7 +573,6 @@ spec:
}
```

</CodeBlockConfig>
</CodeTabs>

## ACLs
Expand Down
Loading

0 comments on commit 9378880

Please sign in to comment.