diff --git a/apps/hydra/immich/deployment.yaml b/apps/hydra/immich/deployment.yaml deleted file mode 100644 index d82c59f..0000000 --- a/apps/hydra/immich/deployment.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: immich - name: immich - namespace: immich -spec: - selector: - matchLabels: - app: immich - strategy: {} - template: - metadata: - labels: - app: immich - spec: - containers: - - env: - - name: DB_DATABASE_NAME - valueFrom: - secretKeyRef: - key: db_username - name: immich-secret - - name: DB_HOSTNAME - valueFrom: - secretKeyRef: - key: db_host - name: immich-secret - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - key: db_password - name: immich-secret - - name: DB_PORT - valueFrom: - secretKeyRef: - key: db_port - name: immich-secret - - name: DB_USERNAME - valueFrom: - secretKeyRef: - key: db_username - name: immich-secret - image: ghcr.io/immich-app/immich-server:v2.6.0:-release} - name: immich-server - ports: - - containerPort: 2283 - resources: {} - volumes: - - name: upload - persistentVolumeClaim: - claimName: immich-pvc -status: {} diff --git a/apps/hydra/immich/kustomization.yaml b/apps/hydra/immich/kustomization.yaml index e34cda2..865e28e 100644 --- a/apps/hydra/immich/kustomization.yaml +++ b/apps/hydra/immich/kustomization.yaml @@ -6,4 +6,3 @@ metadata: resources: - namespace.yaml - uploads-pvc.yaml -- deployment.yaml diff --git a/apps/hydra/kustomization.yaml b/apps/hydra/kustomization.yaml index 0efd9ef..f26ac2b 100644 --- a/apps/hydra/kustomization.yaml +++ b/apps/hydra/kustomization.yaml @@ -2,3 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - secrets/ + - linkding/ + - immich/ diff --git a/infrastructure/hydra/longhorn/kustomization.yaml b/infrastructure/hydra/longhorn/kustomization.yaml index 821183c..35fd5f3 100644 --- a/infrastructure/hydra/longhorn/kustomization.yaml +++ b/infrastructure/hydra/longhorn/kustomization.yaml @@ -4,6 +4,6 @@ metadata: name: longhorn namespace: longhorn-system resources: -- longhorn-stack.yaml - release.yaml - namespace.yaml +- longhorn-stack.yaml diff --git a/infrastructure/hydra/monitoring/kustomization.yaml b/infrastructure/hydra/monitoring/kustomization.yaml index e6f7beb..f7b18cc 100644 --- a/infrastructure/hydra/monitoring/kustomization.yaml +++ b/infrastructure/hydra/monitoring/kustomization.yaml @@ -4,6 +4,6 @@ metadata: name: monitoring namespace: monitoring resources: +- namespace.yaml - kube-prometheus-stack.yaml - release.yaml -- namespace.yaml diff --git a/infrastructure/hydra/postgres/kustomization.yaml b/infrastructure/hydra/postgres/kustomization.yaml index 057d6bc..253a4d9 100644 --- a/infrastructure/hydra/postgres/kustomization.yaml +++ b/infrastructure/hydra/postgres/kustomization.yaml @@ -4,6 +4,6 @@ metadata: name: cnpg-cluster namespace: cnpg-cluster resources: +- cluster-namespace.yaml - pg-cluster.yaml - immich-db.yaml -- cluster-namespace.yaml diff --git a/pkg/cnpg/database.go b/pkg/cnpg/database.go deleted file mode 100644 index ce28c66..0000000 --- a/pkg/cnpg/database.go +++ /dev/null @@ -1 +0,0 @@ -package cnpg diff --git a/pkg/cnpg/helm.go b/pkg/cnpg/helm.go new file mode 100644 index 0000000..4bd0b84 --- /dev/null +++ b/pkg/cnpg/helm.go @@ -0,0 +1,50 @@ +package cnpg + +import ( + "time" + + "danicos.dev/daniel/go-kube/pkg/flux" + "danicos.dev/daniel/homelab/pkg/root" + + helm "github.com/fluxcd/helm-controller/api/v2" + source "github.com/fluxcd/source-controller/api/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func HelmSource() source.HelmRepository { + spec := source.HelmRepositorySpec{ + Interval: durHour(root.FLUX_HELM_MONITORING_INTERVAL), + URL: root.HELM_CLOUD_NATIVE_PG_URL, + } + return flux.NewFluxHelmRepositorySource(meta_system, spec) +} + +func HelmRelease() helm.HelmRelease { + interval := durHour(12) + spec := helm.HelmReleaseSpec{ + Interval: durMin(30), + Chart: &helm.HelmChartTemplate{ + Spec: helm.HelmChartTemplateSpec{ + Chart: root.HELM_CLOUD_NATIVE_PG_CHART, + Version: root.HELM_CLOUD_NATIVE_PG_CHART_VERSION, + Interval: &interval, + SourceRef: helm.CrossNamespaceObjectReference{ + Kind: flux.MetaHelmRepository.Kind, + Name: meta_system.Meta().Name, + Namespace: SystemNamespace.Name, + }, + }, + }, + Install: &helm.Install{CRDs: helm.Create}, + Upgrade: &helm.Upgrade{CRDs: helm.CreateReplace}, + } + return flux.NewFluxHelmRelease(meta_system, spec) +} + +func durHour(d int64) metav1.Duration { + return metav1.Duration{Duration: (time.Duration(d) * time.Hour)} +} + +func durMin(d int64) metav1.Duration { + return metav1.Duration{Duration: (time.Duration(d) * time.Minute)} +} diff --git a/pkg/immich/immich.go b/pkg/immich/immich.go index c293ab9..a43a34c 100644 --- a/pkg/immich/immich.go +++ b/pkg/immich/immich.go @@ -49,7 +49,7 @@ func Stack() stack.Stack { "namespace": Namespace, "uploads-pvc": uploads_pvc, // "redis": Redis(), - "deployment": Deployment(), + // "deployment": Deployment(), }, ) return kz.Stack("immich")