diff --git a/infrastructure/hydra/kustomization.yaml b/infrastructure/hydra/kustomization.yaml index e18e437..f3c3d5c 100644 --- a/infrastructure/hydra/kustomization.yaml +++ b/infrastructure/hydra/kustomization.yaml @@ -7,3 +7,4 @@ resources: - monitoring/ - longhorn/ - cloud-native-pg/ + - postgres/ diff --git a/pkg/cnpg/cluster.go b/pkg/cnpg/cluster.go deleted file mode 100644 index ce28c66..0000000 --- a/pkg/cnpg/cluster.go +++ /dev/null @@ -1 +0,0 @@ -package cnpg diff --git a/pkg/cnpg/helm.go b/pkg/cnpg/helm.go deleted file mode 100644 index 4bd0b84..0000000 --- a/pkg/cnpg/helm.go +++ /dev/null @@ -1,50 +0,0 @@ -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)} -}