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
metadata:
name: <name-for-the-entry> name: <name-for-the-entry>
read_rate: 100 spec:
write_rate: 100 mode: permissive
# the maximum number of read requests per second that the agent allows.
readRate: 100
# the maximum number of write requests per second that the agent allows.
writeRate: 100
kv: kv:
read_rate: 100 readRate: 100
write_rate: 100 writeRate: 100
acl: acl:
read_rate: 100 readRate: 100
write_rate: 100 writeRate: 100
catalog: catalog:
read_rate: 100 readRate: 100
write_rate: 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,8 +125,11 @@ 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
kind: ServiceDefaults
metadata:
name: api name: api
spec:
protocol: http protocol: http
envoyExtensions: envoyExtensions:
- name: builtin/wasm - name: builtin/wasm