gitops
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: argocd
|
||||
labels:
|
||||
app.kubernetes.io/name: argocd
|
||||
@@ -0,0 +1,37 @@
|
||||
# =====================================================================
|
||||
# AppProject con perimetro ristretto a namespace-A, namespace-B,
|
||||
# namespace-C. Qualunque Application che referenzi questo project e
|
||||
# provi a scrivere in un namespace diverso da questi (+ argocd, per le
|
||||
# risorse interne) viene rifiutata da Argo CD stesso.
|
||||
# =====================================================================
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: AppProject
|
||||
metadata:
|
||||
name: gitops-3ns
|
||||
namespace: argocd
|
||||
spec:
|
||||
description: "GitOps limitato a namespace-A, namespace-B, namespace-C"
|
||||
|
||||
sourceRepos:
|
||||
- "https://github.com/<tua-org>/gitops-repo.git"
|
||||
|
||||
destinations:
|
||||
- namespace: argocd
|
||||
server: "https://kubernetes.default.svc"
|
||||
- namespace: namespace-A
|
||||
server: "https://kubernetes.default.svc"
|
||||
- namespace: namespace-B
|
||||
server: "https://kubernetes.default.svc"
|
||||
- namespace: namespace-C
|
||||
server: "https://kubernetes.default.svc"
|
||||
|
||||
clusterResourceWhitelist:
|
||||
- group: ""
|
||||
kind: Namespace
|
||||
|
||||
namespaceResourceWhitelist:
|
||||
- group: "*"
|
||||
kind: "*"
|
||||
|
||||
orphanedResources:
|
||||
warn: true
|
||||
@@ -0,0 +1,40 @@
|
||||
# =====================================================================
|
||||
# Root "app of apps": punta a gitops/clusters/idc/ nel repo. Grazie a
|
||||
# directory.recurse=true, scopre automaticamente ogni application.yaml
|
||||
# trovato dentro namespace-A/, namespace-B/, namespace-C/ e li applica
|
||||
# come proprie Application figlie.
|
||||
# =====================================================================
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: root-3ns
|
||||
namespace: argocd
|
||||
finalizers:
|
||||
- resources-finalizer.argocd.argoproj.io
|
||||
spec:
|
||||
project: gitops-3ns
|
||||
|
||||
source:
|
||||
repoURL: "https://github.com/<tua-org>/gitops-repo.git"
|
||||
targetRevision: main
|
||||
path: gitops/clusters/idc
|
||||
directory:
|
||||
recurse: true
|
||||
|
||||
destination:
|
||||
server: "https://kubernetes.default.svc"
|
||||
namespace: argocd
|
||||
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
- ServerSideApply=true
|
||||
retry:
|
||||
limit: 5
|
||||
backoff:
|
||||
duration: 10s
|
||||
factor: 2
|
||||
maxDuration: 3m
|
||||
Reference in New Issue
Block a user