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

Implement cos-agent integration #24

Merged
merged 4 commits into from
Feb 20, 2024
Merged

Implement cos-agent integration #24

merged 4 commits into from
Feb 20, 2024

Conversation

mateoflorido
Copy link
Member

Overview

Implement the cos-agent integration for k8s and k8s-worker charms.

Rationale

This pull request introduces an implementation for integrating our charms with the Canonical Observability Stack. In this first version, we demonstrate the capabilities of sending scrape jobs to Prometheus over relation data for the following Kubernetes components:

  1. Kubernetes Control Plane (k8s):
    • Kube API Server
    • Kube Controller Manager
    • Kube Proxy
    • Kube Scheduler
    • Kubelet
      • cAdvisor
      • Probes
    • Kube State Metrics
  2. Kubernetes Worker (k8s-worker):
    • Kubelet
      • cAdvisor
      • Probes
    • Kube Proxy

This initial version of the integration relies on manual testing. Integration tests will be introduced in future PRs.

Module Changes

  • Introduced a new TokenDistributor module to generalize token distribution for the cluster and cos-tokens relations.
  • Introduced a COSIntegration helper class to generate Prometheus scrape jobs for the Kubernetes components.

Library Changes

  • Added cos-agent library.
  • Added cosl package.

@mateoflorido mateoflorido marked this pull request as ready for review February 16, 2024 23:05
@mateoflorido mateoflorido requested a review from a team as a code owner February 16, 2024 23:05
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has totally checked 57 files.

Valid Invalid Ignored Fixed
13 5 39 0
Click to see the invalid file list
  • charms/worker/k8s/lib/charms/grafana_agent/v0/cos_agent.py
  • charms/worker/k8s/src/cos_integration.py
  • charms/worker/k8s/src/token_distributor.py
  • charms/worker/k8s/templates/cos_roles.yaml
  • charms/worker/k8s/templates/ksm.yaml

charms/worker/k8s/lib/charms/grafana_agent/v0/cos_agent.py Outdated Show resolved Hide resolved
charms/worker/k8s/src/cos_integration.py Show resolved Hide resolved
charms/worker/k8s/src/token_distributor.py Show resolved Hide resolved
charms/worker/k8s/templates/cos_roles.yaml Show resolved Hide resolved
charms/worker/k8s/templates/ksm.yaml Show resolved Hide resolved
Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

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

I ❤️ token_distributor. We can work with this!

@addyess addyess merged commit 69c887b into main Feb 20, 2024
21 checks passed
@addyess addyess deleted the KU-59/prometheus branch February 20, 2024 21:09
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