feat: implement mjfilter file for templates (#1244)

* feat: implement mjfilter file for templates

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: use data.get in mjfilters

Signed-off-by: Devin Buhl <devin@buhl.casa>

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl authored and GitHub committed 2024-01-24 14:52:50 -05:00
1 parent 9d175fcc99
commit 5d849727d8
112 files changed
+81 -184

No files matched your search

@@ -0,0 +1 @@
main = lambda data: data.get("addon_csi_driver_nfs", {}).get("enabled", False) == True
@@ -1,4 +1,3 @@
#% if addon_csi_driver_nfs.enabled %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -29,4 +28,3 @@ spec:
#% if bootstrap_distribution in ['k0s'] %#
kubeletDir: /var/lib/k0s/kubelet
#% endif %#
#% endif %#
@@ -1,8 +1,8 @@
#% if addon_csi_driver_nfs.enabled %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
#% if addon_csi_driver_nfs.storage_class|length > 0 %#
- ./storageclass.yaml
#% endif %#
#% endif %#
@@ -1,4 +1,3 @@
#% if addon_csi_driver_nfs.enabled %#
#% for item in addon_csi_driver_nfs.storage_class %#
---
apiVersion: storage.k8s.io/v1
@@ -13,4 +12,3 @@ reclaimPolicy: Delete
volumeBindingMode: Immediate
mountOptions: ["hard", "noatime"]
#% endfor %#
#% endif %#
@@ -1,4 +1,3 @@
#% if addon_csi_driver_nfs.enabled %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -19,4 +18,3 @@ spec:
interval: 30m
retryInterval: 1m
timeout: 5m
#% endif %#
@@ -0,0 +1 @@
main = lambda data: data.get("addon_csi_driver_smb", {}).get("enabled", False) == True
@@ -1,4 +1,3 @@
#% if addon_csi_driver_smb.enabled %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -30,4 +29,3 @@ spec:
#% else %#
kubelet: /var/lib/kubelet
#% endif %#
#% endif %#
@@ -1,11 +1,11 @@
#% if addon_csi_driver_smb.enabled %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
#% if addon_csi_driver_smb.storage_class|length > 0 %#
- ./storageclass.yaml
#% endif %#
#% if addon_csi_driver_smb.create_secrets|default(true) %#
- ./secrets.sops.yaml
#% endif %#
#% endif %#
@@ -1,4 +1,4 @@
#% if addon_csi_driver_smb.enabled and addon_csi_driver_smb.create_secrets|default(true) %#
#% if addon_csi_driver_smb.create_secrets|default(true) %#
#% for item in addon_csi_driver_smb.storage_class %#
#% if not item.existing_secret_name %#
---
@@ -1,4 +1,3 @@
#% if addon_csi_driver_smb.enabled %#
#% for item in addon_csi_driver_smb.storage_class %#
---
apiVersion: storage.k8s.io/v1
@@ -22,4 +21,3 @@ mountOptions:
- cache=strict
- noserverino # required to prevent data corruption
#% endfor %#
#% endif %#
@@ -1,4 +1,3 @@
#% if addon_csi_driver_smb.enabled %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -19,4 +18,3 @@ spec:
interval: 30m
retryInterval: 1m
timeout: 5m
#% endif %#
@@ -0,0 +1 @@
main = lambda data: data.get("addon_volsync", {}).get("enabled", False) == True
@@ -1,4 +1,3 @@
#% if addon_volsync.enabled %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -40,4 +39,3 @@ spec:
tag: *tag
metrics:
disableAuth: true
#% endif %#
@@ -1,8 +1,6 @@
#% if addon_volsync.enabled %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
- ./prometheusrule.yaml
#% endif %#
@@ -1,4 +1,3 @@
#% if addon_volsync.enabled %#
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
@@ -22,4 +21,3 @@ spec:
for: 15m
labels:
severity: critical
#% endif %#
@@ -1,4 +1,3 @@
#% if addon_volsync.enabled %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -10,10 +9,6 @@ spec:
commonMetadata:
labels:
app.kubernetes.io/name: *app
#% if addon_longhorn.enabled %#
dependsOn:
- name: longhorn
#% endif %#
path: ./kubernetes/apps/storage/volsync/snapshot-controller
prune: true
sourceRef:
@@ -43,4 +38,3 @@ spec:
interval: 30m
retryInterval: 1m
timeout: 5m
#% endif %#
@@ -25,6 +25,11 @@ spec:
retries: 3
uninstall:
keepHistory: false
#% if bootstrap_distribution in ['k0s', 'k3s'] and addon_longhorn.enabled %#
dependsOn:
- name: longhorn
namespace: longhorn-system
#% endif %#
values:
controller:
#% if bootstrap_distribution in ['k0s', 'k3s'] and addon_longhorn.enabled %#
@@ -1,7 +1,5 @@
#% if addon_volsync.enabled %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
#% endif %#