-
Story
-
Resolution: Done
-
Major
-
None
-
None
Story (Required)
See parent epic for detials.
Background/Approach (Required)
Even though the Argo Rollout UI extension is written in TypeScript, this item shouldn't require any TypeScript knowledge. This item is mainly about modifying the build to include the Rollouts extension, and modifying argocd-operator to add a new init container to server Deployment, to enable the plugin.
A) Determine how to build the rollout-extension into OpenShift GitOps
There are two pieces that we need to get into an official CPaaS-based OpenShift GitOps build.
Some TypeScript: https://github.com/argoproj-labs/rollout-extension
Shell script which installs: And the shell script which installs the rollout-extension into the Argo CD server container, via an init container: https://github.com/argoproj-labs/argocd-extension-installer/blob/main/install.sh
My assumption is that we would need to make changes to CPaaS build for this: https://gitlab.cee.redhat.com/gitops-cpaas-midstream/gitops-midstream-repos/-/tree/gitops-nightly-1-rhel-8/distgit/containers?ref_type=heads
B) Once OpenShift GitOps images contain the Argo Rollouts extension, we can add a new field to the ArgoCD CRD to enable Rollout UI plugin.
Open question: rather than adding a new field, do we instead want to ALWAYS install the rollouts UI plugin into Argo CD, whether or not the UI specifically requests it?
- For example, how heavy is the plugin? Is it likely for it to break Argo CD UI?
kind: ArgoCD
spec:
server:
rolloutsUIEnabled: true
I've solicited Gerald's opinion on this: https://issues.redhat.com/browse/GITOPS-3604
C) Make modifications to argocd-operator to read the above field, and modify the Argo CD server Deployment to add the init container:
REMEMBER: this feature needs to work in two difference scenarios: 1) user running argocd-operator, and 2) user running openshift gitops.
Thus, when the controller is running upstream as part of argocd-operator, it should use this container image:
initContainers: - name: rollout-extension image: quay.io/argoprojlabs/argocd-extension-installer:v0.0.1
However, when it is running as part of OpenShift GitOps, it should use:
initContainers: - name: rollout-extension image: (standard openshift gitops argo cd image)
Why? We can't reference images from quay.io in OpenShift GitOps. All images that are used by OpenShift GitOps (or any OpenShift product) must be built via CPaaS and hosted on registry.redhat.com
D) How to test this feature?
Acceptance Criteria
- Initially, try this all out, and make sure it works
- Prototype a change to argocd-operator, and verify that it's straightforward to add the argo rollouts UI init container to argo cd server, and that it works
- Determine how we can allow this to work for both argocd-operator (which will read Argo Rollouts UI extension from github) and OpenShift GitOps (which will read Argo Rollouts UI extension from a registry.redhat.io container image)
- Determine how best to test this functionality as part of E2E test
- For example, if we accidentally break the plugin integration, how would we detect that as part of an E2E test?
- Open story/stories, filling in some detail on how the above will work, with required details.
Additional Resources
The 'argocd-extension-installer' is basically a very simple wrapper for a simple shell script: https://github.com/argoproj-labs/argocd-extension-installer/blob/main/install.sh
Argo Rollout UI extension
The Argo Rollout UI extension is defined within this repository
https://github.com/argoproj-labs/rollout-extension
A small amount TypeScript (<300 lines): https://github.com/argoproj-labs/rollout-extension
Argo CD extension are installed using an init container, which downloads and copies Argo Rollout UI extension into the Argo CD server UI:
The install instructions in described in README.md of https://github.com/argoproj-labs/rollout-extension are out of date.
Instead, see this PR, which attempts to update them: https://github.com/argoproj-labs/rollout-extension/pull/72
- Here is another example of how this works: https://github.com/argoproj-labs/argocd-extension-metrics?tab=readme-ov-file#install-ui-extension
Ultimately, the argocd-server container will contain a new initContainer section that looks like this.
apiVersion: apps/v1 kind: Deployment metadata: name: argocd-server spec: template: spec: initContainers: - name: rollout-extension image: quay.io/argoprojlabs/argocd-extension-installer:v0.0.1 env: - name: EXTENSION_URL value: https://github.com/argoproj-labs/rollout-extension/releases/download/v0.3.4/extension.tar volumeMounts: - name: extensions mountPath: /tmp/extensions/ securityContext: runAsUser: 1000 allowPrivilegeEscalation: false containers: - name: argocd-server volumeMounts: - name: extensions mountPath: /tmp/extensions/ volumes: - name: extensions emptyDir: {}