add k8s manifests

This commit is contained in:
Gerrit Gogel 2023-12-05 14:20:40 +01:00
parent 909917d234
commit cc8982315f
18 changed files with 606 additions and 0 deletions

View file

@ -0,0 +1,109 @@
version: '3.8'
services:
seafile-server:
image: ggogel/seafile-server:11.0.2
volumes:
- seafile-data:/shared
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=db_dev
- TIME_ZONE=Europe/Berlin
- HTTPS=true
- SEAFILE_URL=seafile.mydomain.com # Mandatory on first deployment!
depends_on:
- db
- memcached
- seafile-caddy
networks:
- seafile-net
expose:
- 8001
- 8080
- 8082
- 8083
labels:
kompose.volume.size: 1Gi
kompose.service.expose.storage-class-name: default
seahub:
image: ggogel/seahub:11.0.2
volumes:
- seafile-data:/shared
- seahub-avatars:/shared/seafile/seahub-data/avatars
- seahub-custom:/shared/seafile/seahub-data/custom
environment:
- SEAFILE_ADMIN_EMAIL=me@example.com
- SEAFILE_ADMIN_PASSWORD=asecret
depends_on:
- seafile-server
- seafile-caddy
- seahub-media
networks:
- seafile-net
expose:
- 8000
seahub-media:
image: ggogel/seahub-media:11.0.2
volumes:
- seahub-avatars:/usr/share/caddy/media/avatars
- seahub-custom:/usr/share/caddy/media/custom
depends_on:
- seafile-caddy
networks:
- seafile-net
expose:
- 80
labels:
kompose.volume.size: 100Mi
kompose.service.expose.storage-class-name: default
db:
image: mariadb:10.11.6
environment:
- MYSQL_ROOT_PASSWORD=db_dev
- MYSQL_LOG_CONSOLE=true
- MARIADB_AUTO_UPGRADE=true
volumes:
- seafile-mariadb:/var/lib/mysql
networks:
- seafile-net
expose:
- 3306
labels:
kompose.volume.size: 1Gi
kompose.service.expose.storage-class-name: default
memcached:
image: memcached:1.6.22
entrypoint: memcached -m 1024
networks:
- seafile-net
expose:
- 11211
seafile-caddy:
image: ggogel/seafile-caddy:2.7.5
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:
seafile-net:
internal: true
volumes:
seafile-data:
seafile-mariadb:
seahub-avatars:
seahub-custom:

50
k8s/db-deployment.yaml Normal file
View file

@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.service.expose.storage-class-name: default
kompose.volume.size: 1Gi
creationTimestamp: null
labels:
io.kompose.service: db
name: db
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: db
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.service.expose.storage-class-name: default
kompose.volume.size: 1Gi
creationTimestamp: null
labels:
io.kompose.network/compose-seafile-net: "true"
io.kompose.service: db
spec:
containers:
- env:
- name: MARIADB_AUTO_UPGRADE
value: "true"
- name: MYSQL_LOG_CONSOLE
value: "true"
- name: MYSQL_ROOT_PASSWORD
value: db_dev
image: mariadb:10.11.6
name: db
ports:
- containerPort: 3306
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /var/lib/mysql
name: seafile-mariadb
restartPolicy: Always
volumes:
- name: seafile-mariadb
persistentVolumeClaim:
claimName: seafile-mariadb
status: {}

19
k8s/db-service.yaml Normal file
View file

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.service.expose.storage-class-name: default
kompose.volume.size: 1Gi
creationTimestamp: null
labels:
io.kompose.service: db
name: db
spec:
ports:
- name: "3306"
port: 3306
targetPort: 3306
selector:
io.kompose.service: db
status:
loadBalancer: {}

View file

@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
io.kompose.service: memcached
name: memcached
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: memcached
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
io.kompose.network/compose-seafile-net: "true"
io.kompose.service: memcached
spec:
containers:
- command:
- memcached
- -m
- "1024"
image: memcached:1.6.22
name: memcached
ports:
- containerPort: 11211
protocol: TCP
resources: {}
restartPolicy: Always
status: {}

View file

@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: memcached
name: memcached
spec:
ports:
- name: "11211"
port: 11211
targetPort: 11211
selector:
io.kompose.service: memcached
status:
loadBalancer: {}

View file

@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
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"
creationTimestamp: null
labels:
io.kompose.service: seafile-caddy
name: seafile-caddy
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: seafile-caddy
strategy: {}
template:
metadata:
annotations:
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"
creationTimestamp: null
labels:
io.kompose.network/compose-default: "true"
io.kompose.network/compose-seafile-net: "true"
io.kompose.service: seafile-caddy
spec:
containers:
- image: ggogel/seafile-caddy:2.7.5
name: seafile-caddy
ports:
- containerPort: 80
protocol: TCP
resources: {}
restartPolicy: Always
status: {}

View file

@ -0,0 +1,30 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
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"
creationTimestamp: null
labels:
io.kompose.service: seafile-caddy
name: seafile-caddy
spec:
ingressClassName: nginx
rules:
- host: localhost
http:
paths:
- backend:
service:
name: seafile-caddy
port:
number: 80
path: /
pathType: Prefix
status:
loadBalancer: {}

View file

@ -0,0 +1,24 @@
apiVersion: v1
kind: Service
metadata:
annotations:
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"
creationTimestamp: null
labels:
io.kompose.service: seafile-caddy
name: seafile-caddy
spec:
ports:
- name: "80"
port: 80
targetPort: 80
selector:
io.kompose.service: seafile-caddy
status:
loadBalancer: {}

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: seafile-data
name: seafile-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: seafile-mariadb
name: seafile-mariadb
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}

View file

@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.service.expose.storage-class-name: default
kompose.volume.size: 1Gi
creationTimestamp: null
labels:
io.kompose.service: seafile-server
name: seafile-server
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: seafile-server
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.service.expose.storage-class-name: default
kompose.volume.size: 1Gi
creationTimestamp: null
labels:
io.kompose.network/compose-seafile-net: "true"
io.kompose.service: seafile-server
spec:
containers:
- env:
- name: DB_HOST
value: db
- name: DB_ROOT_PASSWD
value: db_dev
- name: HTTPS
value: "true"
- name: SEAFILE_URL
value: seafile.mydomain.com
- name: TIME_ZONE
value: Europe/Berlin
image: ggogel/seafile-server:11.0.2
name: seafile-server
ports:
- containerPort: 8001
protocol: TCP
- containerPort: 8080
protocol: TCP
- containerPort: 8082
protocol: TCP
- containerPort: 8083
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /shared
name: seafile-data
restartPolicy: Always
volumes:
- name: seafile-data
persistentVolumeClaim:
claimName: seafile-data
status: {}

View file

@ -0,0 +1,28 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.service.expose.storage-class-name: default
kompose.volume.size: 1Gi
creationTimestamp: null
labels:
io.kompose.service: seafile-server
name: seafile-server
spec:
ports:
- name: "8001"
port: 8001
targetPort: 8001
- name: "8080"
port: 8080
targetPort: 8080
- name: "8082"
port: 8082
targetPort: 8082
- name: "8083"
port: 8083
targetPort: 8083
selector:
io.kompose.service: seafile-server
status:
loadBalancer: {}

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: seahub-avatars
name: seahub-avatars
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: seahub-custom
name: seahub-custom
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

View file

@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
io.kompose.service: seahub
name: seahub
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: seahub
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
io.kompose.network/compose-seafile-net: "true"
io.kompose.service: seahub
spec:
containers:
- env:
- name: SEAFILE_ADMIN_EMAIL
value: me@example.com
- name: SEAFILE_ADMIN_PASSWORD
value: asecret
image: ggogel/seahub:11.0.2
name: seahub
ports:
- containerPort: 8000
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /shared
name: seafile-data
- mountPath: /shared/seafile/seahub-data/avatars
name: seahub-avatars
- mountPath: /shared/seafile/seahub-data/custom
name: seahub-custom
restartPolicy: Always
volumes:
- name: seafile-data
persistentVolumeClaim:
claimName: seafile-data
- name: seahub-avatars
persistentVolumeClaim:
claimName: seahub-avatars
- name: seahub-custom
persistentVolumeClaim:
claimName: seahub-custom
status: {}

View file

@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.service.expose.storage-class-name: default
kompose.volume.size: 100Mi
creationTimestamp: null
labels:
io.kompose.service: seahub-media
name: seahub-media
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: seahub-media
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.service.expose.storage-class-name: default
kompose.volume.size: 100Mi
creationTimestamp: null
labels:
io.kompose.network/compose-seafile-net: "true"
io.kompose.service: seahub-media
spec:
containers:
- image: ggogel/seahub-media:11.0.2
name: seahub-media
ports:
- containerPort: 80
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /usr/share/caddy/media/avatars
name: seahub-avatars
- mountPath: /usr/share/caddy/media/custom
name: seahub-custom
restartPolicy: Always
volumes:
- name: seahub-avatars
persistentVolumeClaim:
claimName: seahub-avatars
- name: seahub-custom
persistentVolumeClaim:
claimName: seahub-custom
status: {}

View file

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.service.expose.storage-class-name: default
kompose.volume.size: 100Mi
creationTimestamp: null
labels:
io.kompose.service: seahub-media
name: seahub-media
spec:
ports:
- name: "80"
port: 80
targetPort: 80
selector:
io.kompose.service: seahub-media
status:
loadBalancer: {}

16
k8s/seahub-service.yaml Normal file
View file

@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
io.kompose.service: seahub
name: seahub
spec:
ports:
- name: "8000"
port: 8000
targetPort: 8000
selector:
io.kompose.service: seahub
status:
loadBalancer: {}