Chapter 4. Configuring proxy settings for the authentication stack
You can configure a dedicated proxy for the authentication stack to reach external identity providers without using the cluster-wide egress proxy. This limits proxy-based egress to authentication components only.
4.1. Component-scoped proxy for authentication Copy linkLink copied to clipboard!
A component-scoped proxy allows the Cluster Authentication Operator (CAO) and the OAuth server to reach external identity providers (IdPs) without using the cluster-wide egress proxy. This limits proxy-based egress to authentication components only.
The OAuth server calls IdP endpoints on every login for OpenID Connect (OIDC) discovery, token exchange, user info retrieval, and group membership resolution. The CAO validates IdP connectivity through the proxy on each configuration change.
Component-scoped proxy for authentication is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
4.1.1. When to use a component-scoped proxy Copy linkLink copied to clipboard!
Use a component-scoped proxy to restrict proxy-based egress to authentication components. Use the cluster-wide proxy when all components share the same proxy.
When spec.proxy is set on the Authentication operator resource, it fully replaces the cluster-wide proxy for authentication components. No fields are inherited.
4.1.2. Proxy precedence Copy linkLink copied to clipboard!
The authentication stack resolves proxy configuration as follows:
-
When
spec.proxyis set, authentication components use only those settings. -
When
spec.proxyis absent, authentication components fall back to the cluster-wide proxy. - When neither is configured, no proxy is used.
4.1.3. Scope and limitations Copy linkLink copied to clipboard!
The component-scoped proxy applies to the following:
- Cluster Authentication Operator (CAO)
- OAuth server
The component-scoped proxy does not apply to the following:
- Hosted control planes: The CAO does not run in these environments.
- MicroShift: The authentication stack is not present.
- External OIDC mode: Not included in the initial implementation.
- Per-identity-provider proxy: Different proxy settings for different identity providers are not supported.
LDAP group sync CronJob resources are not managed by the authentication operator. Configure proxy settings on the CronJob pod specification independently.
4.2. Configuring a component-scoped proxy for authentication Copy linkLink copied to clipboard!
You can configure a component-scoped proxy for the authentication stack by setting the spec.proxy field on the Authentication operator resource.
Prerequisites
- You have cluster administrator privileges.
-
You have installed the OpenShift CLI (
oc). -
You have installed the
jqCLI tool. -
The
AuthenticationComponentProxyfeature gate is enabled by applying theTechPreviewNoUpgradeorDevPreviewNoUpgradefeature set. For more information, see "Enabling features using feature gates". - You have a working HTTP or HTTPS proxy server accessible from the cluster nodes.
Procedure
Optional: If the proxy requires a custom CA certificate, create a config map in the
openshift-confignamespace containing the CA bundle:Create a file called
auth-proxy-ca-bundle.yamlwith the following content:apiVersion: v1 kind: ConfigMap metadata: name: auth-proxy-ca-bundle namespace: openshift-config data: ca-bundle.crt: | -----BEGIN CERTIFICATE----- <PEM_encoded_CA_certificate> -----END CERTIFICATE-----name-
Specifies the config map name. Use this name in the
spec.proxy.trustedCA.namefield. namespace-
Specifies the namespace. Must be
openshift-config. ca-bundle.crt-
Specifies the Privacy-Enhanced Mail (PEM)-encoded CA certificate bundle. The key must be
ca-bundle.crt.
Create the config map by running the following command:
$ oc create -f auth-proxy-ca-bundle.yamlAlternatively, if you already have the CA certificate file, you can create the config map directly by running the following command:
$ oc create configmap auth-proxy-ca-bundle \ --from-file=ca-bundle.crt=<path_to_ca_certificate> \ -n openshift-config<path_to_ca_certificate>- Specifies the path to the PEM-encoded CA certificate file.
Edit the
Authenticationoperator resource to add the proxy configuration by running the following command:$ oc edit authentication.operator.openshift.io clusterAdd the
spec.proxyfield with your proxy settings:apiVersion: operator.openshift.io/v1 kind: Authentication metadata: name: cluster spec: managementState: Managed proxy: httpProxy: "http://proxy.example.com:3128" httpsProxy: "http://proxy.example.com:3128" noProxy: - ".example.com" - "idp.internal.example.com" trustedCA: name: "auth-proxy-ca-bundle"httpProxy-
Specifies the proxy URL for HTTP requests. At least one of
httpProxyorhttpsProxyis required. httpsProxy-
Specifies the proxy URL for HTTPS requests. At least one of
httpProxyorhttpsProxyis required. noProxy-
Specifies hostnames, domains, CIDR ranges, or IP addresses that bypass the proxy. Cluster-internal defaults (
.cluster.local,.svc,127.0.0.1, the Kubernetes API service IP, andlocalhost) are appended automatically. Maximum 64 entries. trustedCA-
Specifies the config map name in
openshift-configcontaining the proxy CA bundle under the keyca-bundle.crt. Required only if the proxy uses TLS interception or a private CA. Omit this block if you did not create a CA config map in step 1.
- Save the file to apply the changes.
Verification
Verify that the configuration was accepted by running the following command:
$ oc get authentication.operator.openshift.io cluster -o jsonpath='{.spec.proxy}' | jq .Example output
{ "httpProxy": "http://proxy.example.com:3128", "httpsProxy": "http://proxy.example.com:3128", "noProxy": [ ".example.com", "idp.internal.example.com" ], "trustedCA": { "name": "auth-proxy-ca-bundle" } }Verify that the authentication operator is not reporting errors by running the following command:
$ oc get clusteroperator authenticationExample output
NAME VERSION AVAILABLE PROGRESSING DEGRADED SINCE MESSAGE authentication {product-version}.0 True False False 10mThe
AVAILABLEcolumn showsTrueand theDEGRADEDcolumn showsFalse.Optional: Test authentication through the proxy by running the following command:
$ oc login
Changing the proxy URL triggers an OAuth server redeployment. On single-node OpenShift Container Platform deployments, this causes a brief authentication outage. Updates to trustedCA config map content are hot-reloaded without redeployment.
A misconfigured proxy can prevent the OAuth server from reaching the identity provider, locking all users out of the cluster. To recover, log in with kubeadmin credentials or client certificate authentication, both of which bypass OAuth, and correct the proxy configuration.
4.3. Authentication operator proxy field reference Copy linkLink copied to clipboard!
The spec.proxy object of the Authentication operator resource (operator.openshift.io/v1) defines proxy and trusted CA settings for authentication components.
| Field | Type | Description |
|---|---|---|
|
|
|
Specifies the proxy URL for HTTP requests. Must use the |
|
|
|
Specifies the proxy URL for HTTPS requests. Same format rules as |
|
|
|
Specifies hostnames, domains, CIDR ranges, or IP addresses that bypass the proxy. Each entry must be 1-253 characters. Maximum 64 entries. Duplicates are not permitted. Cluster-internal defaults ( |
|
|
|
Specifies the name of a config map in the |
4.3.1. Behavioral notes Copy linkLink copied to clipboard!
-
When
spec.proxyis set, it fully replaces the cluster-wide proxy for authentication. No fields are inherited. -
The proxy validation controller tests IdP connectivity on every configuration change and emits
OperatorStatusChangedevents when endpoints are unreachable. -
Proxy-level failures such as connection refused or TLS handshake errors cause the
Availablecondition to reportFalse. TheDegradedcondition remainsFalsebut includes diagnostic details from theProxyConfigControllersub-controller in its message. -
The operator injects
HTTP_PROXY,HTTPS_PROXY, andNO_PROXYenvironment variables into the OAuth server pod specification. Changes to these values trigger a redeployment. -
The
trustedCAconfig map is synced fromopenshift-configtoopenshift-authenticationby the operator. The OAuth server hot-reloads the mounted CA file without redeployment.
4.4. Troubleshooting authentication proxy connectivity Copy linkLink copied to clipboard!
If you encounter issues with the component-scoped proxy, you can diagnose and resolve them by reviewing operator conditions, events, and pod environment variables.
- Proxy-related operator events
The authentication operator emits events when proxy configuration changes cause failures. Check recent events by running the following command:
$ oc get events -n openshift-authentication-operator --sort-by=.lastTimestampLook for events with
reason: OperatorStatusChangedthat reference proxy connection errors. Verify that the proxy URL is correct, the proxy server is running, and the cluster nodes can reach the proxy.- Authentication operator reports proxy errors
A proxy-level failure such as connection refused, DNS resolution failure, or TLS handshake error causes the
Availablecondition to reportFalse. TheDegradedcondition message includes diagnostic details from theProxyConfigControllersub-controller even though theDegradedstatus remainsFalse. Check the operator status by running the following command:$ oc get clusteroperator authentication -o jsonpath='{.status.conditions}' | jq .Example output
[ { "type": "Available", "status": "False", "reason": "OAuthServerRouteEndpointAccessibleController_EndpointUnavailable", "message": "OAuthServerRouteEndpointAccessibleControllerAvailable: Get \"https://oauth-openshift.apps.example.com/healthz\": proxyconnect tcp: dial tcp: lookup proxy.example.com: no such host" }, { "type": "Progressing", "status": "True", "reason": "OAuthServerDeployment_PodsUpdating", "message": "deployment/oauth-openshift: 3/3 pods have been updated to the latest generation and 1/3 pods are available" }, { "type": "Degraded", "status": "False", "reason": "AsExpected", "message": "ProxyConfigControllerDegraded: failed to reach endpoint with error: Get \"https://oauth-openshift.apps.example.com/healthz\": proxyconnect tcp: dial tcp: lookup proxy.example.com: no such host" } ]The
Availablecondition showsFalsewhen the proxy is unreachable. TheDegradedcondition remainsFalsebut includes proxy error details from theProxyConfigControllerin its message. Check both conditions when diagnosing proxy issues.Verify that the proxy server is running, the proxy URL and port are correct, and the
trustedCAconfig map contains valid PEM-encoded certificates.- All users locked out after proxy misconfiguration
A misconfigured proxy can lock out all OAuth-authenticated users. To recover access:
-
Log in by using
kubeadmincredentials or client certificate authentication, both of which bypass OAuth. Correct the proxy configuration by running the following command:
$ oc edit authentication.operator.openshift.io clusterVerify that the authentication operator returns to a healthy state by running the following command:
$ oc get clusteroperator authenticationExample output
NAME VERSION AVAILABLE PROGRESSING DEGRADED SINCE MESSAGE authentication {product-version}.0 True False False 10m
-
Log in by using
- CA bundle not trusted by OAuth server
If the OAuth server cannot verify the proxy TLS certificate, check the following:
-
The config map exists in
openshift-configwith valid PEM-encoded certificates under the keyca-bundle.crt. -
The
spec.proxy.trustedCA.namevalue matches the actual config map name. The CA certificate chain is complete, including intermediate certificates.
The operator syncs the config map from
openshift-configtoopenshift-authenticationautomatically.
-
The config map exists in
- Brief authentication outage on single-node OpenShift Container Platform
-
Changing the proxy URL triggers an OAuth server redeployment. On single-node deployments, this causes a brief outage because only one replica is available. Make proxy URL changes during a maintenance window. Updates to
trustedCAconfig map content are hot-reloaded without redeployment. - LDAP group sync failing through proxy
LDAP group sync
CronJobresources are not managed by the authentication operator. Configure proxy environment variables on theCronJobpod specification independently. For example:apiVersion: batch/v1 kind: CronJob metadata: name: ldap-group-sync spec: jobTemplate: spec: template: spec: containers: - name: sync env: - name: HTTPS_PROXY value: "http://proxy.example.com:3128"- Cluster-wide proxy and component-scoped proxy both configured
The component-scoped proxy fully replaces the cluster-wide proxy for authentication components. To verify which proxy is active, inspect the OAuth server pod environment variables by running the following command:
$ oc get deployment oauth-openshift -n openshift-authentication -o jsonpath='{.spec.template.spec.containers[0].env}' | jq .Example output
[ { "name": "HTTP_PROXY", "value": "http://proxy.example.com:3128" }, { "name": "HTTPS_PROXY", "value": "http://proxy.example.com:3128" }, { "name": "NO_PROXY", "value": ".cluster.local,.example.com,.svc,127.0.0.1,172.30.0.1,idp.internal.example.com,localhost" } ]The
NO_PROXYvalue includes your configured entries and automatically appended cluster-internal defaults.