Skip to content

Commit

Permalink
Merge pull request #443 from haiwen/update_k8s
Browse files Browse the repository at this point in the history
fix & Opt: k8s & some environment variables
  • Loading branch information
freeplant authored Jan 18, 2025
2 parents b9c5c2c + b92916a commit a25ec0a
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 4 deletions.
5 changes: 2 additions & 3 deletions manual/config/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ NOTIFICATION_SERVER_VOLUME=/opt/notification-data

## Seafile-server configurations

- `SEAFILE_MYSQL_DB_PASSWORD`: The user `seafile` password of MySQL
- `JWT`: JWT_PRIVATE_KEY, A random string with a length of no less than 32 characters, generate example: `pwgen -s 40 1`
- `JWT_PRIVATE_KEY`: JWT_PRIVATE_KEY, A random string with a length of no less than 32 characters, generate example: `pwgen -s 40 1`
- `SEAFILE_SERVER_HOSTNAME`: Seafile server hostname or domain
- `SEAFILE_SERVER_PROTOCOL`: Seafile server protocol (http or https)
- `TIME_ZONE`: Time zone (default UTC)
- `TIME_ZONE`: Time zone (default `UTC`)
- `INIT_SEAFILE_ADMIN_EMAIL`: Admin username
- `INIT_SEAFILE_ADMIN_PASSWORD`: Admin password

Expand Down
2 changes: 2 additions & 0 deletions manual/repo/docker/cluster/seafile-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ services:
- CLUSTER_INIT_MEMCACHED_HOST=${CLUSTER_INIT_MEMCACHED_HOST:-}
- CLUSTER_INIT_ES_HOST=${CLUSTER_INIT_MEMCACHED_HOST:-}
- CLUSTER_INIT_ES_PORT=${CLUSTER_INIT_ES_PORT:-9200}
- SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
- SEAFILE_SERVER_PROTOCOL=${SEAFILE_SERVER_PROTOCOL:-http}
- CLUSTER_MODE=${CLUSTER_MODE:-frontend}
- TIME_ZONE=${TIME_ZONE:-UTC}
- INIT_SEAFILE_ADMIN_EMAIL=${INIT_SEAFILE_ADMIN_EMAIL:[email protected]}
Expand Down
10 changes: 10 additions & 0 deletions manual/repo/k8s/ce/seafile-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ spec:
- name: seafile
image: seafileltd/seafile-pro-mc:12.0-latest
env:
- name: SEAFILE_SERVER_HOSTNAME
valueFrom:
configMapKeyRef:
name: seafile-env
key: SEAFILE_SERVER_HOSTNAME
- name: SEAFILE_SERVER_PROTOCOL
valueFrom:
configMapKeyRef:
name: seafile-env
key: SEAFILE_SERVER_PROTOCOL
- name: TIME_ZONE
valueFrom:
configMapKeyRef:
Expand Down
1 change: 1 addition & 0 deletions manual/repo/k8s/ce/seafile-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data:
ENABLE_SEADOC: "false"
SEADOC_SERVER_URL: "https://seafile.example.com/sdoc-server" # only valid in ENABLE_SEADOC = true
SEAFILE_SERVER_HOSTNAME: "seafile.example.com"
SEAFILE_SERVER_PROTOCOL: "http"


# for database
Expand Down
10 changes: 10 additions & 0 deletions manual/repo/k8s/cluster/seafile-backend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ spec:
value: "true"
- name: CLUSTER_MODE
value: "backend"
- name: SEAFILE_SERVER_HOSTNAME
valueFrom:
configMapKeyRef:
name: seafile-env
key: SEAFILE_SERVER_HOSTNAME
- name: SEAFILE_SERVER_PROTOCOL
valueFrom:
configMapKeyRef:
name: seafile-env
key: SEAFILE_SERVER_PROTOCOL
- name: TIME_ZONE
valueFrom:
configMapKeyRef:
Expand Down
2 changes: 2 additions & 0 deletions manual/repo/k8s/cluster/seafile-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ data:
SITE_ROOT: "/"
ENABLE_SEADOC: "false"
SEADOC_SERVER_URL: "https://seafile.example.com/sdoc-server" # only valid in ENABLE_SEADOC = true
SEAFILE_SERVER_HOSTNAME: "seafile.example.com"
SEAFILE_SERVER_PROTOCOL: "http"

