About the egress proxy for the External Secrets Operator for Red Hat OpenShift¶
If a cluster-wide egress proxy is configured in OpenShift Container Platform, the Operator Lifecycle Manager (OLM) automatically configures Operators that it manages with the cluster-wide proxy. OLM automatically updates all of the Operator deployments with the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables.
Configuring the egress proxy for the External Secrets Operator for Red Hat OpenShift¶
The egress proxy can be configured in the ExternalSecretsConfig or the ExternalSecretsManager custom resource (CR). The Operator and the operand make use of the OpenShift Container Platform supported certificate authority (CA) bundle for the proxy validations.
The Operator can automatically create and manage a NetworkPolicy such as eso-sys-allow-proxy-egress, that allows all external-secrets pods to reach the proxy server. You control this behavior by using the networkPolicyProvisioning field. The field can be set in either the ExternalSecretsConfig CR or the ExternalSecretsManager CR, and can be configured independently of proxy URL fields. For example, when the proxy is provided by Operator Lifecycle Manager (OLM) environment variables at the cluster level, you can set only networkPolicyProvisioning in either CR without specifying any proxy URLs.
Prerequisites
- You have access to the cluster as a user with the
cluster-adminrole. - You have created the
ExternalSecretsConfigcustom CR.
Procedure
-
To set the proxy in the
ExternalSecretsConfigresource, perform the following steps:-
Edit the
ExternalSecretsConfigresource by running the following command: -
Edit the
spec.appConfig.proxysection to set the proxy values as follows:apiVersion: operator.openshift.io/v1alpha1 kind: ExternalSecretsConfig ... spec: appConfig: proxy: httpProxy: <http_proxy> httpsProxy: <https_proxy> noProxy: <no_proxy> networkPolicyProvisioning: Managedwhere:
spec.appConfig.proxy.httpProxy- Specifies the proxy URL for the HTTP requests.
-
spec.appConfig.proxy.httpsProxy- Specifies the proxy URL for the HTTPS requests.
spec.appConfig.proxy.noProxy- Specifies a comma-separated list of hostnames, CIDRs, IPs or a combination of these, for which the proxy should not be used.
spec.appConfig.proxy.networkPolicyProvisioning- Specifies whether the Operator automatically creates and manages the
eso-sys-allow-proxy-egressNetworkPolicy. Accepted values areManaged, which is the default, andUnmanaged. When set toManaged, the Operator creates the policy based on the proxy URL port and deletes it when the proxy is removed. When set toUnmanaged, the Operator does not create or delete the policy and you are responsible for managing proxy egress traffic.
-
To set the proxy in the
ExternalSecretsManagerCR, perform the following steps:-
Edit the
ExternalSecretsManagerCR by running the following command: -
Edit the
spec.globalConfig.proxysection to set the proxy values as follows:apiVersion: operator.openshift.io/v1alpha1 kind: ExternalSecretsManager ... spec: globalConfig: proxy: httpProxy: <http_proxy> httpsProxy: <https_proxy> noProxy: <no_proxy> networkPolicyProvisioning: Managedwhere:
spec.appConfig.proxy.httpProxy- Specifies the proxy URL for the HTTP requests.
-
spec.appConfig.proxy.httpsProxy- Specifies the proxy URL for the HTTPS requests.
spec.appConfig.proxy.noProxy- Specifies a comma-separated list of hostnames, CIDRs, IPs or a combination of these, for which the proxy should not be used.
spec.appConfig.proxy.networkPolicyProvisioning-
Specifies whether the Operator automatically creates and manages the
eso-sys-allow-proxy-egressNetworkPolicy. The values areManaged, which is the default, andUnmanaged.
-
If the proxy is configured at the cluster level through OLM environment variables and you only want to control
NetworkPolicyprovisioning without specifying proxy URLs in a CR, set only thenetworkPolicyProvisioningfield in either CR as follows:
Verification
-
Verify that the proxy egress
NetworkPolicywas created by running the following command:The policy should show an egress rule allowing transmission control protocol (TCP) traffic on the port derived from the configured proxy URL.
-
Verify that the proxy configuration is applied to the
external-secretsdeployment by running the following command:
Additional resources