Skip to content
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

add systemProxy env vars #2687

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion cost-analyzer/templates/cost-analyzer-deployment-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,21 @@ spec:
args:
- "--web.listen-address=:{{ .Values.global.gmp.gmpProxy.port }}"
- "--query.project-id={{ .Values.global.gmp.gmpProxy.projectId }}"
{{- if .Values.systemProxy.enabled }}
env:
- name: HTTP_PROXY
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: http_proxy
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: HTTPS_PROXY
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: https_proxy
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: NO_PROXY
value: {{ .Values.systemProxy.noProxy }}
- name: no_proxy
value: {{ .Values.systemProxy.noProxy }}
{{- end }}
ports:
- name: web
containerPort: {{ .Values.global.gmp.gmpProxy.port | int }}
Expand Down Expand Up @@ -375,15 +390,45 @@ spec:
ports:
- name: aws-sigv4-proxy
containerPort: {{ .Values.sigV4Proxy.port | int }}
{{- if .Values.sigV4Proxy.extraEnv }}
env:
- name: AGENT_LOCAL_PORT
value: "{{ .Values.sigV4Proxy.port | int }}"
{{- if .Values.systemProxy.enabled }}
- name: HTTP_PROXY
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: http_proxy
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: HTTPS_PROXY
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: https_proxy
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: NO_PROXY
value: {{ .Values.systemProxy.noProxy }}
- name: no_proxy
value: {{ .Values.systemProxy.noProxy }}
{{- end }}
{{- if .Values.sigV4Proxy.extraEnv }}
{{- toYaml .Values.sigV4Proxy.extraEnv | nindent 10 }}
{{- end }}
{{- end }}
{{- if .Values.global.gcpstore.enabled }}
- name: ubbagent
image: gcr.io/kubecost1/gcp-mp/ent/cost-model/ubbagent:1.0
env:
{{- if .Values.systemProxy.enabled }}
- name: HTTP_PROXY
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: http_proxy
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: HTTPS_PROXY
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: https_proxy
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: NO_PROXY
value: {{ .Values.systemProxy.noProxy }}
- name: no_proxy
value: {{ .Values.systemProxy.noProxy }}
{{- end }}
- name: AGENT_CONFIG_FILE
value: "/etc/ubbagent/config.yaml"
- name: AGENT_LOCAL_PORT
Expand Down
14 changes: 14 additions & 0 deletions cost-analyzer/templates/federator-deployment-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ spec:
{{- if .Values.federatedETL.federator.extraEnv }}
{{- toYaml .Values.federatedETL.federator.extraEnv | nindent 12 }}
{{- end }}
{{- if .Values.systemProxy.enabled }}
- name: HTTP_PROXY
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: http_proxy
value: {{ .Values.systemProxy.httpProxyUrl }}
- name: HTTPS_PROXY
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: https_proxy
value: {{ .Values.systemProxy.httpsProxyUrl }}
- name: NO_PROXY
value: {{ .Values.systemProxy.noProxy }}
- name: no_proxy
value: {{ .Values.systemProxy.noProxy }}
{{- end }}
restartPolicy: Always
serviceAccountName: {{ template "cost-analyzer.serviceAccountName" . }}
volumes:
Expand Down
7 changes: 5 additions & 2 deletions cost-analyzer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,11 @@ oidc:
# claimValues:
# - "editor"

# Adds an httpProxy as an environment variable. systemProxy.enabled must be `true`to have any effect.
# Ref: https://www.oreilly.com/library/view/security-with-go/9781788627917/5ea6a02b-3d96-44b1-ad3c-6ab60fcbbe4f.xhtml
## Adds the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables to all
## containers. Typically used in environments that have firewall rules which
## prevent kubecost from accessing cloud provider resources.
## Ref: https://www.oreilly.com/library/view/security-with-go/9781788627917/5ea6a02b-3d96-44b1-ad3c-6ab60fcbbe4f.xhtml
##
systemProxy:
enabled: false
httpProxyUrl: ""
Expand Down