// Module included in the following assemblies:
//
// * security/cert_manager_operator/cert-manager-customizing-api-fields.adoc

:_mod-docs-content-type: PROCEDURE
[id="cert-manager-override-environment-variables_{context}"]
= Customizing cert-manager by overriding environment variables from the cert-manager Operator API

[role="_abstract"]
To refine your deployment for specific operational requirements, override supported environment variables for the {cert-manager-operator}. You can customize these variables through the Operator API to apply configurations, such as proxy settings or system-level adjustments, that differ from the default values.

You can override the supported environment variables for the {cert-manager-operator} by adding a `spec.controllerConfig` section in the `CertManager` resource.

.Prerequisites

* You have access to the {product-title} cluster as a user with the `cluster-admin` role.

.Procedure

. Edit the `CertManager` resource by running the following command:
+
[source,terminal]
----
$ oc edit certmanager cluster
----

. Add a `spec.controllerConfig` section with the following override arguments:
+
[source,yaml]
----
apiVersion: operator.openshift.io/v1alpha1
kind: CertManager
metadata:
  name: cluster
  ...
spec:
  ...
  controllerConfig:
    overrideEnv:
      - name: HTTP_PROXY
        value: http://<proxy_url>
      - name: HTTPS_PROXY
        value: https://<proxy_url>
      - name: NO_PROXY
        value: <ignore_proxy_domains>
----
+
where:
+
`HTTP_PROXY`:: Specifies the proxy server URL.
`NO_PROXY`:: Specifies a comma separated list of domains. These domains are ignored by the proxy server.
+
[NOTE]
====
For more information about the overridable environment variables, see "Overridable environment variables for the cert-manager components" in "Explanation of fields in the CertManager custom resource".
====

. Save your changes and quit the text editor to apply your changes.

.Verification

. Verify that the cert-manager controller pod is redeployed by running the following command:
+
[source,terminal]
----
$ oc get pods -l app.kubernetes.io/name=cert-manager -n cert-manager
----
+
.Example output
[source,terminal]
----
NAME                          READY   STATUS    RESTARTS   AGE
cert-manager-bd7fbb9fc-wvbbt  1/1     Running   0          39s
----

. Verify that environment variables are updated for the cert-manager pod by running the following command:
+
[source,terminal]
----
$ oc get pod <redeployed_cert-manager_controller_pod> -n cert-manager -o yaml
----
+
.Example output
[source,yaml]
----
    env:
    ...
    - name: HTTP_PROXY
      value: http://<PROXY_URL>
    - name: HTTPS_PROXY
      value: https://<PROXY_URL>
    - name: NO_PROXY
      value: <IGNORE_PROXY_DOMAINS>
----
