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

Deprecate cattle.io API Group #19

Merged
merged 6 commits into from
Oct 17, 2024
Merged

Deprecate cattle.io API Group #19

merged 6 commits into from
Oct 17, 2024

Conversation

puffitos
Copy link
Member

@puffitos puffitos commented Oct 16, 2024

Motivation

The cattle.io API group doesn't exist in any of our clusters anymore. The related resources to cluster monitoring (project-monitoring, the custom project owner role) use this apiGroup still, and this is the foundation stone for all of it go to away.

Changes

  • Bumped to go1.23
  • Bumped dependencies
  • Added fallback logic for cattle.io review, in case the first one fails.
  • Added golangci (must still do major cleanup here)

Tests done

Tested in staging with old & new project monitoring deployments. Both get their metrics federated via the prometheus /federate endpoint.

New project monitoring logs:

prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:46:25Z] GET - /federate
prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:46:25Z] sending access review for namespace "caas-operations-monitoring"
prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:46:25Z] searching for namespace "caas-operations-monitoring" in cache
prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:46:25Z] raw federate[00000000670fdfd1 - 0] => {__name__=~".+"}
prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:46:25Z] hjk federate[00000000670fdfd1 - 0] => {__name__=~".+",namespace=~"caas-eck-operator|caas-keda|caas-operations-monitoring|cattle-gatekeeper-system|cattle-project-caas-operations|cluster-autoscaler|cosignwebhook|crossplane-system|namespace-provisioner-system|navlinkswebhook|ranchertoicinga2|caasglobal"}

Old project monitoring logs:

prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:56:29Z] GET - /federate
prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:56:29Z] sending access review for namespace "demoapp"
prometheus-rancher-monitoring-prometheus-0 prometheus-agent WARN[2024-10-16T15:56:29Z] namespace "demoapp" is still using the deprecated monitoring.cattle.io group
prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:56:29Z] searching for namespace "demoapp" in cache
prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:56:29Z] raw federate[00000000670fe22d - 0] => {__name__=~".+"}
prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:56:29Z] hjk federate[00000000670fe22d - 0] => {__name__=~".+",namespace=~"demoapp|demoapp2|demoapp3|democluster|caasglobal"}
prometheus-rancher-monitoring-prometheus-0 prometheus-agent DEBU[2024-10-16T15:56:39Z] GET - /federate

allow serviceaccounts with view verb on prometheus of any apiGroup
access to the namespaced metrics. This is to be able to deprecate the
cattle.io apiGroup, which is not used anymore in the caas monitoring landscape

Signed-off-by: Bruno Bressi <[email protected]>
The apiGroup is now only supported as a fallback apiGroup. It will be removed completely in the next
release and no authorization will be done on it

Signed-off-by: Bruno Bressi <[email protected]>
@puffitos puffitos added the dependencies Pull requests that update a dependency file label Oct 16, 2024
Copy link

@y-eight y-eight left a comment

Choose a reason for hiding this comment

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

looks good to me (y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants