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

add systemProxy env vars #2687

merged 3 commits into from
Oct 26, 2023

Conversation

jessegoodier
Copy link
Collaborator

What does this PR change?

Add systemProxy env variables to amp/gmp/federator containers

Does this PR rely on any other PRs?

no

How does this PR impact users? (This is the kind of thing that goes in release notes!)

Added systemProxy env variables to amp/gmp/federator containers

What risks are associated with merging this PR? What is required to fully test this PR?

Worst case would be spacing, but I verified each block was aligned, though I didn't deploy each.

How was this PR tested?

changing gmp and amp, federator on:

global:
  gmp:
    enabled: true
    prometheusServerEndpoint: https://localhost:8085/xxxxx/
    remoteWriteService: https://test.com
    sigv4:
      region: us-east-2
systemProxy:
  enabled: true
  httpProxyUrl: http://test
  httpsProxyUrl: http://test1
  noProxy: "0,localhost"

Have you made an update to documentation? If so, please provide the corresponding PR.

NA

@jessegoodier jessegoodier requested a review from thomasvn October 24, 2023 18:48
Copy link
Collaborator

@chipzoller chipzoller left a comment

Choose a reason for hiding this comment

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

Why are the env vars being duplicated except with different cases?

@jessegoodier
Copy link
Collaborator Author

Why are the env vars being duplicated except with different cases?

Best I could find is because linux doesn't have a governing body.

@thomasvn
Copy link
Member

Interesting that .Values.systemProxy already exists, but isn't currently referenced anywhere in the helm chart.

# 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
systemProxy:
enabled: false
httpProxyUrl: ""
httpsProxyUrl: ""
noProxy: ""

A few requests for this PR:

  • Could we further document in the values.yaml specific situations when a user needs to set this value?
  • We are only setting this env var for containers created in the cost-analyzer-deployment-template.yaml and federator-deployment-template.yaml. Do we need to set these env vars for other containers? (e.g. Prometheus, KSM, metrics emitter, etc)

@jessegoodier
Copy link
Collaborator Author

Interesting that .Values.systemProxy already exists, but isn't currently referenced anywhere in the helm chart.

# 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
systemProxy:
enabled: false
httpProxyUrl: ""
httpsProxyUrl: ""
noProxy: ""

A few requests for this PR:

  • Could we further document in the values.yaml specific situations when a user needs to set this value?
  • We are only setting this env var for containers created in the cost-analyzer-deployment-template.yaml and federator-deployment-template.yaml. Do we need to set these env vars for other containers? (e.g. Prometheus, KSM, metrics emitter, etc)

Thank you for the review!
we do use this, currently here: https://github.com/kubecost/cost-analyzer-helm-chart/blob/v1.106/cost-analyzer/templates/cost-analyzer-deployment-template.yaml#L850

It is only needed for things that would exit the cluster, so what I have here. Perhaps thanos stuff, but that's outside of scope for what we need here.

I'll add a comment. Suggesting that this problem is a good use-case for a service mesh. :)

@chipzoller
Copy link
Collaborator

Why are the env vars being duplicated except with different cases?

Best I could find is because linux doesn't have a governing body.

Most env vars standardize on upper case, these proxy vars as well, so I suggest dropping the lower case duplicates.

@jessegoodier
Copy link
Collaborator Author

Why are the env vars being duplicated except with different cases?

Best I could find is because linux doesn't have a governing body.

Most env vars standardize on upper case, these proxy vars as well, so I suggest dropping the lower case duplicates.

I agree that it looks dumb and someone should have figured this out 20 years ago.

These systemProxy variables with the duplicate case are not new to our helm chart, or linux.

If you want to test the possible permutations, I'd be happy to review that change.

Otherwise, I'm simply looking to fix the problem for the small handful of users that depend on this setting.

@jessegoodier jessegoodier enabled auto-merge (squash) October 25, 2023 01:49
@thomasvn
Copy link
Member

thomasvn commented Oct 26, 2023

@jessegoodier Tested this PR with the following values. Validated that it's adding the system proxy env vars to the cost-model in cost-analyzer and federator.

systemProxy:
  enabled: true
  httpProxyUrl: "http://TEST"
  httpsProxyUrl: "https://TEST"
  noProxy: "TEST"
federatedETL:
  federator:
    enabled: true
helm template ./cost-analyzer -f values.yaml > test1.yaml

cost-analyzer/values.yaml Outdated Show resolved Hide resolved
@jessegoodier jessegoodier merged commit b656f8d into develop Oct 26, 2023
10 checks passed
@jessegoodier jessegoodier deleted the jesse-add-systemproxy-amp branch October 26, 2023 19:12
jessegoodier added a commit that referenced this pull request Oct 27, 2023
jessegoodier added a commit that referenced this pull request Oct 27, 2023
ameijer pushed a commit that referenced this pull request Oct 30, 2023
…etl-utils-pod

* commit 'b675a8cacaa5b6c64cf00d3583df026cfc2ec507': (28 commits)
  exec (#2701)
  swap jimmidyson/configmap-reload for prometheus-operator/prometheus-config-reloader (#2698)
  update savedReports and advancedReports in values.yml to reflect current filter schema
  add systemProxy env vars (#2687)
  feat(cost-analyzer): add StatefulSet as option (#2188)
  [Feature] Development guide and devcontainers (#2680)
  Bump actions/checkout from 4.1.0 to 4.1.1 (#2683)
  remove replicasets from core (#2678)
  networkCosts service discovery (#2677)
  Begin Helm testing (#2674)
  update securityContexts (#2669)
  consistent image name for aggregator (#2676)
  Add version matrix and more tests (#2664)
  label consistency (#2673)
  setting to 50h to match etl retention time (#2667)
  pv sizing proxy for wf
  add missing bracket
  add ability to override cc sa name
  Added /savings/localLowDisks proxy for Aggregator.
  update perms (#2662)
  ...
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.

3 participants