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

🌱 observability: move metrics to config and use sidecar in kube-state-metrics #9390

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

chrischdi
Copy link
Member

What this PR does / why we need it:

This PR:

  • moves the metrics configuration from hack/observability/kube-state-metrics to config/metrics.
  • adds a ClusterRole in config/metrics/crd-clusterrole.yaml for the aggregated clusterrole for kube-state-metrics
  • adds a kustomization.yaml to config/metrics which includes the above two
  • Changes to the kustomization of kube-state-metrics:
    • Adds a patch to add a sidecar container to kube-state-metrics which
      • periodicly lists configmaps in namespace observability which have the label kube-state-metrics/custom-resource set
      • combines the yamls of the configmaps to a single configuration file for kube-state-metrics
      • updates the config file for kube-state-metrics so it reloads the configuration automatically
    • Adds a aggregated clusterrole + clusterrole binding so providers can dynamically add additional rbac rules to allow kube-state-metrics to watch the relevant resources
  • Changes to tilt up:
    • Adds a configuration option deploy_kustomizations which allows to define paths to additional kustomizations which then get deployed to the cluster
      • Example usage: to reference a kustomization which adds a configuration + clusterrole for additional kube-state-metrics crd configuration.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

/area observability

@k8s-ci-robot
Copy link
Contributor

@chrischdi: The label(s) area/observability cannot be applied, because the repository doesn't have them.

In response to this:

What this PR does / why we need it:

This PR:

  • moves the metrics configuration from hack/observability/kube-state-metrics to config/metrics.
  • adds a ClusterRole in config/metrics/crd-clusterrole.yaml for the aggregated clusterrole for kube-state-metrics
  • adds a kustomization.yaml to config/metrics which includes the above two
  • Changes to the kustomization of kube-state-metrics:
  • Adds a patch to add a sidecar container to kube-state-metrics which
    • periodicly lists configmaps in namespace observability which have the label kube-state-metrics/custom-resource set
    • combines the yamls of the configmaps to a single configuration file for kube-state-metrics
    • updates the config file for kube-state-metrics so it reloads the configuration automatically
  • Adds a aggregated clusterrole + clusterrole binding so providers can dynamically add additional rbac rules to allow kube-state-metrics to watch the relevant resources
  • Changes to tilt up:
  • Adds a configuration option deploy_kustomizations which allows to define paths to additional kustomizations which then get deployed to the cluster
    • Example usage: to reference a kustomization which adds a configuration + clusterrole for additional kube-state-metrics crd configuration.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

/area observability

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 11, 2023
@chrischdi
Copy link
Member Author

/area devtools

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Nice one, just a few smaller findings

config/metrics/kustomization.yaml Outdated Show resolved Hide resolved
docs/book/src/developer/tilt.md Outdated Show resolved Hide resolved
@sbueringer
Copy link
Member

Thank you!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 13, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 58ea5fcdb7a72dee5dea369e481b5f73c35fe33d

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 13, 2023
@k8s-ci-robot k8s-ci-robot merged commit 8b0e797 into kubernetes-sigs:main Sep 13, 2023
22 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.6 milestone Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/devtools Issues or PRs related to devtools cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants