Enough users want to create preview apps that we should document this.
A preview app is a version of an app that has things tweaked, and are typically ephemeral. For example:
Approaches currently in play:
app patch and app patch-resource.We should document current approaches.
See also #1157, #1481.
Current approach (using argocd commands) is a good approach. But I would like to have a more declarative approach. Such as Using Application CRD as Application Template.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: branch-apps
annotations:
argoproj.io/argocd/branches/*: Disallow // disallow to make apps
argoproj.io/argocd/branches/test: SyncPolicy=auto // default sync policy is manual?
argoproj.io/argocd/branches/staging: SyncPolicy=manual
spec:
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git
targetRevision: ${branch}
path: guestbook
destination:
server: https://kubernetes.default.svc
namespace: guestbook-${branch}
opertation:
patches:
- '[{"op": "replace", "path": "/spec/destination/namespace", "value": "gurstbook-${branch}"}]'
This Application CRD makes other Application CRD with branches. This branch-apps makes applications with current branches. If a branch is deleted, this application deletes a app related to the branch when this application is syncing. But I'm not sure this approach is more declarative or better than working with CI pipelines. Just small idea.^^;
This is much needed. I've been reading and testing out argocd for a few days now. If I give write access to config repo to CI, then it's more of the same like CIOps.
Still can't figure out a nice way to have this.
Hi @alexec, why did you close this? Supporting this feature _without_ relying on CI to do the heavy lifting of templating the preview apps seems like an important feature in support of the GitOps ideal. Is there other ongoing work related to this?
Hi @jshearer
We've decided to eschew this feature.
What we've found is that preview copies of an app are not a straight-forward deployment of the same Git repo into different clusters (see https://github.com/argoproj/argo-cd/issues/1673). Each app needs different configuration, e.g. ALB, ingress, limits, etc etc etc, and therefore customers tend to create version of the app customised onto their specific requirements.
We actually went as far as create a PoC for this before making a decision on this.
What we've not done, and ought to, is document how people currently do preview apps.
Have you asked in the Slack channel please?
Alex
The documentation about "how to do preview apps with argo" would be really very much appreciated. Thanks!
Most helpful comment
Current approach (using argocd commands) is a good approach. But I would like to have a more declarative approach. Such as Using Application CRD as Application Template.
This Application CRD makes other Application CRD with branches. This
branch-appsmakes applications with current branches. If a branch is deleted, this application deletes a app related to the branch when this application is syncing. But I'm not sure this approach is more declarative or better than working with CI pipelines. Just small idea.^^;