Restructure deployments

This commit is contained in:
2024-12-24 13:25:02 +01:00
parent c267c4ea65
commit 487ce7c0ec
34 changed files with 83 additions and 91 deletions

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/authelia/release.yaml # /apps/base/authelia/base-release.yaml
apiVersion: helm.toolkit.fluxcd.io/v2 apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease kind: HelmRelease
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/authelia/kustomization.yaml # /apps/base/authelia/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
namespace: auth namespace: auth

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/authelia/namespace.yaml # /apps/base/authelia/namespace.yaml
apiVersion: v1 apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/authelia/repository.yaml # /apps/base/authelia/repository.yaml
apiVersion: source.toolkit.fluxcd.io/v1 apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository kind: HelmRepository
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/authelia/forward-auth-middleware.yaml # /apps/prod/authelia/forward-auth-middleware.yaml
apiVersion: traefik.containo.us/v1alpha1 apiVersion: traefik.containo.us/v1alpha1
kind: Middleware kind: Middleware
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/authelia/ingress.yaml # /apps/prod/authelia/ingress.yaml
apiVersion: traefik.containo.us/v1alpha1 apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute kind: IngressRoute
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/authelia/kustomization.yaml # /apps/prod/authelia/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
namespace: auth namespace: auth

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/authelia/release.yaml # /apps/prod/authelia/release.yaml
apiVersion: helm.toolkit.fluxcd.io/v2 apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease kind: HelmRelease
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/authelia/users-database.enc.yaml # /apps/prod/authelia/users-database.enc.yaml
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/authelia/values.yaml # /apps/prod/authelia/values.yaml
domain: 'example.com' domain: 'example.com'
configMap: configMap:
authentication_backend: authentication_backend:

View File

@@ -0,0 +1,6 @@
# apps/prod/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- authelia
- gitea

View File

@@ -1,3 +1,4 @@
# /clusters/prod/apps.yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
metadata: metadata:
@@ -11,7 +12,7 @@ spec:
kind: GitRepository kind: GitRepository
name: flux-system name: flux-system
dependsOn: dependsOn:
- name: infrastructure - name: infrastructure-configs
decryption: decryption:
provider: sops provider: sops
secretRef: secretRef:

View File

@@ -1,16 +1,48 @@
# /clusters/prod/infrastructure.yaml
---
apiVersion: kustomize.toolkit.fluxcd.io/v1 apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization kind: Kustomization
metadata: metadata:
name: infrastructure name: infrastructure-core
namespace: flux-system namespace: flux-system
spec: spec:
interval: 10m0s interval: 10m0s
path: ./infrastructure/prod path: ./infrastructure/core
prune: true prune: true
sourceRef: sourceRef:
kind: GitRepository kind: GitRepository
name: flux-system name: flux-system
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-controllers
namespace: flux-system
spec:
interval: 10m0s
path: ./infrastructure/controllers
prune: true
sourceRef:
kind: GitRepository
name: flux-system
dependsOn:
- name: infrastructure-core
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure-configs
namespace: flux-system
spec:
interval: 10m0s
path: ./infrastructure/configs
prune: true
sourceRef:
kind: GitRepository
name: flux-system
dependsOn:
- name: infrastructure-controllers
decryption: decryption:
provider: sops provider: sops
secretRef: secretRef:
name: sops-age name: sops-age

View File

@@ -1,19 +0,0 @@
# /infrastructure/base/cert-manager/release.yaml
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: cert-manager
namespace: cert-manager
spec:
interval: 12h
chart:
spec:
chart: cert-manager
version: "1.x"
sourceRef:
kind: HelmRepository
name: cert-manager
namespace: cert-manager
interval: 12h
values:
installCRDs: true

View File

@@ -1,8 +0,0 @@
# /infrastructure/base/cert-manager/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: cert-manager
resources:
- namespace.yaml
- repository.yaml

View File

@@ -1,16 +0,0 @@
# /infrastructure/base/traefik/release.yaml
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: traefik
namespace: traefik
spec:
interval: 10m
chart:
spec:
chart: traefik
version: 28.2.0
sourceRef:
kind: HelmRepository
name: traefik-helm-repo
interval: 10m

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/traefik/certificate.yaml # /infrastructure/configs/cert-manager/certificate.yaml
apiVersion: cert-manager.io/v1 apiVersion: cert-manager.io/v1
kind: Certificate kind: Certificate
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/cert-manager/secret.enc.yaml # /infrastructure/configs/cert-manager/secret.enc.yaml
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/cert-manager/issuer.yaml # /infrastructure/configs/cert-manager/issuer.yaml
apiVersion: cert-manager.io/v1 apiVersion: cert-manager.io/v1
kind: ClusterIssuer kind: ClusterIssuer
metadata: metadata:

View File

@@ -0,0 +1,7 @@
# /infrastructure/configs/cert-manager/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cloudflare-secret.enc.yaml
- issuer.yaml
- certificate.yaml

View File

@@ -1,8 +1,7 @@
# /infrastructure/base/traefik/kustomization.yaml # /infrastructure/controllers/cert-manager/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
namespace: traefik
resources: resources:
- namespace.yaml - namespace.yaml
- repository.yaml - repository.yaml
- release.yaml

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/cert-manager/namespace.yaml # /infrastructure/controllers/cert-manager/namespace.yaml
apiVersion: v1 apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/cert-manager/release.yaml # /infrastructure/controllers/cert-manager/release.yaml
apiVersion: helm.toolkit.fluxcd.io/v2 apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease kind: HelmRelease
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/cert-manager/repository.yaml # /infrastructure/controllers/cert-manager/repository.yaml
apiVersion: source.toolkit.fluxcd.io/v1 apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository kind: HelmRepository
metadata: metadata:

View File

@@ -0,0 +1,6 @@
# infrastructure/controllers/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cert-manager
- traefik

View File

@@ -1,8 +1,9 @@
# /infrastructure/prod/traefik/kustomization.yaml # /infrastructure/controllers/traefik/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ../../base/traefik - namespace.yaml
- repository.yaml
- release.yaml - release.yaml
configMapGenerator: configMapGenerator:

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/traefik/namespace.yaml # /infrastructure/controllers/traefik/namespace.yaml
apiVersion: v1 apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/traefik/release.yaml # /infrastructure/controllers/traefik/release.yaml
apiVersion: helm.toolkit.fluxcd.io/v2 apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease kind: HelmRelease
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/traefik/repository.yaml # /infrastructure/controllers/traefik/repository.yaml
apiVersion: source.toolkit.fluxcd.io/v1 apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository kind: HelmRepository
metadata: metadata:

View File

@@ -1,4 +1,4 @@
# /infrastructure/prod/traefik/values.yaml # /infrastructure/controllers/traefik/values.yaml
deployment: deployment:
additionalVolumes: additionalVolumes:
- name: access-log - name: access-log

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/storage-class/kustomization.yaml # /infrastructure/core/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:

View File

@@ -1,4 +1,4 @@
# /infrastructure/base/storage-class/storage-class.yaml # /infrastructure/core/storage-class.yaml
apiVersion: storage.k8s.io/v1 apiVersion: storage.k8s.io/v1
kind: StorageClass kind: StorageClass
metadata: metadata:

View File

@@ -1,9 +0,0 @@
# /infrastructure/prod/cert-manager/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base/cert-manager
- secret.enc.yaml
- release.yaml
- issuer.yaml

View File

@@ -1,8 +0,0 @@
# /infrastructure/prod/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base/storage-class
- authelia
- cert-manager
- traefik