INIT(postgresql): databases setup
- with pg and pg-dev
This commit is contained in:
48
postgresql-dev/argocd/postgresql-dev.yaml
Normal file
48
postgresql-dev/argocd/postgresql-dev.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: postgresql-dev
|
||||
namespace: argocd
|
||||
finalizers:
|
||||
- resources-finalizer.argocd.argoproj.io
|
||||
spec:
|
||||
project: default
|
||||
|
||||
sources:
|
||||
- repoURL: https://charts.bitnami.com/bitnami
|
||||
chart: postgresql
|
||||
targetRevision: 16.2.1
|
||||
helm:
|
||||
valueFiles:
|
||||
- $values/postgresql-dev/helm-values/postgresql-dev.yaml
|
||||
- repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git
|
||||
targetRevision: main
|
||||
ref: values
|
||||
# Vault secrets from Git repository
|
||||
- repoURL: https://gitea0213.kro.kr/bluemayne/infrastructure.git
|
||||
targetRevision: main
|
||||
path: postgresql-dev
|
||||
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: postgresql-dev
|
||||
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
allowEmpty: false
|
||||
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
- PrunePropagationPolicy=foreground
|
||||
- PruneLast=true
|
||||
|
||||
retry:
|
||||
limit: 5
|
||||
backoff:
|
||||
duration: 5s
|
||||
factor: 2
|
||||
maxDuration: 3m
|
||||
|
||||
revisionHistoryLimit: 10
|
||||
31
postgresql-dev/helm-values/postgresql-dev.yaml
Normal file
31
postgresql-dev/helm-values/postgresql-dev.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
# PostgreSQL (Development) Helm Values
|
||||
# Chart: https://github.com/bitnami/charts/tree/main/bitnami/postgresql
|
||||
# Single instance for development
|
||||
|
||||
fullnameOverride: postgresql-dev
|
||||
|
||||
image:
|
||||
tag: latest
|
||||
|
||||
architecture: standalone
|
||||
|
||||
auth:
|
||||
existingSecret: postgresql-password-dev
|
||||
secretKeys:
|
||||
adminPasswordKey: postgres-password
|
||||
userPasswordKey: password
|
||||
username: bluemayne
|
||||
database: postgres
|
||||
|
||||
persistence:
|
||||
enabled: true
|
||||
size: 10Gi
|
||||
storageClass: local-path
|
||||
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "30m" # Reduced to 30% of original (100m -> 30m)
|
||||
|
||||
metrics:
|
||||
enabled: false
|
||||
7
postgresql-dev/kustomization.yaml
Normal file
7
postgresql-dev/kustomization.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
# ArgoCD Application 리소스는 infrastructure/kustomization.yaml에서 관리
|
||||
# - argocd/postgresql-dev.yaml
|
||||
- vault/postgresql-password-dev.yaml
|
||||
22
postgresql-dev/vault/postgresql-password-dev.yaml
Normal file
22
postgresql-dev/vault/postgresql-password-dev.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
apiVersion: external-secrets.io/v1beta1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: postgresql-password-dev
|
||||
namespace: postgresql-dev
|
||||
spec:
|
||||
refreshInterval: 1h
|
||||
secretStoreRef:
|
||||
kind: ClusterSecretStore
|
||||
name: vault-backend
|
||||
target:
|
||||
name: postgresql-password-dev
|
||||
creationPolicy: Owner
|
||||
data:
|
||||
- secretKey: password
|
||||
remoteRef:
|
||||
key: postgresql-dev/root
|
||||
property: PASSWORD
|
||||
- secretKey: postgres-password
|
||||
remoteRef:
|
||||
key: postgresql-dev/root
|
||||
property: POSTGRES_PASSWORD
|
||||
Reference in New Issue
Block a user