diff --git a/manual/repo/k8s/ce/seafile-deployment.yaml b/manual/repo/k8s/ce/seafile-deployment.yaml index 7e50644d..fc8347d3 100644 --- a/manual/repo/k8s/ce/seafile-deployment.yaml +++ b/manual/repo/k8s/ce/seafile-deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: seafile + namespace: seafile spec: replicas: 1 selector: @@ -15,97 +16,11 @@ spec: containers: - 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: - name: seafile-env - key: TIME_ZONE - - name: SEAFILE_LOG_TO_STDOUT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_LOG_TO_STDOUT - - name: SITE_ROOT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SITE_ROOT - - name: ENABLE_SEADOC - valueFrom: - configMapKeyRef: - name: seafile-env - key: ENABLE_SEADOC - - name: SEADOC_SERVER_URL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEADOC_SERVER_URL - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_HOST - - name: DB_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_PORT - - name: DB_USER - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_USER - - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_CCNET_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - - name: INIT_SEAFILE_ADMIN_EMAIL - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_SEAFILE_ADMIN_EMAIL - - name: JWT_PRIVATE_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: JWT_PRIVATE_KEY - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: SEAFILE_MYSQL_DB_PASSWORD - - name: DB_ROOT_PASSWD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_MYSQL_ROOT_PASSWORD - - name: INIT_SEAFILE_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_ADMIN_PASSWORD + envFrom: + - configMapRef: + name: seafile-env + - secretRef: + name: seafile-secret volumeMounts: - name: seafile-data mountPath: /shared diff --git a/manual/repo/k8s/ce/seafile-env.yaml b/manual/repo/k8s/ce/seafile-env.yaml index 70d8c560..200bb05d 100644 --- a/manual/repo/k8s/ce/seafile-env.yaml +++ b/manual/repo/k8s/ce/seafile-env.yaml @@ -2,10 +2,11 @@ apiVersion: v1 kind: ConfigMap metadata: name: seafile-env + namespace: seafile data: # for Seafile server TIME_ZONE: "UTC" - SEAFILE_LOG_TO_STDOUT: "false" + SEAFILE_LOG_TO_STDOUT: "true" SITE_ROOT: "/" ENABLE_SEADOC: "false" SEADOC_SERVER_URL: "https://seafile.example.com/sdoc-server" # only valid in ENABLE_SEADOC = true @@ -14,9 +15,9 @@ data: # for database - SEAFILE_MYSQL_DB_HOST: "" - SEAFILE_MYSQL_DB_PORT: "3306" - SEAFILE_MYSQL_DB_USER: "seafile" + DB_HOST: "" + DB_PORT: "3306" + DB_USER: "seafile" SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db" SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db" SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db" diff --git a/manual/repo/k8s/ce/seafile-persistentvolumeclaim.yaml b/manual/repo/k8s/ce/seafile-persistentvolumeclaim.yaml index 28d26c02..06289246 100644 --- a/manual/repo/k8s/ce/seafile-persistentvolumeclaim.yaml +++ b/manual/repo/k8s/ce/seafile-persistentvolumeclaim.yaml @@ -2,9 +2,12 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: seafile-data + namespace: seafile spec: accessModes: - ReadWriteOnce resources: requests: - storage: 10Gi \ No newline at end of file + storage: 10Gi + # if you would like to use PV bound from a storage class, please uncomment the following line + # storageClassName: \ No newline at end of file diff --git a/manual/repo/k8s/ce/seafile-secret.yaml b/manual/repo/k8s/ce/seafile-secret.yaml deleted file mode 100644 index 8e949391..00000000 --- a/manual/repo/k8s/ce/seafile-secret.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: seafile-secret -type: Opaque -data: - # for Seafile server - JWT_PRIVATE_KEY: "" - - # for database - SEAFILE_MYSQL_DB_PASSWORD: "" - - # Initialization - ## for seafile - INIT_SEAFILE_ADMIN_PASSWORD: "" - - ## for db - INIT_SEAFILE_MYSQL_ROOT_PASSWORD: "" \ No newline at end of file diff --git a/manual/repo/k8s/ce/seafile-service.yaml b/manual/repo/k8s/ce/seafile-service.yaml index 9c5997ba..1e0695c6 100644 --- a/manual/repo/k8s/ce/seafile-service.yaml +++ b/manual/repo/k8s/ce/seafile-service.yaml @@ -2,12 +2,12 @@ apiVersion: v1 kind: Service metadata: name: seafile + namespace: seafile spec: selector: app: seafile - type: LoadBalancer + type: ClusterIP ports: - protocol: TCP port: 80 - targetPort: 80 - nodePort: 30000 \ No newline at end of file + targetPort: 80 \ No newline at end of file diff --git a/manual/repo/k8s/cluster/seafile-backend-deployment.yaml b/manual/repo/k8s/cluster/seafile-backend-deployment.yaml index ff5d6a33..edd90a96 100644 --- a/manual/repo/k8s/cluster/seafile-backend-deployment.yaml +++ b/manual/repo/k8s/cluster/seafile-backend-deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: seafile-backend + namespace: seafile spec: replicas: 1 selector: @@ -27,156 +28,11 @@ 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: - name: seafile-env - key: TIME_ZONE - - name: SEAFILE_LOG_TO_STDOUT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_LOG_TO_STDOUT - - name: SITE_ROOT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SITE_ROOT - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_HOST - - name: DB_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_PORT - - name: DB_USER - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_USER - - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_CCNET_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - - name: CLUSTER_INIT_MODE - valueFrom: - configMapKeyRef: - name: seafile-env - key: CLUSTER_INIT_MODE - - name: CLUSTER_INIT_MEMCACHED_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: CLUSTER_INIT_MEMCACHED_HOST - - name: CLUSTER_INIT_ES_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: CLUSTER_INIT_ES_HOST - - name: CLUSTER_INIT_ES_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: CLUSTER_INIT_ES_PORT - - name: INIT_S3_STORAGE_BACKEND_CONFIG - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_STORAGE_BACKEND_CONFIG - - name: INIT_S3_COMMIT_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_COMMIT_BUCKET - - name: INIT_S3_FS_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_FS_BUCKET - - name: INIT_S3_BLOCK_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_BLOCK_BUCKET - - name: INIT_S3_KEY_ID - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_KEY_ID - - name: INIT_S3_USE_V4_SIGNATURE - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_USE_V4_SIGNATURE - - name: INIT_S3_AWS_REGION - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_AWS_REGION - - name: INIT_S3_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_HOST - - name: INIT_S3_USE_HTTPS - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_USE_HTTPS - - name: INIT_SEAFILE_ADMIN_EMAIL - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_SEAFILE_ADMIN_EMAIL - - name: JWT_PRIVATE_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: JWT_PRIVATE_KEY - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: SEAFILE_MYSQL_DB_PASSWORD - - name: DB_ROOT_PASSWD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_MYSQL_ROOT_PASSWORD - - name: INIT_S3_SECRET_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_S3_SECRET_KEY - - name: INIT_SEAFILE_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_ADMIN_PASSWORD + envFrom: + - configMapRef: + name: seafile-env + - secretRef: + name: seafile-secret volumeMounts: - name: seafile-data mountPath: /shared diff --git a/manual/repo/k8s/cluster/seafile-env.yaml b/manual/repo/k8s/cluster/seafile-env.yaml index f1c5be6f..6a25a724 100644 --- a/manual/repo/k8s/cluster/seafile-env.yaml +++ b/manual/repo/k8s/cluster/seafile-env.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: seafile-env + namespace: seafile data: # for Seafile server TIME_ZONE: "UTC" @@ -13,9 +14,9 @@ data: SEAFILE_SERVER_PROTOCOL: "http" # for database - SEAFILE_MYSQL_DB_HOST: "" - SEAFILE_MYSQL_DB_PORT: "3306" - SEAFILE_MYSQL_DB_USER: "seafile" + DB_HOST: "" + DB_PORT: "3306" + DB_USER: "seafile" SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db" SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db" SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db" diff --git a/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml b/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml index d1b3cc35..e5f8aeb5 100644 --- a/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml +++ b/manual/repo/k8s/cluster/seafile-frontend-deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: seafile-frontend + namespace: seafile spec: replicas: 2 # change to your frontend service number, i.e., N_f selector: @@ -27,81 +28,11 @@ 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: - name: seafile-env - key: TIME_ZONE - - name: SEAFILE_LOG_TO_STDOUT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_LOG_TO_STDOUT - - name: SITE_ROOT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SITE_ROOT - - name: ENABLE_SEADOC - valueFrom: - configMapKeyRef: - name: seafile-env - key: ENABLE_SEADOC - - name: SEADOC_SERVER_URL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEADOC_SERVER_URL - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_HOST - - name: DB_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_PORT - - name: DB_USER - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_USER - - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_CCNET_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - - name: JWT_PRIVATE_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: JWT_PRIVATE_KEY - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: SEAFILE_MYSQL_DB_PASSWORD + envFrom: + - configMapRef: + name: seafile-env + - secretRef: + name: seafile-secret ports: - containerPort: 80 volumeMounts: diff --git a/manual/repo/k8s/cluster/seafile-persistentvolumeclaim.yaml b/manual/repo/k8s/cluster/seafile-persistentvolumeclaim.yaml index 28d26c02..06289246 100644 --- a/manual/repo/k8s/cluster/seafile-persistentvolumeclaim.yaml +++ b/manual/repo/k8s/cluster/seafile-persistentvolumeclaim.yaml @@ -2,9 +2,12 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: seafile-data + namespace: seafile spec: accessModes: - ReadWriteOnce resources: requests: - storage: 10Gi \ No newline at end of file + storage: 10Gi + # if you would like to use PV bound from a storage class, please uncomment the following line + # storageClassName: \ No newline at end of file diff --git a/manual/repo/k8s/cluster/seafile-secret.yaml b/manual/repo/k8s/cluster/seafile-secret.yaml deleted file mode 100644 index ef084e92..00000000 --- a/manual/repo/k8s/cluster/seafile-secret.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: seafile-secret -type: Opaque -data: - # for Seafile server - JWT_PRIVATE_KEY: "" - - # for database - SEAFILE_MYSQL_DB_PASSWORD: "" - - # Initialization - ## for Seafile admin - INIT_SEAFILE_ADMIN_PASSWORD: "" - - ## for db - INIT_SEAFILE_MYSQL_ROOT_PASSWORD: "" - - ## For S3 storage backend (only valid in INIT_S3_STORAGE_BACKEND_CONFIG = true) - INIT_S3_SECRET_KEY: "" \ No newline at end of file diff --git a/manual/repo/k8s/cluster/seafile-service.yaml b/manual/repo/k8s/cluster/seafile-service.yaml index f2accd22..4f48cc8e 100644 --- a/manual/repo/k8s/cluster/seafile-service.yaml +++ b/manual/repo/k8s/cluster/seafile-service.yaml @@ -2,12 +2,12 @@ apiVersion: v1 kind: Service metadata: name: seafile + namespace: seafile spec: selector: app: seafile-frontend - type: LoadBalancer + type: ClusterIP ports: - protocol: TCP port: 80 - targetPort: 80 - nodePort: 30000 \ No newline at end of file + targetPort: 80 \ No newline at end of file diff --git a/manual/repo/k8s/pro/seafile-deployment.yaml b/manual/repo/k8s/pro/seafile-deployment.yaml index 0edaea16..fc8347d3 100644 --- a/manual/repo/k8s/pro/seafile-deployment.yaml +++ b/manual/repo/k8s/pro/seafile-deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: seafile + namespace: seafile spec: replicas: 1 selector: @@ -15,147 +16,11 @@ spec: containers: - 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: - name: seafile-env - key: TIME_ZONE - - name: SEAFILE_LOG_TO_STDOUT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_LOG_TO_STDOUT - - name: SITE_ROOT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SITE_ROOT - - name: ENABLE_SEADOC - valueFrom: - configMapKeyRef: - name: seafile-env - key: ENABLE_SEADOC - - name: SEADOC_SERVER_URL - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEADOC_SERVER_URL - - name: DB_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_HOST - - name: DB_PORT - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_PORT - - name: DB_USER - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_USER - - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_CCNET_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME - - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - valueFrom: - configMapKeyRef: - name: seafile-env - key: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME - - name: INIT_S3_STORAGE_BACKEND_CONFIG - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_STORAGE_BACKEND_CONFIG - - name: INIT_S3_COMMIT_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_COMMIT_BUCKET - - name: INIT_S3_FS_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_FS_BUCKET - - name: INIT_S3_BLOCK_BUCKET - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_BLOCK_BUCKET - - name: INIT_S3_KEY_ID - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_KEY_ID - - name: INIT_S3_USE_V4_SIGNATURE - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_USE_V4_SIGNATURE - - name: INIT_S3_AWS_REGION - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_AWS_REGION - - name: INIT_S3_HOST - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_HOST - - name: INIT_S3_USE_HTTPS - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_S3_USE_HTTPS - - name: INIT_SEAFILE_ADMIN_EMAIL - valueFrom: - configMapKeyRef: - name: seafile-env - key: INIT_SEAFILE_ADMIN_EMAIL - - name: JWT_PRIVATE_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: JWT_PRIVATE_KEY - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: SEAFILE_MYSQL_DB_PASSWORD - - name: DB_ROOT_PASSWD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_MYSQL_ROOT_PASSWORD - - name: INIT_S3_SECRET_KEY - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_S3_SECRET_KEY - - name: INIT_SEAFILE_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: seafile-secret - key: INIT_SEAFILE_ADMIN_PASSWORD + envFrom: + - configMapRef: + name: seafile-env + - secretRef: + name: seafile-secret volumeMounts: - name: seafile-data mountPath: /shared diff --git a/manual/repo/k8s/pro/seafile-env.yaml b/manual/repo/k8s/pro/seafile-env.yaml index 9cf8644b..e06dd32b 100644 --- a/manual/repo/k8s/pro/seafile-env.yaml +++ b/manual/repo/k8s/pro/seafile-env.yaml @@ -2,10 +2,11 @@ apiVersion: v1 kind: ConfigMap metadata: name: seafile-env + namespace: seafile data: # for Seafile server TIME_ZONE: "UTC" - SEAFILE_LOG_TO_STDOUT: "false" + SEAFILE_LOG_TO_STDOUT: "true" SITE_ROOT: "/" ENABLE_SEADOC: "false" SEADOC_SERVER_URL: "https://seafile.example.com/sdoc-server" # only valid in ENABLE_SEADOC = true @@ -14,9 +15,9 @@ data: # for database - SEAFILE_MYSQL_DB_HOST: "" - SEAFILE_MYSQL_DB_PORT: "3306" - SEAFILE_MYSQL_DB_USER: "seafile" + DB_HOST: "" + DB_PORT: "3306" + DB_USER: "seafile" SEAFILE_MYSQL_DB_CCNET_DB_NAME: "ccnet_db" SEAFILE_MYSQL_DB_SEAFILE_DB_NAME: "seafile_db" SEAFILE_MYSQL_DB_SEAHUB_DB_NAME: "seahub_db" diff --git a/manual/repo/k8s/pro/seafile-persistentvolumeclaim.yaml b/manual/repo/k8s/pro/seafile-persistentvolumeclaim.yaml index 28d26c02..06289246 100644 --- a/manual/repo/k8s/pro/seafile-persistentvolumeclaim.yaml +++ b/manual/repo/k8s/pro/seafile-persistentvolumeclaim.yaml @@ -2,9 +2,12 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: seafile-data + namespace: seafile spec: accessModes: - ReadWriteOnce resources: requests: - storage: 10Gi \ No newline at end of file + storage: 10Gi + # if you would like to use PV bound from a storage class, please uncomment the following line + # storageClassName: \ No newline at end of file diff --git a/manual/repo/k8s/pro/seafile-secret.yaml b/manual/repo/k8s/pro/seafile-secret.yaml deleted file mode 100644 index 38124c70..00000000 --- a/manual/repo/k8s/pro/seafile-secret.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: seafile-secret -type: Opaque -data: - # for Seafile server - JWT_PRIVATE_KEY: "" - - # for database - SEAFILE_MYSQL_DB_PASSWORD: "" - - # Initialization - ## for seafile - INIT_SEAFILE_ADMIN_PASSWORD: "" - - ## for db - INIT_SEAFILE_MYSQL_ROOT_PASSWORD: "" - - ## For S3 storage backend (only valid in INIT_S3_STORAGE_BACKEND_CONFIG = true) - INIT_S3_SECRET_KEY: "" \ No newline at end of file diff --git a/manual/repo/k8s/pro/seafile-service.yaml b/manual/repo/k8s/pro/seafile-service.yaml index 9c5997ba..1e0695c6 100644 --- a/manual/repo/k8s/pro/seafile-service.yaml +++ b/manual/repo/k8s/pro/seafile-service.yaml @@ -2,12 +2,12 @@ apiVersion: v1 kind: Service metadata: name: seafile + namespace: seafile spec: selector: app: seafile - type: LoadBalancer + type: ClusterIP ports: - protocol: TCP port: 80 - targetPort: 80 - nodePort: 30000 \ No newline at end of file + targetPort: 80 \ No newline at end of file diff --git a/manual/setup/cluster_deploy_with_k8s.md b/manual/setup/cluster_deploy_with_k8s.md index 00528ef1..ae93f072 100644 --- a/manual/setup/cluster_deploy_with_k8s.md +++ b/manual/setup/cluster_deploy_with_k8s.md @@ -20,6 +20,19 @@ After installation, you need to start the k8s control plane service on each node !!! tip Although we recommend installing the *k8s control plane tool* on each node, it does not mean that we will use each node as a control plane node, but it is a necessary tool to create or join a K8S cluster. For details, please refer to the above [link](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/) about **creating or joining into a cluster**. +## Create namespace and secretMap + +```sh +kubectl create ns seafile + +kubectl create secret generic seafile-secret --namespace seafile \ +--from-literal=JWT_PRIVATE_KEY='' \ +--from-literal=DB_PASSWORD='' \ +--from-literal=DB_ROOT_PASSWD='' \ +--from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ +--from-literal=INIT_S3_SECRET_KEY='' +``` + ## Download K8S YAML files for Seafile cluster (without frontend node) ```sh @@ -43,7 +56,14 @@ In here we suppose you download the YAML files in `/opt/seafile-k8s-yaml`, which For futher configuration details, you can refer [the official documents](https://kubernetes.io/docs/tasks/configure-pod-container/). -## Modify `seafile-env.yaml` and `seafile-secret.yaml` +!!! tip "Use PV bound from a storage class" + If you would like to use automatically allocated persistent volume (PV) by a storage class, please modify `seafile-persistentvolumeclaim.yaml` and specify `storageClassName`. On the other hand, the PV defined by `seafile-persistentvolume.yaml` can be disabled: + + ```sh + rm /opt/seafile-k8s-yaml/seafile-persistentvolume.yaml + ``` + +## Modify `seafile-env.yaml` Similar to Docker-base deployment, Seafile cluster in K8S deployment also supports use files to configure startup progress, you can modify common [environment variables](./setup_pro_by_docker.md#downloading-and-modifying-env) by @@ -51,22 +71,6 @@ Similar to Docker-base deployment, Seafile cluster in K8S deployment also suppor nano /opt/seafile-k8s-yaml/seafile-env.yaml ``` -and sensitive information (e.g., password) by - -```sh -nano /opt/seafile-k8s-yaml/seafile-secret.yaml -``` - -!!! note "For `seafile-secret.yaml`" - To modify sensitive information (e.g., password), you need to convert the password into base64 encoding before writing it into the `seafile-secret.yaml` file: - - ```sh - echo -n '' | base64 - ``` - -!!! warning - For the fields marked with `<...>` are **required**, please make sure these items are filled in, otherwise Seafile server may not run properly. - ## Initialize Seafile cluster You can use following command to initialize Seafile cluster now (the Seafile's K8S resources will be specified in namespace `seafile` for easier management): @@ -138,7 +142,11 @@ Finally you can use the `tar -zcvf` and `tar -zxvf` commands to package the enti wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/cluster/seafile-frontend-deployment.yaml ``` -2. Modify `seafile-env.yaml`, and set `CLUSTER_INIT_MODE` to `false` (i.e., disable initialization mode) +2. Modify `seafile-env.yaml`, and set `CLUSTER_INIT_MODE` to `false` (i.e., disable initialization mode), then re-apply `seafile-env.yaml` again: + + ```sh + kubectl apply -f /opt/seafile-k8s-yaml + ``` 3. Run the following command to restart pods to restart Seafile cluster: diff --git a/manual/setup/helm_chart_cluster.md b/manual/setup/helm_chart_cluster.md index a38bea09..6256ec76 100644 --- a/manual/setup/helm_chart_cluster.md +++ b/manual/setup/helm_chart_cluster.md @@ -33,9 +33,9 @@ After installation, you need to start the k8s control plane service on each node ```sh kubectl create secret generic seafile-secret --namespace seafile \ --from-literal=JWT_PRIVATE_KEY='' \ - --from-literal=SEAFILE_MYSQL_DB_PASSWORD='' \ + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ - --from-literal=INIT_SEAFILE_MYSQL_ROOT_PASSWORD='' \ --from-literal=INIT_S3_SECRET_KEY='' ``` @@ -44,7 +44,7 @@ After installation, you need to start the k8s control plane service on each node 3. Download and modify the `my-values.yaml` according to your configurations. By the way, you can follow [here](./setup_pro_by_docker.md#downloading-and-modifying-env) for the details: ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/latest/cluster.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/12.0/cluster.yaml nano my-values.yaml ``` @@ -65,7 +65,7 @@ After installation, you need to start the k8s control plane service on each node ```sh helm repo add seafile https://haiwen.github.io/seafile-helm-chart/repo - helm upgrade --install seafile seafile/cluster --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/cluster --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` !!! success After installing the chart, the cluster is going to initial progress, you can see the following message by `kubectl logs seafile- -n seafile`: @@ -146,7 +146,7 @@ After installation, you need to start the k8s control plane service on each node 5. After the first-time startup, you have to turn off (i.e., set `initMode` to `false`) in your `my-values.yaml`, then upgrade the chart: ```sh - helm upgrade --install seafile seafile/cluster --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/cluster --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` !!! success @@ -286,7 +286,7 @@ After installation, you need to start the k8s control plane service on each node Finally you can upgrade your chart by: ```sh - helm upgrade --install seafile seafile/cluster --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/cluster --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` ## Version control @@ -305,7 +305,7 @@ Seafile Helm Chart is designed to provide fast deployment and version control. Y 2. Download (optional) and modify the new `my-values.yaml` ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//cluster.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//cluster.yaml nano my-values.yaml ``` diff --git a/manual/setup/helm_chart_single_node.md b/manual/setup/helm_chart_single_node.md index ef688215..c472bccf 100644 --- a/manual/setup/helm_chart_single_node.md +++ b/manual/setup/helm_chart_single_node.md @@ -27,21 +27,25 @@ Please refer [here](./system_requirements.md) for the details of system requirem === "Seafile Pro" ```sh + kubectl create ns seafile + kubectl create secret generic seafile-secret --namespace seafile \ --from-literal=JWT_PRIVATE_KEY='' \ - --from-literal=SEAFILE_MYSQL_DB_PASSWORD='' \ + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ - --from-literal=INIT_SEAFILE_MYSQL_ROOT_PASSWORD='' \ --from-literal=INIT_S3_SECRET_KEY='' ``` === "Seafile CE" ```sh + kubectl create ns seafile + kubectl create secret generic seafile-secret --namespace seafile \ --from-literal=JWT_PRIVATE_KEY='' \ - --from-literal=SEAFILE_MYSQL_DB_PASSWORD='' \ - --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ - --from-literal=INIT_SEAFILE_MYSQL_ROOT_PASSWORD='' + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ + --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' ``` where the `JWT_PRIVATE_KEY` can be generate by `pwgen -s 40 1` @@ -51,7 +55,7 @@ Please refer [here](./system_requirements.md) for the details of system requirem === "Seafile Pro" ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/latest/pro.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/12.0/pro.yaml nano my-values.yaml ``` @@ -59,7 +63,7 @@ Please refer [here](./system_requirements.md) for the details of system requirem === "Seafile CE" ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/latest/ce.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values/12.0/ce.yaml nano my-values.yaml ``` @@ -82,14 +86,14 @@ Please refer [here](./system_requirements.md) for the details of system requirem ```sh helm repo add seafile https://haiwen.github.io/seafile-helm-chart/repo - helm upgrade --install seafile seafile/pro --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/pro --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` === "Seafile CE" ```sh helm repo add seafile https://haiwen.github.io/seafile-helm-chart/repo - helm upgrade --install seafile seafile/ce --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/ce --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` After installing the chart, the Seafile pod should startup automaticlly. @@ -157,13 +161,13 @@ kubectl delete pods -n seafile $(kubectl get pods -n seafile -o jsonpath='{.item === "Seafile Pro" ```sh - helm upgrade --install seafile seafile/pro --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/pro --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` === "Seafile CE" ```sh - helm upgrade --install seafile seafile/ce --namespace seafile --create-namespace --values my-values.yaml + helm upgrade --install seafile seafile/ce --version 12.0 --namespace seafile --create-namespace --values my-values.yaml ``` ## Version control @@ -184,13 +188,13 @@ Seafile Helm Chart is designed to provide fast deployment and version control. Y === "Seafile Pro" ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//cluster.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//pro.yaml nano my-values.yaml ``` === "Seafile CE" ```sh - wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//cluster.yaml + wget -O my-values.yaml https://haiwen.github.io/seafile-helm-chart/values//ce.yaml nano my-values.yaml ``` diff --git a/manual/setup/k8s_advanced_management.md b/manual/setup/k8s_advanced_management.md index 01a03eea..0bb1c684 100644 --- a/manual/setup/k8s_advanced_management.md +++ b/manual/setup/k8s_advanced_management.md @@ -35,10 +35,10 @@ kubectl delete pods -n seafile $(kubectl get pods -n seafile -o jsonpath='{.item ## K8S Gateway and HTTPS -Since the Ingress feature [is no longer supported](https://kubernetes.io/docs/concepts/services-networking/ingress/) in the new version of K8S (even the commonly used *Nginx-Ingress* will not be deployed after 1.24), this article will introduce how to use the new version of K8S feature [*K8S Gateway*](https://kubernetes.io/docs/concepts/services-networking/gateway/) to implement Seafile service exposure and load balancing. +Since the support of Ingress feature [is frozen](https://kubernetes.io/docs/concepts/services-networking/ingress/) in the new version of K8S, this article will introduce how to use the new version of K8S feature [*K8S Gateway*](https://kubernetes.io/docs/concepts/services-networking/gateway/) to implement Seafile service exposure and load balancing. !!! tip "Still use *Nginx-Ingress*" - If your K8S is still running with an old version, and still using *Nginx-Ingress*, you can follow [here](https://artifacthub.io/packages/helm/datamate/seafile#deploy-an-ingress-controller-ingress-nginx) to setup ingress controller and HTTPS. We sincerely thanks *Datamate* to give an example to this configuration. + If your K8S is still using *Nginx-Ingress*, you can follow [here](https://artifacthub.io/packages/helm/datamate/seafile#deploy-an-ingress-controller-ingress-nginx) to setup ingress controller and HTTPS. We sincerely thanks *Datamate* to give an example to this configuration. For the details and features about ***K8S Gateway***, please refer to the K8S [official document](https://kubernetes.io/docs/concepts/services-networking/gateway/#design-principles), you can simpily install it by diff --git a/manual/setup/k8s_single_node.md b/manual/setup/k8s_single_node.md index 2a6a06c7..40b47671 100644 --- a/manual/setup/k8s_single_node.md +++ b/manual/setup/k8s_single_node.md @@ -14,6 +14,32 @@ For persisting data using in the docker-base deployment, `/opt/seafile-data`, is By the way, we don't provide the deployment methods of basic services (e.g., **Memcached**, **MySQL** and **Elasticsearch**) and seafile-compatibility components (e.g., **SeaDoc**) for K8S in our document. If you need to install these services in K8S format, ***you can refer to the rewrite method of this document.*** +## Create namespace and secretMap + +=== "Seafile Pro" + + ```sh + kubectl create ns seafile + + kubectl create secret generic seafile-secret --namespace seafile \ + --from-literal=JWT_PRIVATE_KEY='' \ + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ + --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' \ + --from-literal=INIT_S3_SECRET_KEY='' + ``` +=== "Seafile CE" + + ```sh + kubectl create ns seafile + + kubectl create secret generic seafile-secret --namespace seafile \ + --from-literal=JWT_PRIVATE_KEY='' \ + --from-literal=DB_PASSWORD='' \ + --from-literal=DB_ROOT_PASSWD='' \ + --from-literal=INIT_SEAFILE_ADMIN_PASSWORD='' + ``` + ## Down load the YAML files for Seafile Server === "Pro edition" @@ -26,7 +52,6 @@ By the way, we don't provide the deployment methods of basic services (e.g., **M wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/pro/seafile-persistentvolumeclaim.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/pro/seafile-service.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/pro/seafile-env.yaml - wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/pro/seafile-secret.yaml ``` === "Community edition" @@ -39,7 +64,6 @@ By the way, we don't provide the deployment methods of basic services (e.g., **M wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/ce/seafile-persistentvolumeclaim.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/ce/seafile-service.yaml wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/ce/seafile-env.yaml - wget -P /opt/seafile-k8s-yaml https://manual.seafile.com/12.0/repo/k8s/ce/seafile-secret.yaml ``` In here we suppose you download the YAML files in `/opt/seafile-k8s-yaml`, which mainly include about: @@ -49,9 +73,16 @@ In here we suppose you download the YAML files in `/opt/seafile-k8s-yaml`, which - `seafile-persistentVolume.yaml` for defining the location of a volume used for persistent storage on the host - `seafile-persistentvolumeclaim.yaml` for declaring the use of persistent storage in the container. +!!! tip "Use PV bound from a storage class" + If you would like to use automatically allocated persistent volume (PV) by a storage class, please modify `seafile-persistentvolumeclaim.yaml` and specify `storageClassName`. On the other hand, the PV defined by `seafile-persistentvolume.yaml` can be disabled: + + ```sh + rm /opt/seafile-k8s-yaml/seafile-persistentvolume.yaml + ``` + For futher configuration details, you can refer [the official documents](https://kubernetes.io/docs/tasks/configure-pod-container/). -## Modify `seafile-env.yaml` and `seafile-secret.yaml` +## Modify `seafile-env.yaml` Similar to Docker-base deployment, Seafile cluster in K8S deployment also supports use files to configure startup progress, you can modify common [environment variables](./setup_pro_by_docker.md#downloading-and-modifying-env) by @@ -59,19 +90,6 @@ Similar to Docker-base deployment, Seafile cluster in K8S deployment also suppor nano /opt/seafile-k8s-yaml/seafile-env.yaml ``` -and sensitive information (e.g., password) by - -```sh -nano /opt/seafile-k8s-yaml/seafile-secret.yaml -``` - -!!! note "For `seafile-secret.yaml`" - To modify sensitive information (e.g., password), you need to convert the password into base64 encoding before writing it into the `seafile-secret.yaml` file: - - ```sh - echo -n '' | base64 - ``` - !!! warning For the fields marked with `<...>` are **required**, please make sure these items are filled in, otherwise Seafile server may not run properly.