feat(infra): Use a single ApplicationSet instead of multiple Application manifests for infrastructure applications

This commit is contained in:
Vegard Hagen
2023-07-07 22:59:19 +02:00
parent f1eeac2592
commit ad74c53fdf
16 changed files with 52 additions and 214 deletions
-33
View File
@@ -1,35 +1,2 @@
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
.terraform.lock.hcl
.idea
certs/
charts/example
+36
View File
@@ -0,0 +1,36 @@
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: infrastructure
namespace: argocd
labels:
dev.stonegarden: infrastructure
spec:
generators:
- git:
repoURL: https://github.com/vehagn/homelab
revision: HEAD
directories:
- path: infra/*
template:
metadata:
name: '{{ path.basename }}'
labels:
dev.stonegarden: infrastructure
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
plugin:
name: kustomize-build-with-helm
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
path: '{{ path }}'
destination:
name: in-cluster
namespace: argocd
syncPolicy:
automated:
selfHeal: true
prune: true
-22
View File
@@ -1,22 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argocd
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
path: infra/argocd
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
destination:
namespace: argocd
name: in-cluster
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true
-22
View File
@@ -1,22 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cert-manager
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
path: infra/cert-manager
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
destination:
name: in-cluster
namespace: cert-manager
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true
-22
View File
@@ -1,22 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cilium
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
plugin:
name: kustomize-build-with-helm
path: infra/cilium
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
destination:
namespace: kube-system
name: in-cluster
syncPolicy:
automated:
selfHeal: true
prune: true
-22
View File
@@ -1,22 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: dashboard
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
path: infra/dashboard
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
destination:
namespace: kubernetes-dashboard
name: in-cluster
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true
+1
View File
@@ -3,6 +3,7 @@ kind: Kustomization
namespace: kubernetes-dashboard
resources:
- namespace.yaml
- https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/alternative.yaml
- traefik-forward-auth
- ingress.yaml
+4
View File
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: kubernetes-dashboard
-22
View File
@@ -1,22 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: metallb
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
path: infra/metallb
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
destination:
namespace: metallb-system
name: in-cluster
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true
-25
View File
@@ -1,25 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: monitoring
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
plugin:
name: kustomize-build-with-helm
path: infra/monitoring
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
destination:
namespace: monitoring
name: in-cluster
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
+1
View File
@@ -2,5 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- kube-prometheus-stack.yaml
- ingress-route.yaml
+4
View File
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: monitoring
-22
View File
@@ -1,22 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: sealed-secrets
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
path: infra/sealed-secrets
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
destination:
name: in-cluster
namespace: kube-system
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true
-24
View File
@@ -1,24 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: traefik
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
plugin:
name: kustomize-build-with-helm
path: infra/traefik
repoURL: https://github.com/vehagn/homelab
targetRevision: HEAD
destination:
namespace: traefik-system
name: in-cluster
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true
+2
View File
@@ -3,6 +3,7 @@ kind: Kustomization
namespace: traefik-system
resources:
- namespace.yaml
- storageClass.yaml
- persistentVolume.yaml
- traefik-forward-auth
@@ -13,4 +14,5 @@ helmCharts:
repo: https://helm.traefik.io/traefik
version: 23.0.1
releaseName: "traefik"
includeCRDs: true
valuesFile: values.yaml
+4
View File
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: traefik-system