Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Refactor Flux kustomizations for apps #51

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +5 to +10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are all of these paths prefixed with base? what makes an app belong into base?

- 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
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some resources are in the same directory, but missing here:

  • external-dns.yaml
  • metallb.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