Skip to content

POC WIP Cloud native pg #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# cluster:
# superuserSecret: "postgresql"
51 changes: 51 additions & 0 deletions argocd/applications/templates/postgresql-cloudnative-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# SPDX-FileCopyrightText: 2025 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

{{- $appName := "postgresql-cloudnative-cluster" }}
{{- $namespace := "orch-database" }}
{{- $syncWave := "140" }}
---
# {{- if (index .Values.argo.enabled $appName) }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
argocd.argoproj.io/sync-wave: "{{ $syncWave }}"
name: {{$appName}}
namespace: {{ required "A valid namespace entry required!" .Values.argo.namespace }}
spec:
project: {{ required "A valid projectName entry required!" .Values.argo.project }}
sources:
- repoURL: "https://cloudnative-pg.github.io/charts"
chart: cluster
targetRevision: 0.3.1
helm:
releaseName: {{$appName}}
valuesObject:
{{- $customFile := printf "custom/%s.tpl" $appName }}
{{- $customConfig := tpl (.Files.Get $customFile) . | fromYaml }}
{{- $baseFile := printf "configs/%s.yaml" $appName }}
{{- $baseConfig := .Files.Get $baseFile|fromYaml}}
{{- $overwrite := (get .Values.postCustomTemplateOverwrite $appName ) | default dict }}
{{- mergeOverwrite $baseConfig $customConfig $overwrite | toYaml | nindent 10 }}
destination:
namespace: {{$namespace}}
server: {{ required "A valid targetServer entry required!" .Values.argo.targetServer }}
syncPolicy:
{{- if .Values.argo.autosync }}
automated:
prune: true
selfHeal: true
retry:
limit: 5
backoff:
duration: 5s
maxDuration: 3m0s
factor: 2
{{- end }}
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
# {{- end }}
51 changes: 51 additions & 0 deletions argocd/applications/templates/postgresql-cloudnative.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# SPDX-FileCopyrightText: 2025 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

{{- $appName := "postgresql-cloudnative" }}
{{- $namespace := "john" }}
{{- $syncWave := "140" }}
---
# {{- if (index .Values.argo.enabled $appName) }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
argocd.argoproj.io/sync-wave: "{{ $syncWave }}"
name: {{$appName}}
namespace: {{ required "A valid namespace entry required!" .Values.argo.namespace }}
spec:
project: {{ required "A valid projectName entry required!" .Values.argo.project }}
sources:
- repoURL: "https://cloudnative-pg.github.io/charts"
chart: cloudnative-pg
targetRevision: 0.23.2
helm:
releaseName: {{$appName}}
valuesObject:
{{- $customFile := printf "custom/%s.tpl" $appName }}
{{- $customConfig := tpl (.Files.Get $customFile) . | fromYaml }}
{{- $baseFile := printf "configs/%s.yaml" $appName }}
{{- $baseConfig := .Files.Get $baseFile|fromYaml}}
{{- $overwrite := (get .Values.postCustomTemplateOverwrite $appName ) | default dict }}
{{- mergeOverwrite $baseConfig $customConfig $overwrite | toYaml | nindent 10 }}
destination:
namespace: {{$namespace}}
server: {{ required "A valid targetServer entry required!" .Values.argo.targetServer }}
syncPolicy:
{{- if .Values.argo.autosync }}
automated:
prune: true
selfHeal: true
retry:
limit: 5
backoff:
duration: 5s
maxDuration: 3m0s
factor: 2
{{- end }}
syncOptions:
- ServerSideApply=true
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
# {{- end }}
2 changes: 2 additions & 0 deletions orch-configs/profiles/enable-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ argo:
namespace-resource-quota: true
k8s-metrics-server: true
token-fs: true
postgresql-cloudnative: true
postgresql-cloudnative-cluster: true
Loading