Add postgres app.
This commit is contained in:
10
apps/postgres/README.md
Normal file
10
apps/postgres/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Postgress app
|
||||||
|
|
||||||
|
## Required .env variables
|
||||||
|
|
||||||
|
```
|
||||||
|
POSTGRES_DB
|
||||||
|
POSTGRES_USER
|
||||||
|
POSTGRES_PASSWORD
|
||||||
|
PGDATA
|
||||||
|
```
|
40
apps/postgres/deployment.yaml
Normal file
40
apps/postgres/deployment.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: postgres-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: postgres
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: postgres
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: postgres
|
||||||
|
image: postgres:15
|
||||||
|
ports:
|
||||||
|
- containerPort: 5432
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: secrets
|
||||||
|
- configMapRef:
|
||||||
|
name: config
|
||||||
|
env:
|
||||||
|
- name: PGDATA
|
||||||
|
value: /var/lib/postgresql/data/pgdata
|
||||||
|
- name: TZ
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: config
|
||||||
|
key: TZ
|
||||||
|
volumeMounts:
|
||||||
|
- name: postgres-data
|
||||||
|
mountPath: /var/lib/postgresql/data
|
||||||
|
volumes:
|
||||||
|
- name: postgres-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: postgres-pvc
|
34
apps/postgres/kustomization.yaml
Normal file
34
apps/postgres/kustomization.yaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: postgres
|
||||||
|
labels:
|
||||||
|
- includeSelectors: true
|
||||||
|
pairs:
|
||||||
|
app: postgres
|
||||||
|
managedBy: kustomize
|
||||||
|
partOf: sovereign-cloud
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
- namespace.yaml
|
||||||
|
- service.yaml
|
||||||
|
- pvc.yaml
|
||||||
|
configMapGenerator:
|
||||||
|
- name: config
|
||||||
|
envs:
|
||||||
|
- config/config.env
|
||||||
|
secretGenerator:
|
||||||
|
- name: secrets
|
||||||
|
envs:
|
||||||
|
- config/secrets.env
|
||||||
|
|
||||||
|
replacements:
|
||||||
|
- source:
|
||||||
|
kind: ConfigMap
|
||||||
|
name: config
|
||||||
|
fieldPath: data.POSTGRES_STORAGE
|
||||||
|
targets:
|
||||||
|
- fieldPaths:
|
||||||
|
- spec.resources.requests.storage
|
||||||
|
select:
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
name: postgresql-pvc
|
5
apps/postgres/manifest.yaml
Normal file
5
apps/postgres/manifest.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
name: postgres
|
||||||
|
install: true
|
||||||
|
description: PostgreSQL is a powerful, open source object-relational database system.
|
||||||
|
version: 1.0.0
|
||||||
|
icon: https://www.postgresql.org/media/img/about/press/elephant.png
|
4
apps/postgres/namespace.yaml
Normal file
4
apps/postgres/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: postgres
|
12
apps/postgres/pvc.yaml
Normal file
12
apps/postgres/pvc.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: postgres-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: longhorn
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
10
apps/postgres/service.yaml
Normal file
10
apps/postgres/service.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: postgres
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 5432
|
||||||
|
selector:
|
||||||
|
app: postgres
|
Reference in New Issue
Block a user