Skip to content

Commit

Permalink
♻️ Refactor Flux kustomizations for apps
Browse files Browse the repository at this point in the history
Move apps from the central Flux kustomization to dedicated resources.

Follow the template repo
[flux2-kustomize-helm-example](https://github.com/fluxcd/flux2-kustomize-helm-example)
  • Loading branch information
nomaster committed Feb 24, 2024
1 parent 413ec7a commit 037004c
Show file tree
Hide file tree
Showing 40 changed files with 131 additions and 30 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ spec:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
hostName: dendrite.ffddorf.net
tls:
tls:
- hosts: [ dendrite.ffddorf.net ]
secretName: dendrite-tls

File renamed without changes.
18 changes: 18 additions & 0 deletions apps/prod/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base/cert-manager
- ../base/dendrite
- ../base/cryptpad
- ../base/external-dns
- ../base/grafana
- ../base/prometheus
- traefik-config.yaml
patches:
- path: dendrite-values.yaml
target:
kind: HelmRelease
- path: grafana-values.yaml
target:
kind: HelmRelease
File renamed without changes.
8 changes: 0 additions & 8 deletions base/external-dns/helm-repository.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions base/external-dns/kustomization.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions base/external-dns/namespace.yaml

This file was deleted.

14 changes: 8 additions & 6 deletions clusters/k3s1/apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: metallb
name: apps
namespace: flux-system
spec:
interval: 1h
retryInterval: 1m
timeout: 5m
interval: 10m0s
dependsOn:
- name: infra-configs
sourceRef:
kind: GitRepository
name: flux-system
path: ./base/metallb
prune: false
path: ./base/production
prune: true
waitr: true
timeout: 5m
34 changes: 34 additions & 0 deletions clusters/k3s1/infrastructure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infra-controllers
namespace: flux-system
spec:
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./infrastructure/controllers
prune: true
wait: true
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infra-configs
namespace: flux-system
spec:
dependsOn:
- name: infra-controllers
interval: 1h
retryInterval: 1m
timeout: 5m
sourceRef:
kind: GitRepository
name: flux-system
path: ./infrastructure/configs
prune: true
wait: true
File renamed without changes.
35 changes: 35 additions & 0 deletions infrastructure/controllers/cert-manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: cert-manager
labels:
toolkit.fluxcd.io/tenant: sre-team
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: cert-manager
namespace: cert-manager
spec:
interval: 24h
url: https://charts.jetstack.io
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: cert-manager
namespace: cert-manager
spec:
interval: 30m
chart:
spec:
chart: cert-manager
version: "1.x"
sourceRef:
kind: HelmRepository
name: cert-manager
namespace: cert-manager
interval: 12h
values:
installCRDs: true
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: external-dns
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: external-dns
namespace: external-dns
spec:
interval: 24h
url: https://kubernetes-sigs.github.io/external-dns/
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: external-dns
namespace: external-dns
spec:
chart:
spec:
Expand Down
5 changes: 5 additions & 0 deletions infrastructure/controllers/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cert-manager.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: metallb-system
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: metallb
spec:
url: https://metallb.github.io/metallb
interval: 1h
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: metallb
spec:
interval: 1h
interval: 24h
install:
createNamespace: false
chart:
spec:
chart: metallb
version: "0.x"
sourceRef:
kind: HelmRepository
name: metallb

0 comments on commit 037004c

Please sign in to comment.