add multi envs app

This commit is contained in:
dvirlabs 2025-07-27 19:10:51 +03:00
parent bc0e97dfbe
commit 5de0f3e738
13 changed files with 85 additions and 14 deletions

View File

@ -1,29 +1,29 @@
# file: applicationsets/envs-appset.yaml in app-definition.git (optional location)
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet kind: ApplicationSet
metadata: metadata:
name: net-envs-appset name: envs-appset
namespace: argocd namespace: argocd
spec: spec:
generators: generators:
- git: - git:
repoURL: https://git.dvirlabs.com/app-definition.git repoURL: https://git.dvirlabs.com/dvirlabs/app-definition.git
revision: HEAD revision: HEAD
files: files:
- path: net-envs/*/metadata.yaml - path: env-sets/*/metadata.yaml
extract: extract:
env: '{{.env}}' env: '{{.env}}'
project: '{{.project}}'
namespace: '{{.namespace}}' namespace: '{{.namespace}}'
project: '{{.project}}'
template: template:
metadata: metadata:
name: net-env-{{env}} name: env-{{env}}
spec: spec:
project: '{{project}}' project: '{{project}}'
source: source:
repoURL: https://git.dvirlabs.com/app-definition.git repoURL: https://git.dvirlabs.com/dvirlabs/app-definition.git
path: env-sets targetRevision: HEAD
directory: path: env-sets/{{env}}
recurse: true
destination: destination:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
namespace: '{{namespace}}' namespace: '{{namespace}}'

View File

@ -1,15 +1,15 @@
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet kind: ApplicationSet
metadata: metadata:
name: dev-ms-apps name: dev-microservices
namespace: argocd namespace: argocd
spec: spec:
generators: generators:
- git: - git:
repoURL: https://github.com/your-org/apps-config.git repoURL: https://git.dvirlabs.com/dvirlabs/app-definition.git
revision: HEAD revision: HEAD
files: files:
- path: net-envs/dev/*.yaml - path: env-sets/dev/services/*.yaml
template: template:
metadata: metadata:
name: dev-{{basenameNormalized}} name: dev-{{basenameNormalized}}
@ -18,10 +18,10 @@ spec:
source: source:
repoURL: https://git.dvirlabs.com/dvirlabs/app-provision.git repoURL: https://git.dvirlabs.com/dvirlabs/app-provision.git
targetRevision: HEAD targetRevision: HEAD
chart: charts/nginx-message chart: ngnix-message
helm: helm:
valueFiles: valueFiles:
- env-sets/dev/values.yaml - env-sets/dev/services/{{path.basename}}
destination: destination:
server: https://kubernetes.default.svc server: https://kubernetes.default.svc
namespace: dev namespace: dev

View File

@ -0,0 +1,3 @@
env: dev
namespace: dev
project: sandbox

View File

View File

View File

@ -0,0 +1,31 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: int-microservices
namespace: argocd
spec:
generators:
- git:
repoURL: https://git.dvirlabs.com/dvirlabs/app-definition.git
revision: HEAD
files:
- path: env-sets/int/services/*.yaml
template:
metadata:
name: int-{{basenameNormalized}}
spec:
project: default
source:
repoURL: https://git.dvirlabs.com/dvirlabs/app-provision.git
targetRevision: HEAD
chart: ngnix-message
helm:
valueFiles:
- env-sets/int/services/{{path.basename}}
destination:
server: https://kubernetes.default.svc
namespace: int
syncPolicy:
automated:
selfHeal: true
prune: true

View File

@ -0,0 +1,3 @@
env: int
namespace: int
project: sandbox

View File

View File

View File

@ -0,0 +1,31 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: prod-microservices
namespace: argocd
spec:
generators:
- git:
repoURL: https://git.dvirlabs.com/dvirlabs/app-definition.git
revision: HEAD
files:
- path: env-sets/prod/services/*.yaml
template:
metadata:
name: prod-{{basenameNormalized}}
spec:
project: default
source:
repoURL: https://git.dvirlabs.com/dvirlabs/app-provision.git
targetRevision: HEAD
chart: ngnix-message
helm:
valueFiles:
- env-sets/prod/services/{{path.basename}}
destination:
server: https://kubernetes.default.svc
namespace: prod
syncPolicy:
automated:
selfHeal: true
prune: true

View File

@ -0,0 +1,3 @@
env: prod
namespace: prod
project: sandbox

View File

View File