feat: Separate config for production/testing

This commit is contained in:
2025-12-09 02:37:21 +01:00
parent 9dc61f2311
commit eba0d19d68
12 changed files with 84 additions and 39 deletions

View File

@@ -0,0 +1,30 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: longhorn
namespace: longhorn-system
spec:
interval: 12h
install:
strategy:
name: RetryOnFailure
retryInterval: 2m
upgrade:
strategy:
name: RetryOnFailure
retryInterval: 3m
chart:
spec:
chart: longhorn
# TODO: Is it safe to upgrade automatically to 1.x?
version: "1.10.x"
sourceRef:
kind: HelmRepository
name: longhorn
interval: 24h
valuesFrom:
- kind: ConfigMap
name: values-base
- kind: ConfigMap
name: values-overlay
optional: true

View File

@@ -4,3 +4,12 @@ resources:
- namespace.yaml
- helm-repository.yaml
- helm-release.yaml
configurations:
- name-reference.yaml
configMapGenerator:
- name: values-base
namespace: cilium
files:
- values.yaml

View File

@@ -0,0 +1,6 @@
nameReference:
- kind: ConfigMap
version: v1
fieldSpecs:
- path: spec/valuesFrom/name
kind: HelmRelease

View File

@@ -0,0 +1,10 @@
defaultSettings:
defaultDataPath: /var/mnt/longhorn
replicaAutoBalance: best-effort
defaultDataLocality: best-effort
freezeFilesystemForSnapshot: enabled
storageReservedPercentageForDefaultDisk: 0
storageMinimalAvailablePercentage: 10
storageOverProvisioningPercentage: 25
persistence:
defaultDataLocality: best-effort

View File

@@ -1,38 +0,0 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: longhorn
namespace: longhorn-system
spec:
interval: 12h
install:
strategy:
name: RetryOnFailure
retryInterval: 2m
upgrade:
strategy:
name: RetryOnFailure
retryInterval: 3m
chart:
spec:
chart: longhorn
# TODO: Is it safe to upgrade automatically to 1.x?
version: "1.10.x"
sourceRef:
kind: HelmRepository
name: longhorn
interval: 24h
values:
# TODO: These settings are specific to testing
defaultSettings:
defaultReplicaCount: 1
defaultDataPath: /var/mnt/longhorn
replicaAutoBalance: best-effort
defaultDataLocality: best-effort
freezeFilesystemForSnapshot: enabled
storageReservedPercentageForDefaultDisk: 0
storageMinimalAvailablePercentage: 10
storageOverProvisioningPercentage: 25
persistence:
defaultClassReplicaCount: 1
defaultDataLocality: best-effort

View File

@@ -10,6 +10,6 @@ spec:
sourceRef:
kind: ExternalArtifact
name: longhorn
path: ./
path: ./${cluster_env}
prune: true
wait: true

View File

@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
configMapGenerator:
- name: values-overlay
namespace: cilium
files:
- values.yaml

View File

@@ -0,0 +1,4 @@
defaultSettings:
defaultReplicaCount: 2
persistence:
defaultClassReplicaCount: 2

View File

@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base
configMapGenerator:
- name: values-overlay
namespace: cilium
files:
- values.yaml

View File

@@ -0,0 +1,4 @@
defaultSettings:
defaultReplicaCount: 1
persistence:
defaultClassReplicaCount: 1