feat: replace ansible templating with makejinja (#1156)

This commit is contained in:
Devin Buhl authored and GitHub committed 2024-01-14 23:03:02 -05:00
1 parent a4731906d9
commit f9481d6202
114 files changed
+555 -906

No files matched your search

@@ -0,0 +1,30 @@
{% if csi_driver_nfs.enabled | default(false) %}
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: csi-driver-nfs
spec:
interval: 30m
chart:
spec:
chart: csi-driver-nfs
version: v4.5.0
sourceRef:
kind: HelmRepository
name: csi-driver-nfs
namespace: flux-system
maxHistory: 2
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
externalSnapshotter:
enabled: false
{% endif %}
@@ -0,0 +1,8 @@
{% if csi_driver_nfs.enabled | default(false) %}
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
- ./storageclass.yaml
{% endif %}
@@ -0,0 +1,16 @@
{% if csi_driver_nfs.enabled | default(false) %}
{% for item in csi_driver_nfs.storage_class %}
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ item.name }}
provisioner: nfs.csi.k8s.io
parameters:
server: {{ item.server }}
share: {{ item.share }}
reclaimPolicy: Delete
volumeBindingMode: Immediate
mountOptions: ["hard", "noatime"]
{% endfor %}
{% endif %}
@@ -0,0 +1,22 @@
{% if csi_driver_nfs.enabled | default(false) %}
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app csi-driver-nfs
namespace: flux-system
spec:
targetNamespace: storage
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/storage/csi-driver-nfs/app
prune: true
sourceRef:
kind: GitRepository
name: home-kubernetes
wait: true
interval: 30m
retryInterval: 1m
timeout: 5m
{% endif %}
@@ -4,7 +4,7 @@ kind: Kustomization
resources:
- ./namespace.yaml
- ./openebs/ks.yaml
{% if volsync.enabled | default(false) %}
{% if volsync.enabled | default(false) %}
- ./volsync/ks.yaml
{% endif %}
{% if csi_driver_nfs.enabled | default(false) %}
@@ -0,0 +1,44 @@
{% if volsync.enabled | default(false) %}
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: volsync
spec:
interval: 30m
chart:
spec:
chart: volsync
version: 0.8.0
sourceRef:
kind: HelmRepository
name: backube
namespace: flux-system
maxHistory: 2
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
dependsOn:
- name: snapshot-controller
namespace: storage
values:
manageCRDs: true
image:
# https://github.com/backube/volsync/issues/828
repository: &image ghcr.io/onedr0p/volsync
tag: &tag 0.8.0
rclone:
repository: *image
tag: *tag
restic:
repository: *image
tag: *tag
metrics:
disableAuth: true
{% endif %}
@@ -0,0 +1,8 @@
{% if volsync.enabled | default(false) %}
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
- ./prometheusrule.yaml
{% endif %}
@@ -0,0 +1,25 @@
{% if volsync.enabled | default(false) %}
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: volsync
spec:
groups:
- name: volsync.rules
rules:
- alert: VolSyncComponentAbsent
annotations:
summary: VolSync component has disappeared from Prometheus target discovery.
expr: absent(up{job="volsync-metrics"})
for: 15m
labels:
severity: critical
- alert: VolSyncVolumeOutOfSync
annotations:
summary: "{% raw %}{{ $labels.obj_namespace }}/{{ $labels.obj_name }} volume is out of sync.{% endraw %}"
expr: volsync_volume_out_of_sync == 1
for: 15m
labels:
severity: critical
{% endif %}
@@ -0,0 +1,42 @@
{% if volsync.enabled | default(false) %}
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app snapshot-controller
namespace: flux-system
spec:
targetNamespace: storage
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/storage/volsync/snapshot-controller
prune: true
sourceRef:
kind: GitRepository
name: home-kubernetes
wait: false
interval: 30m
retryInterval: 1m
timeout: 5m
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app volsync
namespace: flux-system
spec:
targetNamespace: storage
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/storage/volsync/app
prune: true
sourceRef:
kind: GitRepository
name: home-kubernetes
wait: false
interval: 30m
retryInterval: 1m
timeout: 5m
{% endif %}
@@ -0,0 +1,35 @@
{% if volsync.enabled | default(false) %}
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: snapshot-controller
spec:
interval: 30m
chart:
spec:
chart: snapshot-controller
version: 2.0.4
sourceRef:
kind: HelmRepository
name: piraeus
namespace: flux-system
maxHistory: 2
install:
crds: CreateReplace
remediation:
retries: 3
upgrade:
cleanupOnFail: true
crds: CreateReplace
remediation:
retries: 3
uninstall:
keepHistory: false
values:
controller:
serviceMonitor:
create: true
webhook:
enabled: false
{% endif %}
@@ -0,0 +1,7 @@
{% if volsync.enabled | default(false) %}
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
{% endif %}