Uploaded image for project: 'OpenShift GitOps'
  1. OpenShift GitOps
  2. GITOPS-4659

Implement Labels in Argo CD K8s events feature

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Normal Normal
    • 1.14.0
    • None
    • None
    • None
    • 8
    • GitOps Crimson - Sprint 3257

      Story (Required)

      As an admin of Argo CD, I would like to define a allowlist of labels to added onto the k8s events generated by Argo CD to group them later for logging and monitoring purposes.

      Background (Required)

      Argo CD logs a bunch of k8s events for Argo CD resources/operations creation, updation, deletion etc. These events are particularly helpful in understanding cluster state and changes made to it. However, differentiating between these events is a challenging task without having a proper way to filter them easily. Adding labels on the events could help in grouping them better for analyses by admin or third-party logging/monitoring solutions.

      Approach (Required)

      The labels allowlist could be defined by 2 means i.e adding "--event-labels" cli flags for app-controllers & argocd-server or by introduce a new key “resource.eventLabelKeys'' in argocd-cm configmap. Configmap approach makes more sense to me as we could eliminate the need of updating flag configurations in 2 places i.e app-controller and argocd-server. 

      For any events generated for Applications containing the specified labels, the controller should add the matched label onto the event thus establishing an easy link between the event and the application to filter out using labels.

      The specified labels should be matched against the Application and AppProject labels to add them onto the event. In case of conflict between labels on Application and AppProject, the Application label values should be prioritized and added to the event.

      Eg: Application has a label “team: foo” and AppProject has “team: foo-bar”, in this case the event should have a label with Application value i.e “team: foo”.

      Acceptance Criteria (Mandatory)

      Test

      1. Deploy Argo CD
      2. Configure specific event labels using “resource.eventLabelKeys” in argocd-cm configmap
      3. Create a Argo CD Application with specific labels
      4. Use kubectl label selector to list all events with specific label

      INVEST Checklist

      Dependencies identified

      Blockers noted and expected delivery timelines set

      Design is implementable

      Acceptance criteria agreed upon

      Story estimated

      Legend

      Unknown

      Verified

      Unsatisfied

      Done Checklist

      • Code is completed, reviewed, documented and checked in
      • Unit and integration test automation have been delivered and running cleanly in continuous integration/staging/canary environment
      • Continuous Delivery pipeline(s) is able to proceed with new code included
      • Customer facing documentation, API docs etc. are produced/updated, reviewed and published
      • Acceptance criteria are met

              rh-ee-sghadi Siddhesh Ghadi
              rh-ee-sghadi Siddhesh Ghadi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: