add tls sync

This commit is contained in:
2026-01-21 00:33:03 +01:00
parent b3e344a1e2
commit 52832863f7
15 changed files with 631 additions and 212 deletions

View File

@@ -1,49 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: tls-secrets-sync
namespace: argocd-ops
spec:
generators:
# Génère une application pour chaque secret TLS à synchroniser
# depuis OPS vers les clusters DEV, RCT, PRD
- list:
elements:
# Homarr DEV : synchroniser depuis OPS vers DEV
- app: homarr
env: dev
secretName: homarr-dev-tls
sourceNamespace: certificates-ops
sourceCluster: cluster-ops
targetNamespace: homarr-dev
targetCluster: cluster-dev
template:
metadata:
name: 'tls-secret-sync-{{app}}-{{env}}'
spec:
project: default
source:
repoURL: https://git.gkdomaine.fr/kubernetes/argocd.git
targetRevision: main
path: helm/tls-secrets-sync/ops
helm:
valueFiles:
- values.yaml
values: |
app: {{app}}
env: {{env}}
secretName: {{secretName}}
sourceNamespace: {{sourceNamespace}}
sourceCluster: {{sourceCluster}}
targetNamespace: {{targetNamespace}}
targetCluster: {{targetCluster}}
destination:
# Les Jobs de synchronisation s'exécutent dans OPS
name: '{{sourceCluster}}'
namespace: '{{sourceNamespace}}'
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View File

@@ -0,0 +1,44 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: tls-sync
namespace: argocd-ops
spec:
generators:
# Le CronJob de synchronisation TLS est déployé UNIQUEMENT sur le cluster OPS
- merge:
generators:
# Premier générateur : scanne les répertoires Helm pour tls-sync
- git:
repoURL: https://git.gkdomaine.fr/kubernetes/argocd.git
revision: main
directories:
- path: "helm/tls-sync/*"
# Deuxième générateur : lit la config OPS uniquement
- git:
repoURL: https://git.gkdomaine.fr/kubernetes/argocd.git
revision: main
files:
- path: "configs/ops/config.json"
mergeKeys:
- path.basename
template:
metadata:
name: 'tls-sync-{{path.basename}}'
spec:
project: default
source:
repoURL: '{{repository}}'
targetRevision: '{{targetRevision}}'
path: '{{helmPath}}/tls-sync/{{path.basename}}'
destination:
# Déploie uniquement sur le cluster OPS
name: '{{name}}'
namespace: certificates-{{path.basename}}
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true