Skip to content

fix: augment NO_PROXY with required internal exclusions in proxy-env ConfigMap#359

Open
rooftopcellist wants to merge 2 commits into
ansible:mainfrom
rooftopcellist:fix/no-proxy-augmentation
Open

fix: augment NO_PROXY with required internal exclusions in proxy-env ConfigMap#359
rooftopcellist wants to merge 2 commits into
ansible:mainfrom
rooftopcellist:fix/no-proxy-augmentation

Conversation

@rooftopcellist

@rooftopcellist rooftopcellist commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

When a cluster-wide egress proxy is configured on OpenShift, the operator propagates NO_PROXY verbatim from the operator pod environment into the proxy-env ConfigMap that is mounted via envFrom into operand containers. OCP's default NO_PROXY uses .svc and .svc.cluster.local suffix patterns, which do not match the bare short service names operators use for internal communication (e.g. http://<cr-name>). This causes internal traffic — including JWT key validation calls — to route through the corporate proxy instead of staying in-cluster, producing authentication failures and component unavailability.

This fix augments NO_PROXY before writing it to the ConfigMap:

  • Customer-provided entries are preserved first, in their original order
  • Required internal exclusions are appended if not already present: localhost, 127.0.0.1, ::1, [::1], .svc, .svc.cluster.local, the CR short name, and the namespaced CR name
  • NO_PROXY is now emitted whenever any proxy variable is set, not only when NO_PROXY itself is non-empty
  • The unique filter ensures deterministic ordering across reconciliation loops (prevents spurious pod restarts from changing ConfigMap checksums)

Related

  • AAP-83822 — Jira tracking issue for this fix across all operators
  • AAP-83727 — Sev1 customer escalation (JWT 401 errors on proxy-configured OCP clusters)
  • aap-gateway-operator MR !1011 — same fix applied to the gateway operator first
  • KCS workaround: https://access.redhat.com/solutions/7145692

Test Plan

  • Deploy operator on an OCP cluster with a cluster-wide egress proxy configured
  • Confirm <cr-name>-proxy-env ConfigMap is created and NO_PROXY value contains all required internal exclusions
  • Confirm customer-provided NO_PROXY entries are preserved
  • Confirm no regression on clusters without a proxy configured (ConfigMap absent when no proxy vars set)
  • Confirm NO_PROXY value is byte-for-byte identical across consecutive reconciliation loops

Summary by CodeRabbit

  • Bug Fixes
    • Improved proxy configuration by emitting NO_PROXY/no_proxy whenever any proxy setting is provided.
    • Normalizes no_proxy input by splitting on commas, trimming whitespace, and removing empty entries.
    • Ensures required local, cluster, and service hostnames are always included (including expected -api and -daphne variants).
    • Deduplicates the final list to prevent redundant entries and improve connectivity reliability.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@rooftopcellist, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 665a580b-5270-44a2-9aa6-151d58459533

📥 Commits

Reviewing files that changed from the base of the PR and between 7a1e8a7 and b12a48a.

📒 Files selected for processing (1)
  • roles/eda/templates/eda-proxy-env.configmap.yaml.j2
📝 Walkthrough

Walkthrough

The proxy environment ConfigMap template generates NO_PROXY and no_proxy from normalized, deduplicated configured exclusions and required local, cluster, service, operator, and namespace hostnames.

Changes

Proxy environment configuration

Layer / File(s) Summary
Normalize proxy exclusions
roles/eda/templates/eda-proxy-env.configmap.yaml.j2
NO_PROXY and no_proxy are rendered when any proxy setting is configured, combining trimmed exclusions with required hostnames, removing duplicates, and serializing the result with to_yaml.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: augmenting NO_PROXY in the proxy-env ConfigMap with required internal exclusions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

no_proxy: '{{ no_proxy }}'
{% if http_proxy or https_proxy or no_proxy %}
{% set _no_proxy_list = (no_proxy | default('')).split(',') | map('trim') | select | list %}
{% set _required = ['localhost', '127.0.0.1', '::1', '[::1]', '.svc', '.svc.cluster.local', ansible_operator_meta.name, ansible_operator_meta.name + '.' + ansible_operator_meta.namespace] %}

@mkanoor mkanoor Jul 22, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rooftopcellist This host name should also be in the exclusion list.

EDA_WEBSOCKET_BASE_URL: "ws://{{ websocket_server_name }}:{{ websocket_port }}"

Thats the WebSocketServer that ansible-rulebook will connect to and it should not go thru the proxy server.
Both of these websocket_server_name and api_server_name

EDA_WEBSOCKET_BASE_URL: "ws://{{ websocket_server_name }}:{{ websocket_port }}"
  EDA_WEBSOCKET_TOKEN_BASE_URL: "http://{{ api_server_name }}:{{ api_nginx_port }}"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, it now includes those:

  • Standard: localhost, 127.0.0.1, ::1, [::1], .svc, .svc.cluster.local
  • CR name + namespaced: <cr-name>, <cr-name>.<namespace>
  • API server: <cr-name>-api, <cr-name>-api.<namespace> (EDA_WEBSOCKET_TOKEN_BASE_URL)
  • WebSocket server: <cr-name>-daphne, <cr-name>-daphne.<namespace> (EDA_WEBSOCKET_BASE_URL)

…ConfigMap

When a cluster-wide egress proxy is configured on OCP, NO_PROXY is
propagated verbatim from the operator pod environment. OCP's default
NO_PROXY uses .svc/.svc.cluster.local suffix patterns that do not match
the bare short service names used for internal communication, causing
internal traffic to route through the corporate proxy.

Augment NO_PROXY before writing it to the ConfigMap: preserve customer
entries first, then append required exclusions (loopbacks, .svc suffixes,
CR short name, namespaced CR name). Use unique filter for determinism
across reconciliation loops. Emit NO_PROXY whenever any proxy var is set.

Related: AAP-83822

Signed-off-by: Christian M. Adams <chadams@redhat.com>
@rooftopcellist
rooftopcellist force-pushed the fix/no-proxy-augmentation branch from 893a4b6 to 7a1e8a7 Compare July 22, 2026 14:22
EDA (via ansible-rulebook) contacts the gateway when launching Job
Templates using EDA_CONTROLLER_URL, which resolves to automation_server_url
in the EDA CR spec. If this URL's hostname is not in NO_PROXY, those
calls are routed through the corporate proxy instead of staying in-cluster.

Since automation_server_url is user-provided and may differ from the EDA
CR name, the hostname cannot be statically inferred. Extract it from the
configured URL at template render time and append it to the required
exclusion list.

Signed-off-by: Christian M. Adams <chadams@redhat.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants