update k8s files with restart policy and probes

This commit is contained in:
Gerrit Gogel 2024-02-14 11:37:13 +01:00
parent 723cc36980
commit 75f6ab4ad6
5 changed files with 51 additions and 26 deletions

View file

@ -1,3 +1,6 @@
# This is a compose file with additional fields for the tool kompose.
# Generate Kubernetes manifests with the following command:
# kompose convert --with-kompose-annotation=false -o k8s -f compose/docker-compose-kompose.yml
version: '3.8' version: '3.8'
services: services:
seafile-server: seafile-server:
@ -10,10 +13,6 @@ services:
- TIME_ZONE=Europe/Berlin - TIME_ZONE=Europe/Berlin
- HTTPS=true - HTTPS=true
- SEAFILE_URL=seafile.mydomain.com # Mandatory on first deployment! - SEAFILE_URL=seafile.mydomain.com # Mandatory on first deployment!
depends_on:
- db
- memcached
- seafile-caddy
networks: networks:
- seafile-net - seafile-net
expose: expose:
@ -24,6 +23,10 @@ services:
labels: labels:
kompose.volume.size: 1Gi kompose.volume.size: 1Gi
kompose.service.expose.storage-class-name: default kompose.service.expose.storage-class-name: default
kompose.service.healthcheck.readiness.tcp_port: 8082
kompose.service.healthcheck.readiness.interval: 10s
kompose.service.healthcheck.readiness.timeout: 10s
restart: always
seahub: seahub:
image: ggogel/seahub:11.0.4 image: ggogel/seahub:11.0.4
@ -34,22 +37,17 @@ services:
environment: environment:
- SEAFILE_ADMIN_EMAIL=me@example.com - SEAFILE_ADMIN_EMAIL=me@example.com
- SEAFILE_ADMIN_PASSWORD=asecret - SEAFILE_ADMIN_PASSWORD=asecret
depends_on:
- seafile-server
- seafile-caddy
- seahub-media
networks: networks:
- seafile-net - seafile-net
expose: expose:
- 8000 - 8000
restart: always
seahub-media: seahub-media:
image: ggogel/seahub-media:11.0.4 image: ggogel/seahub-media:11.0.4
volumes: volumes:
- seahub-avatars:/usr/share/caddy/media/avatars - seahub-avatars:/usr/share/caddy/media/avatars
- seahub-custom:/usr/share/caddy/media/custom - seahub-custom:/usr/share/caddy/media/custom
depends_on:
- seafile-caddy
networks: networks:
- seafile-net - seafile-net
expose: expose:
@ -57,6 +55,7 @@ services:
labels: labels:
kompose.volume.size: 100Mi kompose.volume.size: 100Mi
kompose.service.expose.storage-class-name: default kompose.service.expose.storage-class-name: default
restart: always
db: db:
image: mariadb:10.11.7 image: mariadb:10.11.7
@ -73,6 +72,11 @@ services:
labels: labels:
kompose.volume.size: 1Gi kompose.volume.size: 1Gi
kompose.service.expose.storage-class-name: default kompose.service.expose.storage-class-name: default
kompose.service.healthcheck.readiness.test: "healthcheck.sh --su-mysql --connect --innodb_initialized"
kompose.service.healthcheck.readiness.interval: 10s
kompose.service.healthcheck.readiness.timeout: 10s
kompose.service.healthcheck.readiness.retries: 3
restart: always
memcached: memcached:
image: memcached:1.6.23 image: memcached:1.6.23
@ -81,22 +85,7 @@ services:
- seafile-net - seafile-net
expose: expose:
- 11211 - 11211
restart: always
seafile-caddy:
image: ggogel/seafile-caddy:2.7.6
networks:
- seafile-net
- default
labels:
kompose.service.expose: localhost
kompose.service.expose.ingress-class-name: nginx
nginx.ingress.kubernetes.io/proxy-body-size: 0
nginx.ingress.kubernetes.io/proxy-connect-timeout: 36000
nginx.ingress.kubernetes.io/proxy-read-timeout: 36000
nginx.ingress.kubernetes.io/proxy-send-timeout: 36000
nginx.ingress.kubernetes.io/send-timeout: 36000
expose:
- 80
networks: networks:
seafile-net: seafile-net:

View file

