This commit is contained in:
2022-05-12 15:14:17 +02:00
commit 8b6d2727ad
12 changed files with 242 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
node_modules/
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@ -0,0 +1,6 @@
apiVersion: v2
name: template-postgres
description: Template helm chart for a postgres-database
type: application
version: 0.1.0
appVersion: "0.0.1"

View File

@ -0,0 +1,30 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.database.name }}
labels:
app: {{ .Values.database.name }}
spec:
replicas: {{ .Values.container.replicas }}
selector:
matchLabels:
app: {{ .Values.database.name }}
template:
metadata:
labels:
app: {{ .Values.database.name }}
spec:
containers:
- name: {{ .Values.database.name }}
image: bitnami/postgresql:latest
ports:
containerPort: 5432
volumeMounts:
- mountPath: /bitnami/postgresql
env:
- name: POSTGRESQL_USERNAME
value: {{ .Values.database.auth.user }}
- name: POSTGRESQL_PASSWORD
value: {{ .Values.database.auth.password }}
- name: POSTGRESQL_DATABASE
value: {{ .Values.database.createdDatabase }}

View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .Values.database.name }}-pv
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: {{ .Values.database.size }}
accessModes:
- ReadWriteOnce
hostPath:
path: {{ .Values.database.mountPath }}

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.database.name }}-pvc
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.database.size }}

View File

@ -0,0 +1,10 @@
container:
replicas: 1
database:
createdDatabase: postgres
name: template-postgres
mountPath: /mnt/postgres/data
size: 10Gi
auth:
user: postgres
password: super