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

Handle removal of PodMonitor for the CNPG and AppServices pods #1089

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

nhudson
Copy link
Collaborator

@nhudson nhudson commented Dec 19, 2024

After some extensive investigation we can see that the CNPG and AppService PodMonitors that are left set on the cluster when an instance is paused will cause Prometheus to spam the Kubernetes api server resulting in 429's and eventually having requests terminated.

Also update the Rust integration tests so they most likely will not fail

image

{
  "kind": "Event",
  "apiVersion": "audit.k8s.io/v1",
  "level": "Request",
  "auditID": "87904f2c-bc71-4349-9982-a283d313f91f",
  "stage": "ResponseComplete",
  "requestURI": "/api/v1/namespaces/charitably-lawful-archerfish/pods?allowWatchBookmarks=true&resourceVersion=1063570538&timeout=7m11s&timeoutSeconds=431&watch=true",
  "verb": "watch",
  "user": {
    "username": "system:serviceaccount:monitoring:monitoring-kube-prometheus-prometheus",
    "uid": "097ae7ef-2d68-48b8-a0d7-cd4150a16a5f",
    "groups": [
      "system:serviceaccounts",
      "system:serviceaccounts:monitoring",
      "system:authenticated"
    ],
    "extra": {
      "authentication.kubernetes.io/pod-name": [
        "prometheus-monitoring-kube-prometheus-prometheus-1"
      ],
      "authentication.kubernetes.io/pod-uid": [
        "f62815ad-b5a6-483d-b646-3ed3022ebffc"
      ]
    }
  },
  "sourceIPs": [
    "10.0.158.150"
  ],
  "userAgent": "Prometheus/2.41.0",
  "objectRef": {
    "resource": "pods",
    "namespace": "charitably-lawful-archerfish",
    "apiVersion": "v1"
  },
  "responseStatus": {
    "metadata": {},
    "code": 429
  },
  "requestReceivedTimestamp": "2024-12-16T21:21:24.557973Z",
  "stageTimestamp": "2024-12-16T21:21:24.558098Z"
}

This PR sets spec.monitoring.enablePodMonitor: false in the Cluster spec and removes any AppService PodMonitor

fixes: TEM-2229

@nhudson nhudson merged commit 9349649 into main Dec 19, 2024
14 checks passed
@nhudson nhudson deleted the nhudson/podmon/TEM-2229 branch December 19, 2024 21:46
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.

2 participants