Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Kubeconform validation
run: |
kubeconform -summary -strict \
-skip Application,ApplicationSet,Certificate,ClusterIssuer,SealedSecret \
-skip Application,ApplicationSet,Certificate,ClusterIssuer,SealedSecret,PostgresCluster \
rendered.yaml

- name: OPA policy check
Expand Down
2 changes: 2 additions & 0 deletions clusters/dev/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ resources:
- ../../platform/infrastructure/networking/external-dns/base
# Storage
- ../../platform/infrastructure/storage/longhorn/base
# Database
- ../../platform/infrastructure/database/pgo/base
# AI Platform
- ../../platform/infrastructure/ai-platform/open-webui/base
# Observability
Expand Down
29 changes: 29 additions & 0 deletions platform/infrastructure/database/pgo/base/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: pgo-operator
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
project: default
source:
repoURL: registry.developers.crunchydata.com/crunchydata
chart: pgo
targetRevision: "5.7.4"
helm:
values: |
singleNamespace: false
destination:
name: CLUSTER
namespace: postgres-operator
syncPolicy:
automated:
allowEmpty: true
selfHeal: true
prune: true
syncOptions:
- Validate=true
- CreateNamespace=true
- PruneLast=true
- ServerSideApply=true
4 changes: 4 additions & 0 deletions platform/infrastructure/database/pgo/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Kustomization

resources:
- ../../base
- postgree-secrets.yaml
- postgres-cluster.yaml
- openrouter-secrets.yaml
- github-secrets.yaml

Expand Down Expand Up @@ -35,3 +35,10 @@ patches:
ingress:
enabled: true
host: chat-dev.syncjob.ru
postgresSecretRefName: ""
extraEnv:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: chat-db-pguser-chatapi
key: uri
64 changes: 64 additions & 0 deletions tenants/product-team/apps/chat/overlays/dev/postgres-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apiVersion: postgres-operator.crunchydata.com/v1beta1
kind: PostgresCluster
metadata:
name: chat-db
namespace: chat-api
spec:
postgresVersion: 16

instances:
- name: instance1
replicas: 1
dataVolumeClaimSpec:
storageClassName: longhorn
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
resources:
limits:
cpu: "2"
memory: 2Gi
requests:
cpu: "500m"
memory: 1Gi

backups:
pgbackrest:
repos:
- name: repo1
volume:
volumeClaimSpec:
storageClassName: longhorn
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi

patroni:
dynamicConfiguration:
postgresql:
parameters:
max_connections: "150"
shared_buffers: "512MB"
effective_cache_size: "1536MB"
maintenance_work_mem: "128MB"
checkpoint_completion_target: "0.9"
wal_buffers: "16MB"
default_statistics_target: "100"
random_page_cost: "1.1"
effective_io_concurrency: "200"
work_mem: "3495kB"
min_wal_size: "1GB"
max_wal_size: "4GB"
max_worker_processes: "2"
max_parallel_workers_per_gather: "1"
max_parallel_workers: "2"
max_parallel_maintenance_workers: "1"

users:
- name: chatapi
databases:
- chat