Skip to content

added global proxy variables #573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 14, 2025
Merged

added global proxy variables #573

merged 13 commits into from
Jul 14, 2025

Conversation

ATGardner
Copy link
Contributor

@ATGardner ATGardner commented Jul 10, 2025

What

JIRA confluence

added

global:
  httpProxy: ''
  httpsProxy: ''
  noProxy: ''

values, which will end up as HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables on needed Pods.

Why

will allow to easily configure a forward-proxy, if the cluster is air-gapped, with the only access is through a specific server.

Notes

currently does not handle argocd-repo-server, which should be manually set using

  argo-cd:
    repoServer:
      env:
        - name: HTTP_PROXY
          value: '...'
        - name: HTTPS_PROXY
          value: '...'
        - name: NO_PROXY
          value: '...'

also - services should communicate with each other using FQDN, and not just the service name, to easily define the NO_PROXY.

@ATGardner ATGardner requested review from a team as code owners July 10, 2025 14:26
@ATGardner ATGardner self-assigned this Jul 10, 2025
@ATGardner ATGardner force-pushed the CR-28023-support-proxy branch from 91caa63 to e05e778 Compare July 10, 2025 19:07
@ATGardner ATGardner requested a review from Copilot July 12, 2025 04:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces global proxy settings (httpProxy, httpsProxy, noProxy) in the chart’s values and injects the corresponding HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables into all relevant components to support forward proxies in air‐gapped clusters.

  • Adds new global proxy fields to values.yaml
  • Updates multiple component templates to set the proxy environment variables
  • Leaves manual proxy configuration for the ArgoCD repo-server as noted

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
charts/gitops-runtime/values.yaml Adds httpProxy, httpsProxy, and noProxy globals
charts/gitops-runtime/templates/sources-server.yaml Injects proxy env vars into sources-server container
charts/gitops-runtime/templates/gitops-operator.yaml Injects proxy env vars into gitops-operator container
charts/gitops-runtime/templates/event-reporters/workflow-reporter/sensor.yaml Injects proxy env vars into workflow sensor
charts/gitops-runtime/templates/event-reporters/rollout-reporter/sensor.yaml Injects proxy env vars into rollout sensor
charts/gitops-runtime/templates/event-reporter.yaml Injects proxy env vars into event-reporter container
charts/gitops-runtime/templates/app-proxy/_app-proxy-env.yaml Injects proxy env vars into app-proxy env template
Comments suppressed due to low confidence (2)

charts/gitops-runtime/templates/app-proxy/_app-proxy-env.yaml:8

  • The HTTP_PROXY, HTTPS_PROXY, and NO_PROXY lines need to be indented to match the surrounding YAML (e.g., two spaces) so the generated manifest remains valid.
HTTP_PROXY: {{ .Values.global.httpProxy | quote }}

charts/gitops-runtime/templates/sources-server.yaml:17

  • [nitpick] This proxy injection pattern is repeated across multiple templates; consider extracting it into a shared helper (e.g., a partial template) to reduce duplication and simplify future updates.
{{/* Proxy environment variables */}}

@ATGardner
Copy link
Contributor Author

/e2e

ATGardner and others added 10 commits July 13, 2025 13:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Introduce a new helper function to set proxy environment variables
for HTTP, HTTPS, and noProxy. Update various templates to utilize
this function, ensuring consistent proxy configuration across
components. This change enhances the flexibility of proxy settings
in the GitOps runtime.
@ATGardner ATGardner force-pushed the CR-28023-support-proxy branch from 2d64f31 to 591fcf2 Compare July 13, 2025 10:23
@ATGardner
Copy link
Contributor Author

/e2e

@@ -18,6 +18,10 @@
{{- $_ := set $cfArgoCdExtrasContext.Values.eventReporter.container.env "ARGOCD_SERVER_ROOTPATH" (index .Values "global" "external-argo-cd" "server" "rootpath") }}
{{- end }}

{{- $globalProxyEnv := (include "codefresh-gitops-runtime.get-proxy-env-vars" . | fromYaml) }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not too thrilled about this env var manipulation. We should probably make this change in the event reporter chart to ingest the global value and set the environment variables

@@ -37,6 +37,10 @@
{{- $_ := set $gitopsOperatorContext.Values.global.codefresh.tls.caCerts.secretKeyRef "key" (.Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" .Values.global.codefresh.tls.caCerts.secret.key) .Values.global.codefresh.tls.caCerts.secretKeyRef.key) }}
{{- end }}

{{- $globalProxyEnv := (include "codefresh-gitops-runtime.get-proxy-env-vars" . | fromYaml) }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as event reporter. Would be much cleaner if it was handled in the operator chart.

@@ -14,6 +14,10 @@
{{- end }}
{{- end }}

{{- $globalProxyEnv := (include "codefresh-gitops-runtime.get-proxy-env-vars" . | fromYaml) }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for sources server.

@ATGardner
Copy link
Contributor Author

/e2e

@ATGardner ATGardner merged commit 0ad33f3 into main Jul 14, 2025
3 checks passed
@ATGardner ATGardner deleted the CR-28023-support-proxy branch July 14, 2025 06:54
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.

2 participants