Skip to content

Instantly share code, notes, and snippets.

@lomocc
Last active November 24, 2021 18:51
Show Gist options
  • Save lomocc/3e13f3f0a57ce4f09f400a8fdd82162f to your computer and use it in GitHub Desktop.
Save lomocc/3e13f3f0a57ce4f09f400a8fdd82162f to your computer and use it in GitHub Desktop.
Seafile Kubernetes(Deployment, Service, Ingress)
docker run -t -i \
  -p 10001:10001 \
  -p 12001:12001 \
  -p 8000:8000 \
  -p 8080:8080 \
  -p 8082:8082 \
  -v /srv/seafile:/opt/seafile \
  jenserat/seafile -- /bin/bash
$ download-seafile
# Do not change the port and storage location defaults
$ /opt/seafile/seafile-server-*/setup-seafile.sh
# start the seafile controller process
$ /opt/seafile/seafile-server-latest/seafile.sh start
# configuring the web UI
$ /opt/seafile/seafile-server-latest/seahub.sh start
# 
$ exit
apiVersion: v1
kind: Namespace
metadata:
name: seafile
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: seafile
namespace: seafile
spec:
replicas: 1
template:
metadata:
labels:
app: seafile
spec:
containers:
- image: jenserat/seafile
name: seafile
ports:
- containerPort: 8000
- containerPort: 8082
env:
- name: autostart
value: "true"
volumeMounts:
- mountPath: /opt/seafile
name: seafile
volumes:
- name: seafile
hostPath:
path: /srv/seafile
---
apiVersion: v1
kind: Service
metadata:
name: seafile
namespace: seafile
spec:
ports:
- name: seahub
port: 8000
targetPort: 8000
- name: seafhttp
port: 8082
targetPort: 8082
selector:
app: seafile
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: seafile
namespace: seafile
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
spec:
rules:
- host: seafile.example.com
http:
paths:
- path: /
backend:
serviceName: seafile
servicePort: 8000
- path: /seafhttp
backend:
serviceName: seafile
servicePort: 8082
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment