Skip to content

Considers only namespaces related to the agent project

Zamir Martins requested to merge consider_only_namespaces_related_to_agent into master

Related issue: gitlab-org/gitlab#294426 (closed)

Follow up from: !249 (merged)

Related frontend work: gitlab-org/gitlab!53401 (merged)

Scope of this MR

The idea behind this MR is to use the existing structure (both KAS and GitLab internal endpoints) in order to narrow down alerts within the scope of a single project. The current code has a cluster-wide scope, which would generate duplicated alerts in case there is more than one agent within the same cluster.

Implementation details: Project id (agent config project related) is already available within KAS, so with the changes proposed in this MR, it is getting propagated into Agentk as part of CiliumCF structure. CiliumAlert module uses this information as a label (e.g.,app.gitlab.com/proj='21') when querying for CiliumNetworkPolicies and only those are considered for the alert generation.

Out of scope of this MR (to be considered as possible follow-up issues)

  • Similar to how GitOps works (it can have multiple manifest projects), this feature could probably be extended to support either multiple projects or working as a group level feature.

  • Standardization of how labels, annotations are used across different modules has also been suggested as future work.

Edited by Zamir Martins

Merge request reports