Skip to content

Commit 15947d7

Browse files
3 apps in a single project
1 parent f017b72 commit 15947d7

File tree

6 files changed

+100
-2
lines changed

6 files changed

+100
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
source:
1616
repoURL: https://github.com/codefresh-contrib/gitops-certification-examples.git
1717
targetRevision: HEAD
18-
path: ./simple-app
18+
path: ./declarative/manifests
1919

2020
# Destination cluster and namespace to deploy the application
2121
destination:
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: demo-app2
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: ./declarative/manifests
19+
20+
# Destination cluster and namespace to deploy the application
21+
destination:
22+
server: https://kubernetes.default.svc
23+
namespace: demo2
24+
25+
# Sync policy
26+
syncPolicy:
27+
syncOptions:
28+
- CreateNamespace=true
29+
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.
30+
prune: true # Specifies if resources should be pruned during auto-syncing ( false by default ).
31+
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 ).
32+
allowEmpty: false # Allows deleting all application resources during automatic syncing ( false by default ).
33+
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: demo-app3
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: ./declarative/manifests
19+
20+
# Destination cluster and namespace to deploy the application
21+
destination:
22+
server: https://kubernetes.default.svc
23+
namespace: demo3
24+
25+
# Sync policy
26+
syncPolicy:
27+
syncOptions:
28+
- CreateNamespace=true
29+
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.
30+
prune: true # Specifies if resources should be pruned during auto-syncing ( false by default ).
31+
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 ).
32+
allowEmpty: false # Allows deleting all application resources during automatic syncing ( false by default ).
33+

declarative/manifests/deployment.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: simple-deployment
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: trivial-go-web-app
11+
template:
12+
metadata:
13+
labels:
14+
app: trivial-go-web-app
15+
spec:
16+
containers:
17+
- name: webserver-simple
18+
image: docker.io/kostiscodefresh/gitops-simple-app:v1.0
19+
ports:
20+
- containerPort: 8080

declarative/manifests/service.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: simple-service
5+
spec:
6+
type: ClusterIP
7+
selector:
8+
app: trivial-go-web-app
9+
ports:
10+
- protocol: TCP
11+
port: 80
12+
targetPort: 8080

declarative/single-app/my-application.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
source:
1616
repoURL: https://github.com/codefresh-contrib/gitops-certification-examples.git
1717
targetRevision: HEAD
18-
path: ./simple-app
18+
path: ./declarative/manifests
1919

2020
# directory
2121
directory:

0 commit comments

Comments
 (0)