Description
Suggestion
I would like to suggest to enhance the code of the client to support to initialize a project using an argocd-promise
. As one of the building block of the architecture of Kratix is Argocd
orr Flux
as technology able to fetch resources and to sync them on the destination server, I think that it could be very valuable for people using argocd to leverage their Applications CR and to generate too for kratix such resources as an Application is finally a way to deploy a Helm chart, kustomized resources, etc
We could ask to the user to provide their flavor: helm, kustomize, static yaml resources; url of th 59BA e repository, revision, path of the chart/resources and the values could be (as this is the case for helm) extracted from the helm values file to an openApiv3schema.
Remark: To avoid to have to deal with too much cases, I propose that we only support the kustomize's component - https://argo-cd.readthedocs.io/en/stable/user-guide/kustomize/#components. To be discussed of course
Command:
kratix init argocd-promise hello-quarkus --url "https://<helm-repository>/path --path --group <group> --kind <application>
Remarks:
- default value of the git revision is: "main"
- default value for the path is "."
Result:
// Generated YAML
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: <name-of-the-application-fromAPI>
namespace: "By default this value should be equal to the argocd control plane namespace !"
spec:
destination:
namespace: <kratix-destination-namespace>
server: <kratix-destination-kube-server>
project: "By default we will use the default Argocd AppProject having full permissions"
source:
helm:
valueFiles:
- values.yaml - "That should be processed according to the pipeline using the from input.yaml converted to the values.yaml"
path: <path-flag_or_default-to-dot>
repoURL: <url-flag>
targetRevision: <revision-flag_or_default-to-main>
syncPolicy:
automated:
prune: true
selfHeal: true
retry:
backoff:
duration: 5s
factor: 2
maxDuration: 10m
syncOptions:
- CreateNamespace=true
- RespectIgnoreDifferences=true
- ApplyOutOfSyncOnly=true