Skip to content

Commit

Permalink
revises instructions to render yaml in yaml format, removing the kube…
Browse files Browse the repository at this point in the history
…ctl apply -f - <<EOF part (envoyproxy#3137)

Signed-off-by: Eitan Suez <eitan@tetrate.io>
  • Loading branch information
Eitan Suez committed Apr 9, 2024
1 parent c943042 commit fdf0b8e
Show file tree
Hide file tree
Showing 32 changed files with 448 additions and 418 deletions.
22 changes: 9 additions & 13 deletions site/content/en/latest/install/custom-cert.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ We use Cert-Manager to manage the certificates. You can install it by following

*You should not use the self-signed issuer in production, you should use a real CA issuer.*

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
Expand Down Expand Up @@ -56,13 +56,12 @@ We use Cert-Manager to manage the certificates. You can install it by following
spec:
ca:
secretName: envoy-gateway-ca
EOF
```
2. Create a cert for envoy gateway controller, the cert will be stored in secret `envoy-gatewy`.
2. Create a cert for envoy gateway controller, the cert will be stored in secret `envoy-gateway`.

```shell
cat<<EOF | kubectl apply -f -
```yaml
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand All @@ -86,13 +85,12 @@ We use Cert-Manager to manage the certificates. You can install it by following
- "key encipherment"
- "content commitment"
secretName: envoy-gateway
EOF
```

3. Create a cert for envoy proxy, the cert will be stored in secret `envoy`.

```shell
cat<<EOF | kubectl apply -f -
```yaml
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand All @@ -113,13 +111,12 @@ We use Cert-Manager to manage the certificates. You can install it by following
- "key encipherment"
- "content commitment"
secretName: envoy
EOF
```

4. Create a cert for rate limit, the cert will be stored in secret `envoy-rate-limit`.

```shell
cat<<EOF | kubectl apply -f -
```yaml
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
Expand All @@ -140,7 +137,6 @@ We use Cert-Manager to manage the certificates. You can install it by following
- "key encipherment"
- "content commitment"
secretName: envoy-rate-limit
EOF
```

5. Now you can follow the helm chart [installation guide](../install-helm) to install envoy gateway with custom certs.
65 changes: 27 additions & 38 deletions site/content/en/latest/tasks/operations/customize-envoyproxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ Before proceeding, you should be able to query the example backend using HTTP.

First, you need to add ParametersRef in GatewayClass, and refer to EnvoyProxy Config:

```shell
cat <<EOF | kubectl apply -f -
Apply the following resource to your cluster:

```yaml
---
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
Expand All @@ -28,15 +30,14 @@ spec:
kind: EnvoyProxy
name: custom-proxy-config
namespace: envoy-gateway-system
EOF
```
## Customize EnvoyProxy Deployment Replicas
You can customize the EnvoyProxy Deployment Replicas via EnvoyProxy Config like:
```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand All @@ -48,22 +49,21 @@ spec:
kubernetes:
envoyDeployment:
replicas: 2
EOF
```
After you apply the config, you should see the replicas of envoyproxy changes to 2.
And also you can dynamically change the value.
``` shell
```shell
kubectl get deployment -l gateway.envoyproxy.io/owning-gateway-name=eg -n envoy-gateway-system
```

## Customize EnvoyProxy Image

You can customize the EnvoyProxy Image via EnvoyProxy Config like:

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand All @@ -76,7 +76,6 @@ spec:
envoyDeployment:
container:
image: envoyproxy/envoy:v1.25-latest
EOF
```
After applying the config, you can get the deployment image, and see it has changed.
Expand All @@ -85,8 +84,8 @@ After applying the config, you can get the deployment image, and see it has chan
You can customize the EnvoyProxy Pod Annotations via EnvoyProxy Config like:
```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand All @@ -101,7 +100,6 @@ spec:
annotations:
custom1: deploy-annotation1
custom2: deploy-annotation2
EOF
```
After applying the config, you can get the envoyproxy pods, and see new annotations has been added.
Expand All @@ -110,8 +108,8 @@ After applying the config, you can get the envoyproxy pods, and see new annotati
You can customize the EnvoyProxy Deployment Resources via EnvoyProxy Config like:
```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand All @@ -130,15 +128,14 @@ spec:
limits:
cpu: 500m
memory: 1Gi
EOF
```
## Customize EnvoyProxy Deployment Env
You can customize the EnvoyProxy Deployment Env via EnvoyProxy Config like:
```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand All @@ -155,7 +152,6 @@ spec:
value: env_a_value
- name: env_b
value: env_b_value
EOF
```
> Envoy Gateway has provided two initial `env` `ENVOY_GATEWAY_NAMESPACE` and `ENVOY_POD_NAME` for envoyproxy container.
Expand All @@ -166,8 +162,8 @@ After applying the config, you can get the envoyproxy deployment, and see resour

You can customize the EnvoyProxy Deployment Volumes or VolumeMounts via EnvoyProxy Config like:

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand All @@ -188,7 +184,6 @@ spec:
- name: certs
secret:
secretName: envoy-cert
EOF
```

After applying the config, you can get the envoyproxy deployment, and see resources has been changed.
Expand All @@ -197,8 +192,8 @@ After applying the config, you can get the envoyproxy deployment, and see resour

You can customize the EnvoyProxy Service Annotations via EnvoyProxy Config like:

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand All @@ -212,8 +207,6 @@ spec:
annotations:
custom1: svc-annotation1
custom2: svc-annotation2
EOF
```

After applying the config, you can get the envoyproxy service, and see annotations has been added.
Expand All @@ -226,8 +219,8 @@ There are two ways to customize it:
* Replace: the whole bootstrap config will be replaced by the config you provided.
* Merge: the config you provided will be merged into the default bootstrap config.

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand Down Expand Up @@ -307,7 +300,6 @@ spec:
ads: {}
resource_api_version: V3
name: runtime-0
EOF
```

You can use [egctl translate][]
Expand All @@ -323,8 +315,8 @@ You can enable [Horizontal Pod Autoscaler](https://github.com/envoyproxy/gateway

Once confirmed, you can apply it via EnvoyProxy Config as shown below:

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand All @@ -344,7 +336,6 @@ spec:
averageUtilization: 60
type: Utilization
type: Resource
EOF
```

After applying the config, the EnvoyProxy HPA (Horizontal Pod Autoscaler) is generated. However, upon activating the EnvoyProxy's HPA, the Envoy Gateway will no longer reference the `replicas` field specified in the `envoyDeployment`, as outlined [here](#customize-envoyproxy-deployment-replicas).
Expand All @@ -354,8 +345,8 @@ After applying the config, the EnvoyProxy HPA (Horizontal Pod Autoscaler) is gen
You can customize the EnvoyProxy Command line options via `spec.extraArgs` in EnvoyProxy Config.
For example, the following configuration will add `--disable-extensions` arg in order to disable `envoy.access_loggers/envoy.access_loggers.wasm` extension:

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand All @@ -364,7 +355,6 @@ metadata:
spec:
extraArgs:
- --disable-extensions envoy.access_loggers/envoy.access_loggers.wasm
EOF
```

## Customize EnvoyProxy with Patches
Expand All @@ -373,8 +363,8 @@ You can customize the EnvoyProxy using patches.

For example, the following configuration will add resource limits to the `envoy` and the `shutdown-manager` containers in the `envoyproxy` deployment:

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
Expand Down Expand Up @@ -402,7 +392,6 @@ spec:
limits:
cpu: 200m
memory: 1024Mi
EOF
```

After applying the configuration, you will see the change in both containers in the `envoyproxy` deployment.
Expand Down
27 changes: 13 additions & 14 deletions site/content/en/latest/tasks/operations/deployment-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ and **creates** managed data plane resources such as EnvoyProxy `Deployment` in
each `tenant` deploy their own Envoy Gateway controller in their respective `namespace`. Below is an example of deploying Envoy Gateway
by the `marketing` and `product` teams in separate namespaces.

* Lets deploy Envoy Gateway in the `marketing` namespace and also watch resources only in this namespace. We are also setting the controller name to a unique string here `gateway.envoyproxy.io/marketing-gatewayclass-controller`.
* Deploy Envoy Gateway in the `marketing` namespace and also watch resources only in this namespace. We are also setting the controller name to a unique string here `gateway.envoyproxy.io/marketing-gatewayclass-controller`.

```shell
helm install \
Expand All @@ -55,10 +55,12 @@ eg-marketing oci://docker.io/envoyproxy/gateway-helm \
--version v0.0.0-latest -n marketing --create-namespace
```

Lets create a `GatewayClass` linked to the marketing team's Envoy Gateway controller, and as well other resources linked to it, so the `backend` application operated by this team can be exposed to external clients.
Create a `GatewayClass` linked to the marketing team's Envoy Gateway controller, and as well other resources linked to it, so the `backend` application operated by this team can be exposed to external clients.

```shell
cat <<EOF | kubectl apply -f -
Apply the following resources to your cluster:

```yaml
---
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
Expand Down Expand Up @@ -155,7 +157,6 @@ spec:
- path:
type: PathPrefix
value: /
EOF
```
Lets port forward to the generated envoy proxy service in the `marketing` namespace and send a request to it.
Expand Down Expand Up @@ -233,10 +234,10 @@ eg-product oci://docker.io/envoyproxy/gateway-helm \
--version v0.0.0-latest -n product --create-namespace
```

Lets create a `GatewayClass` linked to the product team's Envoy Gateway controller, and as well other resources linked to it, so the `backend` application operated by this team can be exposed to external clients.
Create a `GatewayClass` linked to the product team's Envoy Gateway controller, and as well other resources linked to it, so the `backend` application operated by this team can be exposed to external clients.

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
Expand Down Expand Up @@ -333,10 +334,9 @@ spec:
- path:
type: PathPrefix
value: /
EOF
```

Lets port forward to the generated envoy proxy service in the `product` namespace and send a request to it.
Port-forward to the generated envoy proxy service in the `product` namespace and send a request to it.

```shell
export ENVOY_SERVICE=$(kubectl get svc -n product --selector=gateway.envoyproxy.io/owning-gateway-namespace=product,gateway.envoyproxy.io/owning-gateway-name=eg -o jsonpath='{.items[0].metadata.name}')
Expand Down Expand Up @@ -606,10 +606,10 @@ Install the GatewayClass, Gateway, HTTPRoute and example app from [Quickstart][]
kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/latest/quickstart.yaml -n default
```

Lets create also and additional `Gateway` linked to the GatewayClass and `backend` application from Quickstart example.
Create an additional `Gateway` linked to the GatewayClass and `backend` application from Quickstart example.

```shell
cat <<EOF | kubectl apply -f -
```yaml
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
Expand Down Expand Up @@ -643,7 +643,6 @@ spec:
- path:
type: PathPrefix
value: /
EOF
```

Verify that Gateways are deployed and programmed
Expand Down
Loading

0 comments on commit fdf0b8e

Please sign in to comment.