Skip to content

Commit d508bae

Browse files
With project
1 parent 85d3c54 commit d508bae

File tree

2 files changed

+44
-45
lines changed

2 files changed

+44
-45
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: demo-app1
5+
# You'll usually want to add your resources to the argocd namespace.
6+
namespace: argocd
7+
# Add a this finalizer ONLY if you want these to cascade delete.
8+
finalizers:
9+
- resources-finalizer.argocd.argoproj.io
10+
spec:
11+
# The project the application belongs to.
12+
project: my-project
13+
14+
# Source of the application manifests
15+
source:
16+
repoURL: https://github.com/codefresh-contrib/gitops-certification-examples.git
17+
targetRevision: HEAD
18+
path: ./simple-app
19+
20+
# directory
21+
directory:
22+
recurse: false
23+
# Destination cluster and namespace to deploy the application
24+
destination:
25+
server: https://kubernetes.default.svc
26+
namespace: demo1
27+
28+
# Sync policy
29+
syncPolicy:
30+
syncOptions:
31+
- CreateNamespace=true
32+
automated: # automated sync by default retries failed attempts 5 times with following delays between attempts ( 5s, 10s, 20s, 40s, 80s ); retry controlled using `retry` field.
33+
prune: true # Specifies if resources should be pruned during auto-syncing ( false by default ).
34+
selfHeal: true # Specifies if partial app sync should be executed when resources are changed only in target Kubernetes cluster and no git change detected ( false by default ).
35+
allowEmpty: false # Allows deleting all application resources during automatic syncing ( false by default ).
36+

declarative/apps-and-project/my-demo-project.yml

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,59 +8,22 @@ metadata:
88
- resources-finalizer.argocd.argoproj.io
99
spec:
1010
# Project description
11-
description: Example Project
11+
description: My Demo project
1212

1313
# Allow manifests to deploy from any Git repos
1414
sourceRepos:
1515
- '*'
1616

1717
# Only permit applications to deploy to the guestbook namespace in the same cluster
1818
destinations:
19-
- namespace: guestbook
19+
- namespace: demo1
20+
server: https://kubernetes.default.svc
21+
- namespace: demo2
22+
server: https://kubernetes.default.svc
23+
- namespace: demo3
2024
server: https://kubernetes.default.svc
21-
2225
# Deny all cluster-scoped resources from being created, except for Namespace
2326
clusterResourceWhitelist:
24-
- group: ''
25-
kind: Namespace
26-
27-
# Allow all namespaced-scoped resources to be created, except for ResourceQuota, LimitRange, NetworkPolicy
28-
namespaceResourceBlacklist:
29-
- group: ''
30-
kind: ResourceQuota
31-
- group: ''
32-
kind: LimitRange
33-
- group: ''
34-
kind: NetworkPolicy
35-
36-
# Deny all namespaced-scoped resources from being created, except for Deployment and StatefulSet
37-
namespaceResourceWhitelist:
38-
- group: 'apps'
39-
kind: Deployment
40-
- group: 'apps'
41-
kind: StatefulSet
42-
43-
# Enables namespace orphaned resource monitoring.
44-
orphanedResources:
45-
warn: false
46-
47-
roles:
48-
# A role which provides read-only access to all applications in the project
49-
- name: read-only
50-
description: Read-only privileges to my-project
51-
policies:
52-
- p, proj:my-project:read-only, applications, get, my-project/*, allow
53-
groups:
54-
- my-oidc-group
55-
56-
# A role which provides sync privileges to only the guestbook-dev application, e.g. to provide
57-
# sync privileges to a CI system
58-
- name: ci-role
59-
description: Sync privileges for guestbook-dev
60-
policies:
61-
- p, proj:my-project:ci-role, applications, sync, my-project/guestbook-dev, allow
27+
- group: '*'
28+
kind: '*'
6229

63-
# NOTE: JWT tokens can only be generated by the API server and the token is not persisted
64-
# anywhere by Argo CD. It can be prematurely revoked by removing the entry from this list.
65-
jwtTokens:
66-
- iat: 1535390316

0 commit comments

Comments
 (0)