diff --git a/cost-analyzer/templates/cost-analyzer-deployment-template.yaml b/cost-analyzer/templates/cost-analyzer-deployment-template.yaml index 03ed9caff..e7166aeca 100644 --- a/cost-analyzer/templates/cost-analyzer-deployment-template.yaml +++ b/cost-analyzer/templates/cost-analyzer-deployment-template.yaml @@ -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 }} @@ -375,8 +390,24 @@ 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 }} @@ -384,6 +415,20 @@ spec: - 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 diff --git a/cost-analyzer/templates/federator-deployment-template.yaml b/cost-analyzer/templates/federator-deployment-template.yaml index b32275b8d..864426e18 100644 --- a/cost-analyzer/templates/federator-deployment-template.yaml +++ b/cost-analyzer/templates/federator-deployment-template.yaml @@ -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: diff --git a/cost-analyzer/values.yaml b/cost-analyzer/values.yaml index 10ce5088a..deb968212 100644 --- a/cost-analyzer/values.yaml +++ b/cost-analyzer/values.yaml @@ -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: ""