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

networkCosts service discovery #2677

Merged
merged 1 commit into from
Oct 22, 2023
Merged

Conversation

jessegoodier
Copy link
Collaborator

@jessegoodier jessegoodier commented Oct 20, 2023

What does this PR change?

Allow users to run the network costs daemonset in any namespace without having to configure the target in Kubecost bundled prometheus.

  1. add additional labels to network cost pods
  2. adjust default scrapeConfig to find pods with these labels

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!)

Change networkCosts Prometheus service discovery to find the deamonset in any namespace

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

We are setting new default values:

app.kubernetes.io/instance: kubecost
app.kubernetes.io/name: network-costs

IMO, we should add similar labels to all other pods too.

How was this PR tested?

Tested in several different configs:

  1. Default install with networkCost enabled
  2. With serviceMonitor enabled in a BYO prometheus install
  3. Upgrading an old kubecost install with new chart

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

TBD, I think we should add the service discovery how to in the current doc: https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration#prometheus

@dwbrown2
Copy link
Contributor

I love the idea of this!

@jessegoodier jessegoodier marked this pull request as ready for review October 21, 2023 16:41
@jessegoodier jessegoodier enabled auto-merge (squash) October 21, 2023 16:42
@jessegoodier jessegoodier merged commit ae9f321 into develop Oct 22, 2023
11 checks passed
@jessegoodier jessegoodier deleted the network-costs-discovery branch October 22, 2023 19:17
@avrodrigues5
Copy link
Contributor

@jessegoodier does this also address problem of network costs enabled in a different namespace in a shared cluster and you want network costs show up in your namespace too?

does it mean the network cost running in a namespace other than yours has the two labels pointed out it should work? is that correct?

@jessegoodier
Copy link
Collaborator Author

@jessegoodier does this also address problem of network costs enabled in a different namespace in a shared cluster and you want network costs show up in your namespace too?

does it mean the network cost running in a namespace other than yours has the two labels pointed out it should work? is that correct?

yes, this will absolutely help with that use case.

ameijer added 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.

4 participants