Commit d2e90a4c authored by Azhar Hassan's avatar Azhar Hassan

Argocd training course app definitions

parent 4e19b2b4
File added
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: kustomize-app
namespace: argocd
spec:
destination:
namespace: kustomize-app
server: "https://kubernetes.default.svc"
project: default
source:
path: kustomize-guestbook
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
kustomize:
namePrefix: staging-
commonLabels:
app: demo
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: auto-sync-app
namespace: argocd
spec:
destination:
namespace: auto-sync-app
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook-with-sub-directories
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: auto-pruning-demo
namespace: argocd
spec:
destination:
namespace: auto-pruning-demo
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook-with-sub-directories
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
directory:
recurse: true
syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true
#for this demo try to delete some resources from git repo like service and see there
#if the changes are reflecting there or not
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: auto-selfheal-demo
namespace: argocd
spec:
destination:
namespace: auto-selfheal-demo
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook-with-sub-directories
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
directory:
recurse: true
syncPolicy:
automated:
selfHeal: true
syncOptions:
- CreateNamespace=true
#you can manually change the replicas using kubectl then will see that its not reflecting because
#argocd healing it back to the replicas which is defined in the git repo
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook-staging
namespace: argocd
spec:
destination:
namespace: guestbook-staging
server: "https://c50189b1-bb18-4a46-b772-b045e0ed4fde.k8s.ondigitalocean.com"
project: default
source:
path: guestbook
repoURL: "https://github.com/mabusaa/argocd-example-apps.git"
targetRevision: master
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: helm-app
namespace: argocd
spec:
destination:
namespace: helm-app
server: "https://kubernetes.default.svc"
project: default
source:
path: helm-guestbook
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
# helm:
# releaseName: my-release
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: directory-app
namespace: argocd
spec:
destination:
namespace: directory-app
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook-with-sub-directories
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
directory:
recurse: true # make it true or false for release
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook-demo-project
namespace: argocd
spec:
destination:
namespace: guestbook-demo-project
server: "https://kubernetes.default.svc"
project: demo-project
source:
path: guestbook
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook-dev-project
namespace: argocd
spec:
destination:
namespace: ns-1 # change this to anyting
server: "https://kubernetes.default.svc"
project: dev-project
source:
path: guestbook
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook-with-cred-template
namespace: argocd
spec:
destination:
namespace: guestbook-1
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook
repoURL: "https://github.com/ahassan613/argocd-example-apps-private.git"
targetRevision: main
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook-ssh
namespace: argocd
spec:
destination:
namespace: guestbook-ssh
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook
repoURL: "git@github.com:ahassan613/argocd-example-apps-private.git"
targetRevision: main
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: v1
kind: Secret
metadata:
namespace: argocd
name: local-cluster
labels:
argocd.argoproj.io/secret-type: cluster
environment: "dev"
provider: "local"
non-prod: "true"
type: Opaque
stringData:
name: local-cluster
server: https://kubernetes.default.svc
config: |
{
"tlsClientConfig": {
"insecure": false
}
}
apiVersion: v1
kind: Secret
metadata:
namespace: argocd
name: staging-digitalocean-ams3-1
labels:
argocd.argoproj.io/secret-type: cluster
environment: "staging"
provider: "digitalocean"
type: Opaque
stringData:
name: staging-digitalocean-ams3-1
server: https://c50189b1-bb18-4a46-b772-b045e0ed4fde.k8s.ondigitalocean.com
config: |
{
"bearerToken": "###", # dont push secrets into git NOTE: use sealed secrets as a solution for secrets in gitops.
"tlsClientConfig": {
"insecure": false,
"caData": "###"
}
}
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: project-with-role
namespace: argocd
spec:
description: project-with-role description
sourceRepos:
- '*'
destinations:
- namespace: '*'
server: '*'
clusterResourceWhitelist:
- group: '*'
kind: '*'
namespaceResourceWhitelist:
- group: '*'
kind: '*'
roles:
- name: ci-role
description: Sync privileges for project-with-role
policies:
- p, proj:project-with-role:ci-role, applications, sync, project-with-role/*, allow
\ No newline at end of file
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: demo-project
namespace: argocd
spec:
description: Demo Project
sourceRepos:
- '*'
destinations:
- namespace: '*'
server: '*'
clusterResourceWhitelist:
- group: '*'
kind: '*'
namespaceResourceWhitelist:
- group: '*'
kind: '*'
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: dev-project
namespace: argocd
spec:
description: Dev Project
sourceRepos:
- '*'
destinations:
- namespace: ns-1
server: https://kubernetes.default.svc
clusterResourceWhitelist:
- group: '*'
kind: '*'
namespaceResourceWhitelist:
- group: '*'
kind: '*'
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: demo-shared-resources
namespace: argocd
spec:
destination:
namespace: guestbook-demo-project
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
- FailOnSharedResource=true # remove and add this for demo
#applicationn5 and this are in same namespacespace so it will be failing
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: no-prune-resources
namespace: argocd
spec:
destination:
namespace: no-prune-resources
server: "https://kubernetes.default.svc"
project: default
source:
path: sync-options/no-prune
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: replace-resources
namespace: argocd
spec:
destination:
namespace: replace-resources
server: "https://kubernetes.default.svc"
project: default
source:
path: sync-options/replace
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
- Replace=true
#first you can add at resource level and then try to add here at application level
#resource will recreate and there will be no history of last changes in annotations
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: selective-sync
namespace: argocd
spec:
destination:
namespace: selective-sync
server: "https://kubernetes.default.svc"
project: default
source:
path: sync-options/selective-sync
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: sync-waves
namespace: argocd
spec:
destination:
namespace: sync-waves
server: "https://kubernetes.default.svc"
project: default
source:
path: sync-waves
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: sync-phases
namespace: argocd
spec:
destination:
namespace: sync-phases
server: "https://kubernetes.default.svc"
project: default
source:
path: sync-phases
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: main
syncPolicy:
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: track-commit
namespace: argocd
spec:
destination:
namespace: track-commit
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: dc61e33 #full commit id : dc61e3345348ce961c81177104903d7862690d1d
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: track-head
namespace: argocd
spec:
destination:
namespace: track-head
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: HEAD
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: track-git-tag
namespace: argocd
spec:
destination:
namespace: track-git-tag
server: "https://kubernetes.default.svc"
project: default
source:
path: guestbook
repoURL: "https://github.com/wriaz/argocd-example-apps.git"
targetRevision: v1.0.0
directory:
recurse: true
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: track-helm-latest-version
namespace: argocd
spec:
destination:
namespace: track-helm-latest-version
server: "https://kubernetes.default.svc"
project: default
source:
chart: ingress-nginx
repoURL: "https://kubernetes.github.io/ingress-nginx"
targetRevision: '*'
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: track-helm-range
namespace: argocd
spec:
destination:
namespace: track-helm-range
server: "https://kubernetes.default.svc"
project: default
source:
chart: sealed-secrets
repoURL: "https://charts.bitnami.com/bitnami"
targetRevision: 1.* # you can use greater than and smaller than ex: >=3.0.0 <4.1.0 or 1.16.1 or 1.*
syncPolicy:
automated: {}
syncOptions:
- CreateNamespace=true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment