This commit is contained in:
2026-02-18 18:49:07 +01:00
parent 408f49ba10
commit 61545bcf1b
6 changed files with 36 additions and 136 deletions

View File

@@ -24,12 +24,13 @@ APP VERSION: {{ .Chart.AppVersion }}
2. Check the status of the pods:
kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "timetracker.name" . }},app.kubernetes.io/instance={{ .Release.Name }}"
3. PostgreSQL Credentials:
Username: {{ .Values.postgresql.auth.username }}
Password: {{ .Values.postgresql.auth.password }}
Database: {{ .Values.postgresql.auth.database }}
3. External PostgreSQL:
This chart requires an existing PostgreSQL database.
Configured connection: {{ .Values.postgresql.url }}
IMPORTANT NOTES:
- Ensure your external PostgreSQL database is reachable from within the cluster before installing.
- Set postgresql.url in values.yaml to point to your existing database.
- Make sure to change the OIDC configuration in values.yaml
- Change the SESSION_SECRET from the default value for production
- Configure ingress host and TLS settings for your environment

View File

@@ -61,14 +61,6 @@ Create the name of the service account to use
{{- end }}
{{- end }}
{{/*
PostgreSQL labels
*/}}
{{- define "timetracker.postgresql.labels" -}}
{{ include "timetracker.labels" . }}
app.kubernetes.io/component: postgresql
{{- end }}
{{/*
Backend labels
*/}}
@@ -101,10 +93,3 @@ Frontend selector labels
app.kubernetes.io/component: frontend
{{- end }}
{{/*
PostgreSQL selector labels
*/}}
{{- define "timetracker.postgresql.selectorLabels" -}}
{{ include "timetracker.selectorLabels" . }}
app.kubernetes.io/component: postgresql
{{- end }}','description':'Creates a comprehensive helpers.tpl file with standard Kubernetes naming conventions and label helpers for timetracker application components'}] <|tool_calls_section_begin|><|tool_call_begin|>functions.create_new_file:48<|tool_call_argument_begin|>{

View File

@@ -30,8 +30,26 @@ spec:
value: {{ .Values.backend.env.nodeEnv | quote }}
- name: PORT
value: {{ .Values.backend.env.port | quote }}
- name: PG_USERNAME
{{- if .Values.postgresql.auth.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ .Values.postgresql.auth.existingSecret }}
key: username
{{- else }}
value: {{ .Values.postgresql.auth.username | quote }}
{{- end }}
- name: PG_PASSWORD
{{- if .Values.postgresql.auth.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ .Values.postgresql.auth.existingSecret }}
key: password
{{- else }}
value: {{ .Values.postgresql.auth.password | quote }}
{{- end }}
- name: DATABASE_URL
value: "postgresql://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ include "timetracker.fullname" . }}-postgresql:5432/{{ .Values.postgresql.auth.database }}"
value: "postgresql://$(PG_USERNAME):$(PG_PASSWORD)@{{ .Values.postgresql.host }}:{{ .Values.postgresql.port }}/{{ .Values.postgresql.database }}"
- name: OIDC_ISSUER_URL
value: {{ .Values.backend.oidc.issuerUrl | quote }}
- name: OIDC_CLIENT_ID

View File

@@ -1,15 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "timetracker.fullname" . }}-postgresql
labels:
{{- include "timetracker.postgresql.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- port: 5432
targetPort: postgresql
protocol: TCP
name: postgresql
selector:
{{- include "timetracker.postgresql.selectorLabels" . | nindent 4 }}

View File

@@ -1,78 +0,0 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "timetracker.fullname" . }}-postgresql
labels:
{{- include "timetracker.postgresql.labels" . | nindent 4 }}
spec:
serviceName: {{ include "timetracker.fullname" . }}-postgresql
replicas: 1
selector:
matchLabels:
{{- include "timetracker.postgresql.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "timetracker.postgresql.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "timetracker.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: postgresql
image: "{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}"
imagePullPolicy: {{ .Values.postgresql.image.pullPolicy }}
env:
- name: POSTGRES_USER
value: {{ .Values.postgresql.auth.username | quote }}
- name: POSTGRES_PASSWORD
value: {{ .Values.postgresql.auth.password | quote }}
- name: POSTGRES_DB
value: {{ .Values.postgresql.auth.database | quote }}
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
ports:
- name: postgresql
containerPort: 5432
protocol: TCP
livenessProbe:
exec:
command:
- pg_isready
- -U
- {{ .Values.postgresql.auth.username }}
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
readinessProbe:
exec:
command:
- pg_isready
- -U
- {{ .Values.postgresql.auth.username }}
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
resources:
{{- toYaml .Values.postgresql.resources | nindent 12 }}
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- {{ .Values.postgresql.persistence.accessMode }}
{{- if .Values.postgresql.persistence.storageClass }}
storageClassName: {{ .Values.postgresql.persistence.storageClass }}
{{- end }}
resources:
requests:
storage: {{ .Values.postgresql.persistence.size }}