🎉 initial commit
Some checks failed
CI / Lint (push) Failing after 39s
CI / Build (push) Has been skipped
CI / Test (push) Has been skipped
CI / Helm Lint (push) Successful in 13s

This commit is contained in:
Christian van Dijk
2026-02-23 09:47:16 +01:00
commit 94b4f31102
53 changed files with 3220 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
apiVersion: v1
kind: Service
metadata:
name: api
labels:
app: api
spec:
ports:
- port: {{ .Values.api.service.port }}
targetPort: {{ .Values.api.service.port }}
name: http
selector:
app: api
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
labels:
app: api
spec:
replicas: {{ .Values.api.replicaCount }}
selector:
matchLabels:
app: api
template:
metadata:
labels:
app: api
spec:
containers:
- name: api
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag }}"
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
ports:
- containerPort: {{ .Values.api.service.port }}
envFrom:
- configMapRef:
name: handheld-devices-config
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: handheld-devices-secrets
key: db-password
livenessProbe:
httpGet:
path: /health/live
port: {{ .Values.api.service.port }}
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /health/ready
port: {{ .Values.api.service.port }}
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
resources:
{{- toYaml .Values.api.resources | nindent 12 }}

View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: handheld-devices-config
labels:
app.kubernetes.io/name: handheld-devices
app.kubernetes.io/instance: {{ .Release.Name }}
data:
DB_HOST: "postgres"
DB_PORT: "5432"
DB_NAME: "handheld_devices"
DB_USER: "devices_user"
REDIS_HOST: "redis"
REDIS_PORT: "6379"

View File

@@ -0,0 +1,57 @@
apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
app: frontend
spec:
ports:
- port: {{ .Values.frontend.service.port }}
targetPort: {{ .Values.frontend.service.port }}
name: http
selector:
app: frontend
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
app: frontend
spec:
replicas: {{ .Values.frontend.replicaCount }}
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: frontend
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}"
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
ports:
- containerPort: {{ .Values.frontend.service.port }}
env:
- name: API_URL
value: {{ .Values.frontend.apiUrl | quote }}
- name: PORT
value: "{{ .Values.frontend.service.port }}"
livenessProbe:
httpGet:
path: /health
port: {{ .Values.frontend.service.port }}
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 3
readinessProbe:
httpGet:
path: /health
port: {{ .Values.frontend.service.port }}
initialDelaySeconds: 3
periodSeconds: 5
timeoutSeconds: 3
resources:
{{- toYaml .Values.frontend.resources | nindent 12 }}

View File

@@ -0,0 +1,31 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: handheld-devices-ingress
labels:
app.kubernetes.io/name: handheld-devices
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ .service }}
port:
number: {{ .port }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,73 @@
{{- if .Values.postgres.enabled }}
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
ports:
- port: 5432
targetPort: 5432
name: postgres
selector:
app: postgres
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
labels:
app: postgres
spec:
serviceName: postgres
replicas: 1
selector:
matchLabels:
app: postgres
podManagementPolicy: Parallel
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: {{ .Values.postgres.image.repository }}:{{ .Values.postgres.image.tag }}
env:
- name: POSTGRES_DB
value: handheld_devices
- name: POSTGRES_USER
value: devices_user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: handheld-devices-secrets
key: db-password
ports:
- containerPort: 5432
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
volumes:
- name: postgres-data
{{- if .Values.postgres.persistence.enabled }}
persistentVolumeClaim:
claimName: postgres-pvc
{{- else }}
emptyDir: {}
{{- end }}
---
{{- if .Values.postgres.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.postgres.persistence.size }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,37 @@
{{- if .Values.redis.enabled }}
apiVersion: v1
kind: Service
metadata:
name: redis
labels:
app: redis
spec:
ports:
- port: 6379
targetPort: 6379
name: redis
selector:
app: redis
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
labels:
app: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: {{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}
ports:
- containerPort: 6379
{{- end }}

View File

@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: handheld-devices-secrets
labels:
app.kubernetes.io/name: handheld-devices
app.kubernetes.io/instance: {{ .Release.Name }}
data:
db-password: {{ .Values.dbPassword | b64enc }}

View File

@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: worker
labels:
app: worker
spec:
replicas: {{ .Values.worker.replicaCount }}
selector:
matchLabels:
app: worker
template:
metadata:
labels:
app: worker
spec:
containers:
- name: worker
image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag }}"
imagePullPolicy: {{ .Values.worker.image.pullPolicy }}
envFrom:
- configMapRef:
name: handheld-devices-config
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: handheld-devices-secrets
key: db-password
resources:
{{- toYaml .Values.worker.resources | nindent 12 }}