# for database
SEAFILE_MYSQL_DB_HOST: "<your MySQL host>"
Expand Down
10 changes: 10 additions & 0 deletions manual/repo/k8s/cluster/seafile-frontend-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ spec:
value: "true"
- name: CLUSTER_MODE
value: "frontend"
- name: SEAFILE_SERVER_HOSTNAME
valueFrom:
configMapKeyRef:
name: seafile-env
key: SEAFILE_SERVER_HOSTNAME
- name: SEAFILE_SERVER_PROTOCOL
valueFrom:
configMapKeyRef:
name: seafile-env
key: SEAFILE_SERVER_PROTOCOL
- name: TIME_ZONE
valueFrom:
configMapKeyRef:
Expand Down
10 changes: 10 additions & 0 deletions manual/repo/k8s/pro/seafile-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ spec:
- name: seafile
image: seafileltd/seafile-pro-mc:12.0-latest
env:
- name: SEAFILE_SERVER_HOSTNAME
valueFrom:
configMapKeyRef:
name: seafile-env
key: SEAFILE_SERVER_HOSTNAME
- name: SEAFILE_SERVER_PROTOCOL
valueFrom:
configMapKeyRef:
name: seafile-env
key: SEAFILE_SERVER_PROTOCOL
- name: TIME_ZONE
valueFrom:
configMapKeyRef:
Expand Down
1 change: 1 addition & 0 deletions manual/repo/k8s/pro/seafile-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data:
ENABLE_SEADOC: "false"
SEADOC_SERVER_URL: "https://seafile.example.com/sdoc-server" # only valid in ENABLE_SEADOC = true
SEAFILE_SERVER_HOSTNAME: "seafile.example.com"
SEAFILE_SERVER_PROTOCOL: "http"


# for database
Expand Down
7 changes: 7 additions & 0 deletions manual/setup/cluster_deploy_with_k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,10 @@ When deploying a Seafile cluster using K8S, you can enable HTTPS and use load ba
- External load balancing server, such as *Nginx*. Typically you will need to reverse proxy `http://<your control plane>/`
- K8S Gateway API, e.g., [Nginx-gateway](https://docs.nginx.com/nginx-gateway-fabric/installation/installing-ngf/manifests/) and [Istio-gateway](https://istio.io/latest/docs/tasks/traffic-management/ingress/gateway-api/)
Finally, you should modify the related URLs in `seahub_settings.py`, from `http://` to `https://`:
```py
SERVICE_URL = "https://seafile.example.com"
FILE_SERVER_ROOT = 'https://seafile.example.com/seafhttp'
```
2 changes: 1 addition & 1 deletion manual/setup/k8s_single_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ kubectl apply -f /opt/seafile-k8s-yaml/
- With different service name
- With different server port

Please modfiy the files in `/opt/seafile-data/seafile/conf` to make correct the configurations for above services, otherwise the Seafile server cannot start normally. Then restart Seafile server:
Please modfiy the files in `/opt/seafile-data/seafile/conf` (especially the `seafevents.conf`, `seafile.conf` and `seahub_settings.py`) to make correct the configurations for above services, otherwise the Seafile server cannot start normally. Then restart Seafile server:

```sh
kubectl delete -f /opt/seafile-k8s-yaml/
Expand Down
1 change: 1 addition & 0 deletions manual/upgrade/upgrade_notes_for_12.0.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ upgrade/upgrade_11.0_12.0.sh
conf/.env

```env
TIME_ZONE=UTC
JWT_PRIVATE_KEY=xxx
SEAFILE_SERVER_PROTOCOL=https
SEAFILE_SERVER_HOSTNAME=seafile.example.com
Expand Down

0 comments on commit a25ec0a

Please sign in to comment.