Implements CloudNativePG
This commit is contained in:
@@ -5,4 +5,5 @@ metadata:
|
||||
name: backend-config
|
||||
data:
|
||||
backend_url: backend-service
|
||||
backend_port: "8070"
|
||||
backend_port: "8070"
|
||||
backend_db_name: portfolio
|
||||
@@ -18,12 +18,12 @@ spec:
|
||||
image: yoshiunfriendly/backend-hideyoshi.com
|
||||
imagePullPolicy: Always
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "250m"
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "250m"
|
||||
ports:
|
||||
- containerPort: 8070
|
||||
env:
|
||||
@@ -119,15 +119,15 @@ spec:
|
||||
|
||||
- name: POSTGRES_URL
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: postgres-config
|
||||
key: postgres_url
|
||||
secretKeyRef:
|
||||
name: postgres-cn-cluster-app
|
||||
key: host
|
||||
|
||||
- name: POSTGRES_DB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres-secret
|
||||
key: postgresDatabase
|
||||
name: postgres-cn-cluster-app
|
||||
key: dbname
|
||||
|
||||
- name: DATABASE_URL
|
||||
value: "postgresql://$(POSTGRES_URL):5432/$(POSTGRES_DB)"
|
||||
@@ -135,14 +135,14 @@ spec:
|
||||
- name: DATABASE_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres-secret
|
||||
key: postgresUser
|
||||
name: postgres-cn-cluster-app
|
||||
key: user
|
||||
|
||||
- name: DATABASE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres-secret
|
||||
key: postgresPassword
|
||||
name: postgres-cn-cluster-app
|
||||
key: password
|
||||
|
||||
- name: REDIS_URL
|
||||
valueFrom:
|
||||
|
||||
23
deployment/postgres/cn-cluster.yaml
Normal file
23
deployment/postgres/cn-cluster.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: postgres-cn-cluster
|
||||
namespace: portfolio
|
||||
spec:
|
||||
instances: 3
|
||||
primaryUpdateStrategy: unsupervised
|
||||
imageName: ghcr.io/cloudnative-pg/postgresql:14.10-18
|
||||
|
||||
storage:
|
||||
size: 5Gi
|
||||
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
|
||||
monitoring:
|
||||
enablePodMonitor: true
|
||||
@@ -1,27 +0,0 @@
|
||||
apiVersion: stackgres.io/v1
|
||||
kind: SGInstanceProfile
|
||||
metadata:
|
||||
namespace: portfolio
|
||||
name: postgres-portfolio-profile
|
||||
spec:
|
||||
cpu: "250m"
|
||||
memory: "512Mi"
|
||||
containers:
|
||||
pg-main-container:
|
||||
cpu: "250m"
|
||||
memory: "512Mi"
|
||||
|
||||
---
|
||||
apiVersion: stackgres.io/v1
|
||||
kind: SGCluster
|
||||
metadata:
|
||||
namespace: portfolio
|
||||
name: postgres-cluster
|
||||
spec:
|
||||
instances: 1
|
||||
postgres:
|
||||
version: "latest"
|
||||
pods:
|
||||
persistentVolume:
|
||||
size: "5Gi"
|
||||
sgInstanceProfile: postgres-portfolio-profile
|
||||
Reference in New Issue
Block a user