From 5fa1d67ec65fff536b473dcb12b256e4c06a950c Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 3 Jun 2022 11:42:52 -0400 Subject: [PATCH] Add the instruction on how to override/add env vars for containers (#4995) --- .../operator/configuring-eventing-cr.md | 23 +++++++++++++++++++ .../operator/configuring-serving-cr.md | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/docs/install/operator/configuring-eventing-cr.md b/docs/install/operator/configuring-eventing-cr.md index 74476e75a..f0c221816 100644 --- a/docs/install/operator/configuring-eventing-cr.md +++ b/docs/install/operator/configuring-eventing-cr.md @@ -481,6 +481,29 @@ spec: - ssd ``` +### Override the environment variables + +The KnativeEventing resource is able to override or add the environment variables for the containers in the Knative Eventing +deployment resources. For example, if you would like to change the value of environment variable `METRICS_DOMAIN` in the +container `eventing-controller` into "knative.dev/my-repo" for the deployment `eventing-controller`, you need to change +your KnativeEventing CR as below: + +```yaml +apiVersion: operator.knative.dev/v1beta1 +kind: KnativeEventing +metadata: + name: knative-eventing + namespace: knative-eventing +spec: + deployments: + - name: eventing-controller + env: + - container: eventing-controller + envVars: + - name: METRICS_DOMAIN + value: "knative.dev/my-repo" +``` + ## Override system services If you would like to override some configurations for a specific service, you can override the configuration by using `spec.services` in CR. diff --git a/docs/install/operator/configuring-serving-cr.md b/docs/install/operator/configuring-serving-cr.md index 9ed148188..4f8b460c6 100644 --- a/docs/install/operator/configuring-serving-cr.md +++ b/docs/install/operator/configuring-serving-cr.md @@ -595,6 +595,29 @@ spec: - ssd ``` +### Override the environment variables + +The KnativeServing resource is able to override or add the environment variables for the containers in the Knative Serving +deployment resources. For example, if you would like to change the value of environment variable `METRICS_DOMAIN` in the +container `controller` into "knative.dev/my-repo" for the deployment `controller`, you need to change your KnativeServing +CR as below: + +```yaml +apiVersion: operator.knative.dev/v1beta1 +kind: KnativeServing +metadata: + name: knative-serving + namespace: knative-serving +spec: + deployments: + - name: controller + env: + - container: controller + envVars: + - name: METRICS_DOMAIN + value: "knative.dev/my-repo" +``` + ## Override system services If you would like to override some configurations for a specific service, you can override the configuration by using `spec.services` in CR.