Add db-helm for recipes app
This commit is contained in:
parent
3689847f95
commit
008bf4270e
21
argocd-apps/my-recipes.yaml
Normal file
21
argocd-apps/my-recipes.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: my-recipes
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: my-apps
|
||||||
|
source:
|
||||||
|
repoURL: https://git.dvirlabs.com/dvirlabs/my-apps.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: charts/my-recipes-chart
|
||||||
|
helm:
|
||||||
|
valueFiles:
|
||||||
|
- ../../manifests/my-recipes/values.yaml
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: my-apps
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
6
charts/my-recipes-chart/Chart.yaml
Normal file
6
charts/my-recipes-chart/Chart.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: recipes-db
|
||||||
|
description: PostgreSQL (StatefulSet) for Recipes backend
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: "16"
|
||||||
11
charts/my-recipes-chart/templates/service.yaml
Normal file
11
charts/my-recipes-chart/templates/service.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
service.yamlapiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-headless
|
||||||
|
spec:
|
||||||
|
clusterIP: None
|
||||||
|
selector:
|
||||||
|
app: {{ .Release.Name }}
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.service.port }}
|
||||||
|
targetPort: 5432
|
||||||
42
charts/my-recipes-chart/templates/statefulset.yaml
Normal file
42
charts/my-recipes-chart/templates/statefulset.yaml
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-db
|
||||||
|
spec:
|
||||||
|
serviceName: {{ .Release.Name }}-headless
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Release.Name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: postgres
|
||||||
|
image: {{ .Values.image }}
|
||||||
|
ports:
|
||||||
|
- containerPort: 5432
|
||||||
|
env:
|
||||||
|
- name: POSTGRES_USER
|
||||||
|
value: {{ .Values.postgres.user | quote }}
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
value: {{ .Values.postgres.password | quote }}
|
||||||
|
- name: POSTGRES_DB
|
||||||
|
value: {{ .Values.postgres.database | quote }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /var/lib/postgresql/data
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ .Values.persistence.accessMode }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.size }}
|
||||||
|
{{- if .Values.persistence.storageClass }}
|
||||||
|
storageClassName: {{ .Values.persistence.storageClass | quote }}
|
||||||
|
{{- end }}
|
||||||
15
charts/my-recipes-chart/values.yaml
Normal file
15
charts/my-recipes-chart/values.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
image: postgres:16
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
user: recipes_user
|
||||||
|
password: recipes_password # simple for POC
|
||||||
|
database: recipes_db
|
||||||
|
|
||||||
|
service:
|
||||||
|
port: 5432
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
storageClass: "nfs-client" # or your default SC
|
||||||
|
size: 8Gi
|
||||||
Loading…
x
Reference in New Issue
Block a user