Skip to content

Commit

Permalink
Implement app of apps pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Walter committed Jul 28, 2024
1 parent 6a6333a commit eb68b54
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: prod
name: app1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: prod
namespace: app2
spec:
replicas: 1
selector:
Expand Down
4 changes: 4 additions & 0 deletions environments/staging/app-2/0-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: app2
24 changes: 24 additions & 0 deletions environments/staging/app-2/1-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: app1
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: tf333/nginx:v0.1.2
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 80
25 changes: 25 additions & 0 deletions environments/staging/argo-apps/app1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app1
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: 'https://github.com/MeranaTona/argocd-tutorial-app.git'
targetRevision: HEAD
path: environments/staging/app1
destination:
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- Validate=true
- CreateNamespace=false
- PrunePropagationPolicy=foreground
- PruneLast=true
25 changes: 25 additions & 0 deletions environments/staging/argo-apps/app2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app2
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: 'https://github.com/MeranaTona/argocd-tutorial-app.git'
targetRevision: HEAD
path: environments/staging/app2
destination:
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- Validate=true
- CreateNamespace=false
- PrunePropagationPolicy=foreground
- PruneLast=true

0 comments on commit eb68b54

Please sign in to comment.