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
kind: control-plane-request-limit
mode: permissive
name: <name-for-the-entry>
read_rate: 100
write_rate: 100
kv:
read_rate: 100
write_rate: 100
acl:
read_rate: 100
write_rate: 100
catalog:
read_rate: 100
write_rate: 100
apiVersion: consul.hashicorp.com/v1alpha1
kind: ControlPlaneRequestLimit
metadata:
name: <name-for-the-entry>
spec:
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:
readRate: 100
writeRate: 100
acl:
readRate: 100
writeRate: 100
catalog:
readRate: 100
writeRate: 100
```
</CodeTabs>

View File

@ -1281,12 +1281,12 @@ Forwarding = {
```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: jwtProvider
kind: JWTProvider
metadata:
name: okta
spec:
issuer: okta
jsonwebkeyset:
jsonWebKeySet:
remote:
uri: https://<org>.okta.com/oauth2/default/v1/keys
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.
<CodeTabs heading="Example: Enabling gateways globally.">
<CodeTabs heading="Example: Enabling gateways globally">
```hcl
Kind = "proxy-defaults"
@ -95,10 +95,13 @@ MeshGateway {
```
```yaml
Kind: proxy-defaults
MeshGateway:
- Mode: local
Name: global
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
metadata:
name: global
spec:
meshGateway:
mode: local
```
```json
@ -128,10 +131,13 @@ MeshGateway {
```
```yaml
Kind: service-defaults
MeshGateway:
- Mode: local
Name: web
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceDefaults
metadata:
name: web
spec:
meshGateway:
mode: local
```
```json

View File

@ -121,9 +121,13 @@ Peering {
```
```yaml
Kind: mesh
Peering:
PeerThroughMeshGateways: true
apiVersion: consul.hashicorp.com/v1alpha1
kind: Mesh
metadata:
name: mesh
spec:
peering:
peerThroughMeshGateways: true
```
</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.
<CodeTabs heading="Example: Enabling gateways globally.">
<CodeTabs heading="Example: Enabling gateways globally">
```hcl
Kind = "proxy-defaults"
@ -89,10 +89,13 @@ MeshGateway {
```
```yaml
Kind: proxy-defaults
MeshGateway:
- Mode: local
Name: global
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
metadata:
name: global
spec:
meshGateway:
mode: local
```
```json
@ -122,10 +125,13 @@ MeshGateway {
```
```yaml
Kind: service-defaults
MeshGateway:
- Mode: local
Name: web
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceDefaults
metadata:
name: web
spec:
meshGateway:
mode: local
```
```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.
<CodeTabs heading="Example: Enabling gateways globally.">
<CodeTabs heading="Example: Enabling gateways globally">
```hcl
Kind = "proxy-defaults"
@ -105,10 +105,13 @@ MeshGateway {
```
```yaml
Kind: proxy-defaults
MeshGateway:
- Mode: local
Name: global
apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
metadata:
name: global
spec:
meshGateway:
mode: local
```
```json
@ -137,10 +140,13 @@ MeshGateway {
```
```yaml
Kind: service-defaults
MeshGateway:
- Mode: local
Name: web
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceDefaults
metadata:
name: web
spec:
meshGateway:
mode: local
```
```json

View File

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

View File

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