This commit is contained in:
6
helmchart/templates/configmap.yaml
Normal file
6
helmchart/templates/configmap.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: meal-api-config
|
||||
data:
|
||||
DATABASE_URI: {{ .Values.configmap.dburi }}
|
@ -1,3 +1,4 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@ -24,7 +25,6 @@ spec:
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "helmchart.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
@ -33,17 +33,20 @@ spec:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: meal-api-config
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
path: /healthz
|
||||
port: http
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
path: /healthz
|
||||
port: http
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
|
62
helmchart/templates/postgresql.yaml
Normal file
62
helmchart/templates/postgresql.yaml
Normal file
@ -0,0 +1,62 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: meal-api-postgres-pvc
|
||||
spec:
|
||||
storageClassName: {{ .Values.postgres.storage.provider }}
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.postgres.storage.size }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: meal-api-postgres
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: meal-api-postgres
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: meal-api-postgres
|
||||
spec:
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: meal-api-postgres-pvc
|
||||
containers:
|
||||
- name: meal-api-postgres
|
||||
image: "postgres:14"
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: meal-api-postgres-config
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/postgresql
|
||||
name: data
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: meal-api-postgres
|
||||
spec:
|
||||
selector:
|
||||
app: meal-api-postgres
|
||||
ports:
|
||||
- name: {{ .Values.postgres.name }}
|
||||
protocol: TCP
|
||||
port: 5432
|
||||
targetPort: 5432
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: meal-api-postgres-config
|
||||
data:
|
||||
POSTGRES_PASSWORD: {{ .Values.postgres.password }}
|
||||
POSTGRES_USER: {{ .Values.postgres.user }}
|
||||
POSTGRES_DB: {{ .Values.postgres.database }}
|
@ -1,12 +0,0 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "helmchart.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "helmchart.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
Reference in New Issue
Block a user