gisaf-backend/deployment/kubernetes/gisaf.yaml

207 lines
4.1 KiB
YAML
Raw Normal View History

2024-12-19 05:25:20 +01:00
apiVersion: v1
kind: Service
metadata:
2024-12-20 03:27:45 +01:00
name: gisaf-database
2024-12-19 05:25:20 +01:00
labels:
2024-12-20 03:27:45 +01:00
app: gisaf-database
2024-12-19 05:25:20 +01:00
spec:
ports:
2024-12-20 03:27:45 +01:00
- name: psql
port: 5432
- name: redis
port: 6379
2024-12-19 05:25:20 +01:00
selector:
2024-12-20 03:27:45 +01:00
app: gisaf-database
2024-12-19 05:25:20 +01:00
---
apiVersion: v1
kind: Pod
metadata:
2024-12-20 03:27:45 +01:00
name: gisaf-database
2024-12-19 05:25:20 +01:00
annotations:
io.kubernetes.cri-o.SandboxID/gisaf-database: gisaf-cri-o
io.kubernetes.cri-o.SandboxID/gisaf-redis: gisaf-cri-o
io.podman.annotations.infra.name: gisaf-infra
labels:
2024-12-20 03:27:45 +01:00
app: gisaf-database
2024-12-19 05:25:20 +01:00
spec:
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "gisaf-redis"
- "gisaf-database"
containers:
- name: gisaf-database
image: code.philo.ydns.eu/philorg/gisaf-database:latest
args:
- postgres
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: gisaf-pgdata
ports:
2024-12-20 03:27:45 +01:00
- containerPort: 5432
name: psql
2024-12-19 05:25:20 +01:00
- image: docker.io/library/redis:alpine
name: gisaf-redis
args:
- redis-server
volumeMounts:
- mountPath: /data
name: gisaf-redis
ports:
2024-12-20 03:27:45 +01:00
- containerPort: 6379
name: redis
2024-12-19 05:25:20 +01:00
volumes:
- name: gisaf-pgdata
persistentVolumeClaim:
claimName: gisaf-pgdata-pvc
- name: gisaf-redis
persistentVolumeClaim:
claimName: gisaf-redis-pvc
2024-12-20 03:27:45 +01:00
2024-12-19 05:25:20 +01:00
---
2024-12-20 03:27:45 +01:00
apiVersion: v1
kind: Service
metadata:
name: gisaf-server
labels:
app: gisaf-server
spec:
ports:
- port: 80
targetPort: 80
#nodePort: 30080
selector:
app: gisaf-server
#type: NodePort
2024-12-19 05:25:20 +01:00
---
apiVersion: v1
kind: Pod
metadata:
2024-12-20 03:27:45 +01:00
name: gisaf-server
2024-12-19 05:25:20 +01:00
annotations:
io.kubernetes.cri-o.SandboxID/gisaf-backend: gisaf-cri-o
io.kubernetes.cri-o.SandboxID/gisaf-frontend: gisaf-cri-o
io.podman.annotations.infra.name: gisaf-infra
labels:
2024-12-20 03:27:45 +01:00
app: gisaf-server
2024-12-19 05:25:20 +01:00
spec:
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "gisaf-frontend"
- "gisaf-backend"
2024-12-20 03:27:45 +01:00
initContainers:
2024-12-19 05:25:20 +01:00
- name: gisaf-backend-initdb
image: code.philo.ydns.eu/philorg/gisaf-backend:latest
command: ["gisaf", "create-db"]
env:
- name: GISAF__DB__HOST
value: gisaf-database
2024-12-20 03:27:45 +01:00
containers:
2024-12-19 05:25:20 +01:00
- name: gisaf-backend
image: code.philo.ydns.eu/philorg/gisaf-backend:latest
env:
- name: GISAF__GISAF_LIVE__REDIS
2024-12-20 03:27:45 +01:00
value: redis://gisaf-database
2024-12-19 05:25:20 +01:00
- name: GISAF__DB__HOST
value: gisaf-database
- name: gisaf-frontend
image: code.philo.ydns.eu/philorg/gisaf-frontend:latest
args:
- nginx
- -g
- daemon off;
ports:
- containerPort: 80
hostPort: 8899
2024-12-20 03:27:45 +01:00
2024-12-19 05:25:20 +01:00
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: gisaf-pgdata-pv
labels:
type: local
app: gisaf-postgres
spec:
storageClassName: manual
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
hostPath:
path: /data/gisaf-postgresql
2024-12-20 03:27:45 +01:00
2024-12-19 05:25:20 +01:00
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: gisaf-redis-pv
labels:
type: local
app: gisaf-redis
spec:
storageClassName: manual
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
hostPath:
path: /data/gisaf-redis
2024-12-20 03:27:45 +01:00
2024-12-19 05:25:20 +01:00
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gisaf-pgdata-pvc
spec:
storageClassName: manual
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
2024-12-20 03:27:45 +01:00
2024-12-19 05:25:20 +01:00
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gisaf-redis-pvc
spec:
storageClassName: manual
accessModes:
- ReadWriteMany
resources:
requests:
storage: 200Mi
2024-12-20 03:27:45 +01:00
2024-12-19 05:25:20 +01:00
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gisaf
namespace: default
#annotations:
# kubernetes.io/ingress.class: traefik
# #traefik.ingress.kubernetes.io/router.middlewares: default-strip-prefix@kubernetescrd
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
2024-12-20 03:27:45 +01:00
name: gisaf-server
2024-12-19 05:25:20 +01:00
port:
number: 80
- path: /api
pathType: Prefix
backend:
service:
2024-12-20 03:27:45 +01:00
name: gisaf-server
2024-12-19 05:25:20 +01:00
port:
number: 8081