Backport of docs: Fix Kubernetes CRD example configs into release/1.16.x (#19438)

docs: Fix Kubernetes CRD example configs (#18878)

Fixes configuration examples for several Consul Kubernetes CRDs. The
CRDs were missing required fields such as `apiVersion`, `metadata`,
and `spec`.

Co-authored-by: Tu Nguyen <im2nguyen@gmail.com>
This commit is contained in:
Blake Covarrubias 2023-10-31 09:07:06 -04:00 committed by GitHub
parent f0c23587e0
commit 588e108c51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 156 additions and 126 deletions

View File

@ -87,20 +87,25 @@ Catalog = {
``` ```
```yaml ```yaml
kind: control-plane-request-limit apiVersion: consul.hashicorp.com/v1alpha1
mode: permissive kind: ControlPlaneRequestLimit
name: <name-for-the-entry> metadata:
read_rate: 100 name: <name-for-the-entry>
write_rate: 100 spec:
kv: mode: permissive
read_rate: 100 # the maximum number of read requests per second that the agent allows.
write_rate: 100 readRate: 100
acl: # the maximum number of write requests per second that the agent allows.
read_rate: 100 writeRate: 100
write_rate: 100 kv:
catalog: readRate: 100
read_rate: 100 writeRate: 100
write_rate: 100 acl:
readRate: 100
writeRate: 100
catalog:
readRate: 100
writeRate: 100
``` ```
</CodeTabs> </CodeTabs>

View File

@ -1281,12 +1281,12 @@ Forwarding = {
```yaml ```yaml
apiVersion: consul.hashicorp.com/v1alpha1 apiVersion: consul.hashicorp.com/v1alpha1
kind: jwtProvider kind: JWTProvider
metadata: metadata:
name: okta name: okta
spec: spec:
issuer: okta issuer: okta
jsonwebkeyset: jsonWebKeySet:
remote: remote:
uri: https://<org>.okta.com/oauth2/default/v1/keys uri: https://<org>.okta.com/oauth2/default/v1/keys
cacheDuration: 30m cacheDuration: 30m

View File

@ -84,7 +84,7 @@ Use the following example configurations to help you understand some of the comm
The following `proxy-defaults` configuration will enable gateways for all mesh services in the `local` mode. The following `proxy-defaults` configuration will enable gateways for all mesh services in the `local` mode.
<CodeTabs heading="Example: Enabling gateways globally."> <CodeTabs heading="Example: Enabling gateways globally">
```hcl ```hcl
Kind = "proxy-defaults" Kind = "proxy-defaults"
@ -95,10 +95,13 @@ MeshGateway {
``` ```
```yaml ```yaml
Kind: proxy-defaults apiVersion: consul.hashicorp.com/v1alpha1
MeshGateway: kind: ProxyDefaults
- Mode: local metadata:
Name: global name: global
spec:
meshGateway:
mode: local
``` ```
```json ```json
@ -128,10 +131,13 @@ MeshGateway {
``` ```
```yaml ```yaml
Kind: service-defaults apiVersion: consul.hashicorp.com/v1alpha1
MeshGateway: kind: ServiceDefaults
- Mode: local metadata:
Name: web name: web
spec:
meshGateway:
mode: local
``` ```
```json ```json

View File

@ -121,9 +121,13 @@ Peering {
``` ```
```yaml ```yaml
Kind: mesh apiVersion: consul.hashicorp.com/v1alpha1
Peering: kind: Mesh
PeerThroughMeshGateways: true metadata:
name: mesh
spec:
peering:
peerThroughMeshGateways: true
``` ```
</CodeTabs> </CodeTabs>

View File

@ -78,7 +78,7 @@ Use the following example configurations to help you understand some of the comm
The following `proxy-defaults` configuration will enable gateways for all mesh services in the `local` mode. The following `proxy-defaults` configuration will enable gateways for all mesh services in the `local` mode.
<CodeTabs heading="Example: Enabling gateways globally."> <CodeTabs heading="Example: Enabling gateways globally">
```hcl ```hcl
Kind = "proxy-defaults" Kind = "proxy-defaults"
@ -89,10 +89,13 @@ MeshGateway {
``` ```
```yaml ```yaml
Kind: proxy-defaults apiVersion: consul.hashicorp.com/v1alpha1
MeshGateway: kind: ProxyDefaults
- Mode: local metadata:
Name: global name: global
spec:
meshGateway:
mode: local
``` ```
```json ```json
@ -122,10 +125,13 @@ MeshGateway {
``` ```
```yaml ```yaml
Kind: service-defaults apiVersion: consul.hashicorp.com/v1alpha1
MeshGateway: kind: ServiceDefaults
- Mode: local metadata:
Name: web name: web
spec:
meshGateway:
mode: local
``` ```
```json ```json

View File

@ -94,7 +94,7 @@ Use the following example configurations to help you understand some of the comm
The following `proxy-defaults` configuration will enable gateways for all mesh services in the `local` mode. The following `proxy-defaults` configuration will enable gateways for all mesh services in the `local` mode.
<CodeTabs heading="Example: Enabling gateways globally."> <CodeTabs heading="Example: Enabling gateways globally">
```hcl ```hcl
Kind = "proxy-defaults" Kind = "proxy-defaults"
@ -105,10 +105,13 @@ MeshGateway {
``` ```
```yaml ```yaml
Kind: proxy-defaults apiVersion: consul.hashicorp.com/v1alpha1
MeshGateway: kind: ProxyDefaults
- Mode: local metadata:
Name: global name: global
spec:
meshGateway:
mode: local
``` ```
```json ```json
@ -137,10 +140,13 @@ MeshGateway {
``` ```
```yaml ```yaml
Kind: service-defaults apiVersion: consul.hashicorp.com/v1alpha1
MeshGateway: kind: ServiceDefaults
- Mode: local metadata:
Name: web name: web
spec:
meshGateway:
mode: local
``` ```
```json ```json

View File

@ -80,7 +80,7 @@ EnvoyExtensions = [
</CodeBlockConfig> </CodeBlockConfig>
</Tab> </Tab>
<Tab heading="Kubernetes" group="yaml"> <Tab heading="Kubernetes" group="yaml">
<CodeBlockConfig filename="api-auth-service-defaults"> <CodeBlockConfig filename="api-auth-service-defaults.yaml">
```yaml ```yaml
apiVersion: consul.hashicorp.com/v1alpha1 apiVersion: consul.hashicorp.com/v1alpha1

View File

@ -125,10 +125,13 @@ EOF
<CodeBlockConfig filename="wasm-extension-serve-waf.yaml"> <CodeBlockConfig filename="wasm-extension-serve-waf.yaml">
```yaml ```yaml
kind: service-defaults apiVersion: consul.hashicorp.com/v1alpha1
name: api kind: ServiceDefaults
protocol: http metadata:
envoyExtensions: name: api
spec:
protocol: http
envoyExtensions:
- name: builtin/wasm - name: builtin/wasm
required: true required: true
arguments: arguments: