Tracking usage of Network Policies in Auto Deploy using Usage Data API
Problem to solve
As part of the removal of one-click apps (&4280), we stopped updating the associated database records. This inadvertently broke a piece of Cilium's usage metrics that relied the presence of Cilium's application record to measure usage. We need a replacement.
Details
From this discussion (internal link), the desired outcome is
[measuring] the number of clusters that are managing their Network Policies through GitLab regardless of how Cilium was installed
GitLab offers two ways to manage (Cilium) Network Policies:
- Auto DevOps (this issue), and
- A UI based policy editor
This issue is about tracking (1). Work on (2) is being tracked in #334090 (closed)
Proposal
- Add a
CI_KUBERNETES_CLUSTER_IDdeployment variable with the cluster being used - Extend the usage data API with an
increment_unique_valuesendpoint so we can call it with the cluster ID. We may also need extend access to the API to CI jobs - Use the endpoint from
auto-deploy-imagewhen we detect network policies being used
Edited by Hordur Freyr Yngvason