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

How to create ArgoCD extensions #3359

Open
Tracked by #3356
mowies opened this issue Mar 27, 2024 · 1 comment
Open
Tracked by #3356

How to create ArgoCD extensions #3359

mowies opened this issue Mar 27, 2024 · 1 comment

Comments

@mowies
Copy link
Member

mowies commented Mar 27, 2024

Goal

The overall goal is to put the monitoring/o11y parts of Keptn into an ArgoCD extension so that it can easily be used with ArgoCD.

Details

Research how to create an extension and create a PoC as the result.

Use cases:

  • Argo CD: observability of deployments, UI extensions that show graphs for KeptnMetrics
  • Argo Rollouts: integrate Keptn analyses into Argo experiments
  • Argo Workflows: provide observability

DoD

  • PoC implemented
  • strategy/plan on how to integrate keptn using an extension created

Notes

@mowies mowies changed the title Research how to create argo extensions (entry point https://github.com/argoproj-labs/argocd-extensions) How to create argo extensions Mar 27, 2024
@mowies mowies added status: ready-for-refinement Issue is relevant for the next backlog refinment research and removed status: ready-for-refinement Issue is relevant for the next backlog refinment labels Mar 27, 2024
@odubajDT odubajDT self-assigned this Apr 3, 2024
@odubajDT
Copy link
Contributor

odubajDT commented Apr 9, 2024

Research findings

It is possible to introduce Keptn as Argo extension. In fact, using Keptn as Argo extension means installing it to the same cluster as Argo is installed in and enabled and configure the Argo Proxy Extensions. In this case Keptn can act as backend for features implemented as Argo UI extensions (description how to implement them available here).

With UI extensions it is possible to enhance Argo CD web interface to provide data to the user. However the data is restricted to the resources that belongs to the Application. With proxy extensions it is also possible to add additional functionality that have access to data provided by backend services. In this case Argo CD API server acts as a reverse-proxy authenticating and authorizing incoming requests before forwarding to the backend service.

A nice example of an extension (with UI extension and backend filling it) is available here.

Steps to deploy Keptn as Argo extension (backend part)

As already mentioned, Keptn as an extension of Argo will live in the same cluster as Argo and therefore also deployed independently

  1. Install Keptn according to the installation docs

  2. Enable Keptn extension in Argo CD Proxy extensions (all information here) by editing the argocd-cmd-params-cm ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cmd-params-cm
  namespace: argocd
data:
  server.enable.proxy.extension: "true"
  1. The Keptn extension needs to be authorized in Argo CD API server. To enable it for all users add the following entry in argocd-rbac-cm ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-rbac-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-rbac-cm
data:
  policy.csv: |-
    p, role:admin, extensions, invoke, keptn, allow
  1. After the extension is enabled and has the proper permissions, it need to be configured in the main Argo CD configmap (argocd-cm)
apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cm
  namespace: argocd
data:
  extension.config: |
    extensions:
    - name: keptn
      backend:
        services:
        - url: <keptn-metrics-url>

After this configuration, the Keptn endpoint (the url configured in the argocd-cm ConfigMap) is exposed as a service under the following url:

<argocd-host>/extensions/keptn

This URL can be afterwards used in the UI extension as a backend service.

Final thoughts

This research defines mostly how the Keptn extension of Argo can be implemented. What should be implemented is part of team discussions.

@odubajDT odubajDT changed the title How to create argo extensions How to create ArgoCD extensions Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🎟️ Refined
Development

No branches or pull requests

2 participants