203 lines
4.4 KiB
YAML
203 lines
4.4 KiB
YAML
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: schadenpm
|
|
labels:
|
|
istio-injection: enabled
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: schadenpm-config
|
|
namespace: schadenpm
|
|
data:
|
|
PORT: "8080"
|
|
DB_URL: jdbc:postgresql://schadenpm-postgres:5432/schadenpm
|
|
DB_USER: schadenpm
|
|
ADMIN_USER: admin
|
|
ADMIN_NAME: Administrator
|
|
DOCUMENT_DIR: /app/data/documents
|
|
OCR_LANG: deu+eng
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: schadenpm-documents
|
|
namespace: schadenpm
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: schadenpm-postgres
|
|
namespace: schadenpm
|
|
labels:
|
|
app: schadenpm-postgres
|
|
spec:
|
|
ports:
|
|
- name: postgres
|
|
port: 5432
|
|
targetPort: postgres
|
|
selector:
|
|
app: schadenpm-postgres
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: schadenpm-postgres
|
|
namespace: schadenpm
|
|
labels:
|
|
app: schadenpm-postgres
|
|
spec:
|
|
serviceName: schadenpm-postgres
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: schadenpm-postgres
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: schadenpm-postgres
|
|
spec:
|
|
containers:
|
|
- name: postgres
|
|
image: postgres:17
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- name: postgres
|
|
containerPort: 5432
|
|
env:
|
|
- name: POSTGRES_DB
|
|
value: schadenpm
|
|
- name: POSTGRES_USER
|
|
value: schadenpm
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: schadenpm-secrets
|
|
key: db-password
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- pg_isready
|
|
- -U
|
|
- schadenpm
|
|
- -d
|
|
- schadenpm
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- pg_isready
|
|
- -U
|
|
- schadenpm
|
|
- -d
|
|
- schadenpm
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 20
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /var/lib/postgresql/data
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 1Gi
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: data
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: schadenpm
|
|
namespace: schadenpm
|
|
labels:
|
|
app: schadenpm
|
|
spec:
|
|
ports:
|
|
- name: http
|
|
port: 8080
|
|
targetPort: http
|
|
selector:
|
|
app: schadenpm
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: schadenpm
|
|
namespace: schadenpm
|
|
labels:
|
|
app: schadenpm
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: schadenpm
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: schadenpm
|
|
spec:
|
|
containers:
|
|
- name: schadenpm
|
|
image: registry.example.local/schadenpm:1.1.35-budget-documents
|
|
imagePullPolicy: Never
|
|
ports:
|
|
- name: http
|
|
containerPort: 8080
|
|
envFrom:
|
|
- configMapRef:
|
|
name: schadenpm-config
|
|
env:
|
|
- name: DB_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: schadenpm-secrets
|
|
key: db-password
|
|
- name: ADMIN_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: schadenpm-secrets
|
|
key: admin-password
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /api/health
|
|
port: http
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /api/health
|
|
port: http
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 20
|
|
volumeMounts:
|
|
- name: documents
|
|
mountPath: /app/data/documents
|
|
resources:
|
|
requests:
|
|
cpu: 250m
|
|
memory: 512Mi
|
|
limits:
|
|
cpu: "2"
|
|
memory: 2Gi
|
|
volumes:
|
|
- name: documents
|
|
persistentVolumeClaim:
|
|
claimName: schadenpm-documents
|