@ -3,6 +3,10 @@ kind: Deployment
metadata: metadata:
annotations: annotations:
kompose.service.expose.storage-class-name: default kompose.service.expose.storage-class-name: default
kompose.service.healthcheck.readiness.interval: 10s
kompose.service.healthcheck.readiness.retries: "3"
kompose.service.healthcheck.readiness.test: healthcheck.sh --su-mysql --connect --innodb_initialized
kompose.service.healthcheck.readiness.timeout: 10s
kompose.volume.size: 1Gi kompose.volume.size: 1Gi
creationTimestamp: null creationTimestamp: null
labels: labels:
@ -19,6 +23,10 @@ spec:
metadata: metadata:
annotations: annotations:
kompose.service.expose.storage-class-name: default kompose.service.expose.storage-class-name: default
kompose.service.healthcheck.readiness.interval: 10s
kompose.service.healthcheck.readiness.retries: "3"
kompose.service.healthcheck.readiness.test: healthcheck.sh --su-mysql --connect --innodb_initialized
kompose.service.healthcheck.readiness.timeout: 10s
kompose.volume.size: 1Gi kompose.volume.size: 1Gi
creationTimestamp: null creationTimestamp: null
labels: labels:
@ -38,6 +46,16 @@ spec:
ports: ports:
- containerPort: 3306 - containerPort: 3306
protocol: TCP protocol: TCP
readinessProbe:
exec:
command:
- healthcheck.sh
- --su-mysql
- --connect
- --innodb_initialized
failureThreshold: 3
periodSeconds: 10
timeoutSeconds: 10
resources: {} resources: {}
volumeMounts: volumeMounts:
- mountPath: /var/lib/mysql - mountPath: /var/lib/mysql

View file

@ -3,6 +3,10 @@ kind: Service
metadata: metadata:
annotations: annotations:
kompose.service.expose.storage-class-name: default kompose.service.expose.storage-class-name: default
kompose.service.healthcheck.readiness.interval: 10s
kompose.service.healthcheck.readiness.retries: "3"
kompose.service.healthcheck.readiness.test: healthcheck.sh --su-mysql --connect --innodb_initialized
kompose.service.healthcheck.readiness.timeout: 10s
kompose.volume.size: 1Gi kompose.volume.size: 1Gi
creationTimestamp: null creationTimestamp: null
labels: labels:

View file

@ -3,6 +3,9 @@ kind: Deployment
metadata: metadata:
annotations: annotations:
kompose.service.expose.storage-class-name: default kompose.service.expose.storage-class-name: default
kompose.service.healthcheck.readiness.interval: 10s
kompose.service.healthcheck.readiness.tcp_port: "8082"
kompose.service.healthcheck.readiness.timeout: 10s
kompose.volume.size: 1Gi kompose.volume.size: 1Gi
creationTimestamp: null creationTimestamp: null
labels: labels:
@ -19,6 +22,9 @@ spec:
metadata: metadata:
annotations: annotations:
kompose.service.expose.storage-class-name: default kompose.service.expose.storage-class-name: default
kompose.service.healthcheck.readiness.interval: 10s
kompose.service.healthcheck.readiness.tcp_port: "8082"
kompose.service.healthcheck.readiness.timeout: 10s
kompose.volume.size: 1Gi kompose.volume.size: 1Gi
creationTimestamp: null creationTimestamp: null
labels: labels:
@ -48,6 +54,11 @@ spec:
protocol: TCP protocol: TCP
- containerPort: 8083 - containerPort: 8083
protocol: TCP protocol: TCP
readinessProbe:
periodSeconds: 10
tcpSocket:
port: 8082
timeoutSeconds: 10
resources: {} resources: {}
volumeMounts: volumeMounts:
- mountPath: /shared - mountPath: /shared

View file

@ -3,6 +3,9 @@ kind: Service
metadata: metadata:
annotations: annotations:
kompose.service.expose.storage-class-name: default kompose.service.expose.storage-class-name: default
kompose.service.healthcheck.readiness.interval: 10s
kompose.service.healthcheck.readiness.tcp_port: "8082"
kompose.service.healthcheck.readiness.timeout: 10s
kompose.volume.size: 1Gi kompose.volume.size: 1Gi
creationTimestamp: null creationTimestamp: null
labels: labels: