diff --git a/kubernetes/teyvat/apps/database/cloudnative-pg/app/helmrelease.yaml b/kubernetes/teyvat/apps/database/cloudnative-pg/app/helmrelease.yaml index 778f1cf62f..013bf53d29 100644 --- a/kubernetes/teyvat/apps/database/cloudnative-pg/app/helmrelease.yaml +++ b/kubernetes/teyvat/apps/database/cloudnative-pg/app/helmrelease.yaml @@ -3,7 +3,7 @@ apiVersion: helm.toolkit.fluxcd.io/v2beta2 kind: HelmRelease metadata: - name: cloudnative-pg + name: &app cloudnative-pg spec: interval: 30m chart: diff --git a/kubernetes/teyvat/apps/database/dragonfly/app/helmrelease.yaml b/kubernetes/teyvat/apps/database/dragonfly/app/helmrelease.yaml new file mode 100644 index 0000000000..863cac3f36 --- /dev/null +++ b/kubernetes/teyvat/apps/database/dragonfly/app/helmrelease.yaml @@ -0,0 +1,70 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: &app dragonfly +spec: + interval: 35m + chart: + spec: + chart: dragonfly + version: v1.14.1 + sourceRef: + kind: HelmRepository + name: dragonfly + namespace: flux-system + maxHistory: 3 + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + uninstall: + keepHistory: false + dependsOn: + - name: local-path-provisioner + namespace: storage + values: + storage: + enabled: true + requests: 1Gi + storageClass: local-hostpath + extraArgs: + - --dbfilename=dump + - --snapshot_cron=* * * * * # cron format + service: + annotations: + io.cilium/lb-ipam-ips: ${SVC_DRAGONFLY_ADDR} + type: LoadBalancer + podSecurityContext: + fsGroup: 2000 + securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 500m + memory: 512Mi + serviceMonitor: + enabled: true + prometheusRule: + enabled: true + spec: + - alert: DragonflyMissing + expr: absent(dragonfly_uptime_in_seconds) == 1 + for: 0m + labels: + severity: critical + annotations: + summary: Dragonfly is missing + description: "Dragonfly is missing" diff --git a/kubernetes/teyvat/apps/database/dragonfly/app/kustomization.yaml b/kubernetes/teyvat/apps/database/dragonfly/app/kustomization.yaml new file mode 100644 index 0000000000..17cbc72b25 --- /dev/null +++ b/kubernetes/teyvat/apps/database/dragonfly/app/kustomization.yaml @@ -0,0 +1,6 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./helmrelease.yaml diff --git a/kubernetes/teyvat/apps/database/dragonfly/ks.yaml b/kubernetes/teyvat/apps/database/dragonfly/ks.yaml new file mode 100644 index 0000000000..11e3c577c2 --- /dev/null +++ b/kubernetes/teyvat/apps/database/dragonfly/ks.yaml @@ -0,0 +1,23 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app dragonfly + namespace: flux-system +spec: + targetNamespace: database + commonMetadata: + labels: + app.kubernetes.io/name: *app + dependsOn: + - name: external-secrets-bitwarden + path: ./kubernetes/teyvat/apps/database/dragonfly/app + prune: true + sourceRef: + kind: GitRepository + name: home-kubernetes + wait: true + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/kubernetes/teyvat/flux/repositories/helm/dragonfly.yaml b/kubernetes/teyvat/flux/repositories/helm/dragonfly.yaml new file mode 100644 index 0000000000..8a30a2f79d --- /dev/null +++ b/kubernetes/teyvat/flux/repositories/helm/dragonfly.yaml @@ -0,0 +1,11 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/source.toolkit.fluxcd.io/helmrepository_v1beta2.json +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: dragonfly + namespace: flux-system +spec: + type: oci + interval: 10m + url: oci://ghcr.io/dragonflydb/dragonfly/helm diff --git a/kubernetes/teyvat/flux/repositories/helm/kustomization.yaml b/kubernetes/teyvat/flux/repositories/helm/kustomization.yaml index 8061786b50..7589382b37 100644 --- a/kubernetes/teyvat/flux/repositories/helm/kustomization.yaml +++ b/kubernetes/teyvat/flux/repositories/helm/kustomization.yaml @@ -14,6 +14,7 @@ resources: - ./coredns.yaml - ./democratic-csi.yaml - ./descheduler.yaml + - ./dragonfly.yaml - ./external-dns.yaml - ./external-secrets.yaml - ./fairwinds.yaml