|
Last change
on this file was 52fee06, checked in by Andrej <asumanovski@…>, 2 weeks ago |
|
Complete Kubernetes manifests with ConfigMap, Secrets, StatefulSet, Ingress
- namespace.yaml: trekr namespace
- configmaps.yaml: backend non-secret config (DB URL, Hibernate settings)
- postgres.yaml: StatefulSet + PVC + ClusterIP Service, init SQL from ConfigMap
- backend.yaml: Deployment with ConfigMap + Secrets refs, ClusterIP Service
- frontend.yaml: Deployment + ClusterIP Service
- ingress.yaml: nginx Ingress routing trekr.local → frontend
- deploy-local.sh: one-shot local demo script for Docker Desktop Kubernetes
|
-
Property mode
set to
100644
|
|
File size:
1.5 KB
|
| Line | |
|---|
| 1 | apiVersion: apps/v1
|
|---|
| 2 | kind: Deployment
|
|---|
| 3 | metadata:
|
|---|
| 4 | name: backend
|
|---|
| 5 | namespace: trekr
|
|---|
| 6 | spec:
|
|---|
| 7 | replicas: 1
|
|---|
| 8 | selector:
|
|---|
| 9 | matchLabels:
|
|---|
| 10 | app: backend
|
|---|
| 11 | template:
|
|---|
| 12 | metadata:
|
|---|
| 13 | labels:
|
|---|
| 14 | app: backend
|
|---|
| 15 | spec:
|
|---|
| 16 | initContainers:
|
|---|
| 17 | - name: wait-for-postgres
|
|---|
| 18 | image: postgres:16-alpine
|
|---|
| 19 | command: [sh, -c, until pg_isready -h postgres -p 5432 -U trekr; do sleep 2; done]
|
|---|
| 20 | containers:
|
|---|
| 21 | - name: backend
|
|---|
| 22 | image: DOCKERHUB_USERNAME/trekr-backend:latest
|
|---|
| 23 | envFrom:
|
|---|
| 24 | - configMapRef:
|
|---|
| 25 | name: backend-config
|
|---|
| 26 | env:
|
|---|
| 27 | - name: SPRING_DATASOURCE_PASSWORD
|
|---|
| 28 | valueFrom:
|
|---|
| 29 | secretKeyRef:
|
|---|
| 30 | name: trekr-secrets
|
|---|
| 31 | key: db-password
|
|---|
| 32 | - name: JWT_SECRET
|
|---|
| 33 | valueFrom:
|
|---|
| 34 | secretKeyRef:
|
|---|
| 35 | name: trekr-secrets
|
|---|
| 36 | key: jwt-secret
|
|---|
| 37 | ports:
|
|---|
| 38 | - containerPort: 8080
|
|---|
| 39 | readinessProbe:
|
|---|
| 40 | httpGet:
|
|---|
| 41 | path: /api/auth/ping
|
|---|
| 42 | port: 8080
|
|---|
| 43 | initialDelaySeconds: 20
|
|---|
| 44 | periodSeconds: 10
|
|---|
| 45 | failureThreshold: 6
|
|---|
| 46 | livenessProbe:
|
|---|
| 47 | httpGet:
|
|---|
| 48 | path: /api/auth/ping
|
|---|
| 49 | port: 8080
|
|---|
| 50 | initialDelaySeconds: 60
|
|---|
| 51 | periodSeconds: 15
|
|---|
| 52 | ---
|
|---|
| 53 | apiVersion: v1
|
|---|
| 54 | kind: Service
|
|---|
| 55 | metadata:
|
|---|
| 56 | name: backend
|
|---|
| 57 | namespace: trekr
|
|---|
| 58 | spec:
|
|---|
| 59 | selector:
|
|---|
| 60 | app: backend
|
|---|
| 61 | ports:
|
|---|
| 62 | - port: 8080
|
|---|
| 63 | targetPort: 8080
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.