组件架构 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ┌─────────────────────────────────────────────────────────┐ │ Kubernetes 集群 │ │ (Namespace: seafile) │ ├─────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ │ │ Seafile │ │ MariaDB │ │ Memcached │ │ │ │ (主应用) │ │ (数据库) │ │ (缓存) │ │ │ │ │ │ │ │ │ │ │ │ NodePort: │ │ ClusterIP: │ │ ClusterIP: │ │ │ │ 30085 │ │ 3306 │ │ 11211 │ │ │ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │ │ │ │ │ │ │ └─────────────────┼─────────────────┘ │ │ │ │ │ ┌───────────────────────┴──────────────────────────┐ │ │ │ OnlyOffice DocumentServer │ │ │ │ (文档编辑服务) │ │ │ │ NodePort: 30081 │ │ │ └───────────────────────────────────────────────────┘ │ │ │ │ ┌───────────────────────────────────────────────────┐ │ │ │ 持久化存储 (Local Volume) │ │ │ │ /data/seafile/{seafile,mariadb,onlyoffice} │ │ │ └───────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────┘
技术栈
组件
镜像
版本
用途
Seafile
docker.io/seafileltd/seafile-mc
12.0-latest
文件同步与共享主应用
MariaDB
docker.io/library/mariadb
10.11
关系型数据库
Memcached
docker.io/library/memcached
1.6.29
缓存服务
OnlyOffice
docker.io/onlyoffice/documentserver
7.3.3
在线文档编辑服务
Busybox
10.2.12.4/seafilejingxiang/busybox
1.36
InitContainer 工具
部署节点
所有 Pod 运行在 : worker2 节点
存储位置 : /data/seafile/ (本地持久化存储)
访问方式 : NodePort (Seafile: 30085, OnlyOffice: 30081)
使用 Kustomize部署 优势 :
Kubernetes 原生工具,无需额外安装
统一管理所有资源
自动处理依赖顺序
支持命名空间统一管理
部署命令 :
1 2 3 4 5 6 7 8 kubectl apply -k manifests/ kubectl kustomize manifests/ kubectl apply -k manifests/ --dry-run=client
资源列表 (manifests/kustomization.yaml):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 resources: - namespace.yaml - secrets.yaml - configmap.yaml - storageclass.yaml - pv-seafile.yaml - pv-mariadb.yaml - pv-onlyoffice.yaml - pvc.yaml - mariadb-deployment.yaml - memcached-deployment.yaml - onlyoffice-deployment.yaml - seafile-deployment.yaml - services.yaml
环境变量配置(关键!) Seafile 容器环境变量 数据库连接变量 :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 env: - name: DB_HOST valueFrom: configMapKeyRef: name: seafile-config key: DB_HOST - name: DB_PORT valueFrom: configMapKeyRef: name: seafile-config key: DB_PORT - name: DB_USER valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-user - name: DB_PASSWORD valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-password - name: DB_ROOT_PASSWD valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-root-password - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME value: "ccnet_db" - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME value: "seafile_db" - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME value: "seahub_db"
服务器配置变量 :
1 2 3 4 5 6 7 8 9 10 11 12 - name: SEAFILE_SERVER_PROTOCOL valueFrom: configMapKeyRef: name: seafile-config key: SEAFILE_SERVER_PROTOCOL - name: SEAFILE_SERVER_HOSTNAME valueFrom: configMapKeyRef: name: seafile-config key: SEAFILE_SERVER_HOSTNAME
管理员初始化变量 :
1 2 3 4 5 6 7 8 9 10 11 - name: INIT_SEAFILE_ADMIN_EMAIL valueFrom: secretKeyRef: name: seafile-secrets key: seafile-admin-email - name: INIT_SEAFILE_ADMIN_PASSWORD valueFrom: secretKeyRef: name: seafile-secrets key: seafile-admin-password
其他重要变量 :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 - name: TIME_ZONE value: "Asia/Shanghai" - name: JWT_PRIVATE_KEY valueFrom: secretKeyRef: name: seafile-secrets key: jwt-private-key - name: MEMCACHED_HOST valueFrom: configMapKeyRef: name: seafile-config key: MEMCACHED_HOST - name: MEMCACHED_PORT valueFrom: configMapKeyRef: name: seafile-config key: MEMCACHED_PORT
InitContainer 配置 wait-for-mariadb 作用 : 确保 MariaDB 就绪后再启动 Seafile
1 2 3 4 5 6 7 8 9 10 11 12 initContainers: - name: wait-for-mariadb image: 10.2 .12 .4 /seafilejingxiang/busybox:1.36 command: - sh - -c - | until nc -z mariadb 3306; do echo "Waiting for MariaDB to be ready..." sleep 2 done echo "MariaDB is ready!"
作用 : 动态配置 OnlyOffice 集成和文件上传限制
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 - name: configure-onlyoffice image: 10.2 .12 .4 /seafilejingxiang/busybox:1.36 env: - name: ONLYOFFICE_APIJS_URL valueFrom: configMapKeyRef: name: seafile-config key: ONLYOFFICE_APIJS_URL - name: ONLYOFFICE_JWT_SECRET valueFrom: secretKeyRef: name: seafile-secrets key: onlyoffice-jwt-secret volumeMounts: - name: seafile-data mountPath: /shared command: - sh - -c - | # 等待配置目录创建 # 添加 OnlyOffice 配置到 seahub_settings.py # 添加文件上传大小限制 (100MB)
配置内容 :
OnlyOffice 集成配置(ENABLE_ONLYOFFICE, ONLYOFFICE_APIJS_URL 等)
文件上传大小限制(FILE_UPLOAD_MAX_SIZE = 104857600)
健康检查配置 Seafile 健康检查 :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 livenessProbe: tcpSocket: port: 80 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: tcpSocket: port: 80 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 6
为什么使用 TCP Socket?
Seafile-mc 镜像在初始化阶段可能返回 502 错误
TCP Socket 只检查端口是否开放,不检查 HTTP 状态码
更可靠地判断容器是否启动
滚动更新策略 1 2 3 4 5 6 7 spec: replicas: 1 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0
优势 :
零停机更新
支持 CI/CD 自动部署
失败时自动回滚
存储配置 持久化卷配置 :
Seafile : 8Gi, /data/seafile/seafile
MariaDB : 4Gi, /data/seafile/mariadb
OnlyOffice : 2Gi, /data/seafile/onlyoffice
存储类型 : Local Volume (本地存储)
部署前准备 :
1 2 3 mkdir -p /data/seafile/{seafile,mariadb,onlyoffice}chmod -R 777 /data/seafile
末尾展示配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 apiVersion: v1 kind: ConfigMap metadata: name: seafile-config namespace: seafile data: SEAFILE_SERVER_PROTOCOL: "http" SEAFILE_SERVER_HOSTNAME: "10.2.12.40:30085" SEAFILE_SERVER_PORT: "80" DB_HOST: "mariadb" DB_PORT: "3306" MEMCACHED_HOST: "memcached" MEMCACHED_PORT: "11211" ONLYOFFICE_HOST: "onlyoffice" ONLYOFFICE_PORT: "80" ONLYOFFICE_APIJS_URL: "http://10.2.12.40:30081/web-apps/apps/api/documents/api.js"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: seafile resources: - namespace.yaml - secrets.yaml - configmap.yaml - storageclass.yaml - pv-seafile.yaml - pv-mariadb.yaml - pv-onlyoffice.yaml - pvc.yaml - mariadb-deployment.yaml - memcached-deployment.yaml - onlyoffice-deployment.yaml - seafile-deployment.yaml - services.yaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 apiVersion: apps/v1 kind: Deployment metadata: name: mariadb namespace: seafile labels: app: mariadb spec: replicas: 1 selector: matchLabels: app: mariadb template: metadata: labels: app: mariadb spec: nodeSelector: kubernetes.io/hostname: worker2 containers: - name: mariadb image: docker.io/library/mariadb:10.11 imagePullPolicy: IfNotPresent ports: - containerPort: 3306 name: mysql env: - name: MYSQL_ROOT_PASSWORD valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-root-password - name: MYSQL_DATABASE valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-database - name: MYSQL_USER valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-user - name: MYSQL_PASSWORD valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-password volumeMounts: - name: mariadb-data mountPath: /var/lib/mysql resources: requests: cpu: "500m" memory: "512Mi" limits: cpu: "2000m" memory: "2Gi" livenessProbe: exec: command: - sh - -c - "mysqladmin ping -h localhost -u root -p$MYSQL_ROOT_PASSWORD" initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 readinessProbe: exec: command: - sh - -c - "mysqladmin ping -h localhost -u root -p$MYSQL_ROOT_PASSWORD" initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 3 volumes: - name: mariadb-data persistentVolumeClaim: claimName: mariadb-data-pvc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 apiVersion: apps/v1 kind: Deployment metadata: name: memcached namespace: seafile labels: app: memcached spec: replicas: 1 selector: matchLabels: app: memcached template: metadata: labels: app: memcached spec: nodeSelector: kubernetes.io/hostname: worker2 containers: - name: memcached image: docker.io/library/memcached:1.6.29 imagePullPolicy: IfNotPresent ports: - containerPort: 11211 name: memcached command: - memcached - -m - "512" resources: requests: cpu: "100m" memory: "128Mi" limits: cpu: "500m" memory: "512Mi" livenessProbe: tcpSocket: port: 11211 initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: tcpSocket: port: 11211 initialDelaySeconds: 5 periodSeconds: 5
1 2 3 4 5 6 apiVersion: v1 kind: Namespace metadata: name: seafile labels: name: seafile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 apiVersion: apps/v1 kind: Deployment metadata: name: onlyoffice namespace: seafile labels: app: onlyoffice spec: replicas: 1 selector: matchLabels: app: onlyoffice template: metadata: labels: app: onlyoffice spec: nodeSelector: kubernetes.io/hostname: worker2 containers: - name: onlyoffice image: docker.io/onlyoffice/documentserver:7.3.3 imagePullPolicy: IfNotPresent ports: - containerPort: 80 name: http env: - name: JWT_SECRET valueFrom: secretKeyRef: name: seafile-secrets key: onlyoffice-jwt-secret - name: JWT_ENABLED value: "true" volumeMounts: - name: onlyoffice-data mountPath: /var/log/onlyoffice - name: onlyoffice-data mountPath: /var/lib/onlyoffice resources: requests: cpu: "1000m" memory: "2Gi" limits: cpu: "2000m" memory: "4Gi" livenessProbe: httpGet: path: /healthcheck port: 80 initialDelaySeconds: 60 periodSeconds: 30 readinessProbe: httpGet: path: /healthcheck port: 80 initialDelaySeconds: 30 periodSeconds: 10 volumes: - name: onlyoffice-data persistentVolumeClaim: claimName: onlyoffice-data-pvc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 apiVersion: v1 kind: PersistentVolume metadata: name: pv-mariadb-data spec: capacity: storage: 4Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain storageClassName: local-storage local: path: /data/seafile/mariadb nodeAffinity: required: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/hostname operator: In values: - worker2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 apiVersion: v1 kind: PersistentVolume metadata: name: pv-onlyoffice-data spec: capacity: storage: 2Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain storageClassName: local-storage local: path: /data/seafile/onlyoffice nodeAffinity: required: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/hostname operator: In values: - worker2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 apiVersion: v1 kind: PersistentVolume metadata: name: pv-seafile-data spec: capacity: storage: 8Gi accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain storageClassName: local-storage local: path: /data/seafile/seafile nodeAffinity: required: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/hostname operator: In values: - worker2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 apiVersion: v1 kind: PersistentVolumeClaim metadata: name: seafile-data-pvc namespace: seafile spec: accessModes: - ReadWriteOnce storageClassName: local-storage resources: requests: storage: 8Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mariadb-data-pvc namespace: seafile spec: accessModes: - ReadWriteOnce storageClassName: local-storage resources: requests: storage: 4Gi --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: onlyoffice-data-pvc namespace: seafile spec: accessModes: - ReadWriteOnce storageClassName: local-storage resources: requests: storage: 2Gi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 apiVersion: apps/v1 kind: Deployment metadata: name: seafile namespace: seafile labels: app: seafile spec: replicas: 1 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 selector: matchLabels: app: seafile template: metadata: labels: app: seafile spec: nodeSelector: kubernetes.io/hostname: worker2 initContainers: - name: wait-for-mariadb image: 10.2 .12 .4 /seafilejingxiang/busybox:1.36 imagePullPolicy: IfNotPresent command: - sh - -c - | until nc -z mariadb 3306; do echo "Waiting for MariaDB to be ready..." sleep 2 done echo "MariaDB is ready!" - name: configure-onlyoffice image: 10.2 .12 .4 /seafilejingxiang/busybox:1.36 imagePullPolicy: IfNotPresent env: - name: ONLYOFFICE_APIJS_URL valueFrom: configMapKeyRef: name: seafile-config key: ONLYOFFICE_APIJS_URL - name: ONLYOFFICE_JWT_SECRET valueFrom: secretKeyRef: name: seafile-secrets key: onlyoffice-jwt-secret volumeMounts: - name: seafile-data mountPath: /shared command: - sh - -c - | CONFIG_FILE="/shared/seafile/conf/seahub_settings.py" CONFIG_DIR="/shared/seafile/conf" echo "==========================================" echo " 配置 OnlyOffice 集成" echo "==========================================" for i in $(seq 1 60 ); do if [ -d "$CONFIG_DIR" ]; then break fi echo "等待 Seafile 配置目录创建... ($i/60)" sleep 1 done if [ ! -d "$CONFIG_DIR" ]; then echo "创建配置目录: $CONFIG_DIR" mkdir -p "$CONFIG_DIR" fi if [ ! -f "$CONFIG_FILE" ]; then echo "配置文件不存在,创建新文件: $CONFIG_FILE" touch "$CONFIG_FILE" fi if grep -q "ENABLE_ONLYOFFICE" "$CONFIG_FILE" ; then echo "OnlyOffice 配置已存在,更新配置..." sed -i '/# OnlyOffice DocumentServer 配置/,/ONLYOFFICE_JWT_HEADER/d' "$CONFIG_FILE" fi echo "" >> "$CONFIG_FILE" echo "# OnlyOffice DocumentServer 配置" >> "$CONFIG_FILE" echo "# 此配置由 Kubernetes initContainer 自动添加" >> "$CONFIG_FILE" echo "ENABLE_ONLYOFFICE = True" >> "$CONFIG_FILE" echo "VERIFY_ONLYOFFICE_CERTIFICATE = False" >> "$CONFIG_FILE" echo "ONLYOFFICE_APIJS_URL = '${ONLYOFFICE_APIJS_URL}'" >> "$CONFIG_FILE" echo "ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx')" >> "$CONFIG_FILE" echo "ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')" >> "$CONFIG_FILE" echo "ONLYOFFICE_JWT_SECRET = '${ONLYOFFICE_JWT_SECRET}'" >> "$CONFIG_FILE" echo "ONLYOFFICE_JWT_HEADER = 'Authorization'" >> "$CONFIG_FILE" echo "OnlyOffice 配置已成功添加到 $CONFIG_FILE" echo "配置内容:" tail -n 10 "$CONFIG_FILE" if ! grep -q "FILE_UPLOAD_MAX_SIZE" "$CONFIG_FILE" ; then echo "" >> "$CONFIG_FILE" echo "# 文件上传大小限制(100MB)" >> "$CONFIG_FILE" echo "FILE_UPLOAD_MAX_SIZE = 104857600" >> "$CONFIG_FILE" echo "文件上传大小限制已添加到 $CONFIG_FILE" fi containers: - name: seafile image: docker.io/seafileltd/seafile-mc:12.0-latest imagePullPolicy: IfNotPresent ports: - containerPort: 80 name: http - containerPort: 8082 name: seahub env: - name: DB_HOST valueFrom: configMapKeyRef: name: seafile-config key: DB_HOST - name: DB_PORT valueFrom: configMapKeyRef: name: seafile-config key: DB_PORT - name: DB_USER valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-user - name: DB_PASSWORD valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-password - name: DB_ROOT_PASSWD valueFrom: secretKeyRef: name: seafile-secrets key: mariadb-root-password - name: SEAFILE_MYSQL_DB_CCNET_DB_NAME value: "ccnet_db" - name: SEAFILE_MYSQL_DB_SEAFILE_DB_NAME value: "seafile_db" - name: SEAFILE_MYSQL_DB_SEAHUB_DB_NAME value: "seahub_db" - name: TIME_ZONE value: "Asia/Shanghai" - name: SEAFILE_SERVER_PROTOCOL valueFrom: configMapKeyRef: name: seafile-config key: SEAFILE_SERVER_PROTOCOL - name: SEAFILE_SERVER_HOSTNAME valueFrom: configMapKeyRef: name: seafile-config key: SEAFILE_SERVER_HOSTNAME - name: INIT_SEAFILE_ADMIN_EMAIL valueFrom: secretKeyRef: name: seafile-secrets key: seafile-admin-email - name: INIT_SEAFILE_ADMIN_PASSWORD valueFrom: secretKeyRef: name: seafile-secrets key: seafile-admin-password - name: MEMCACHED_HOST valueFrom: configMapKeyRef: name: seafile-config key: MEMCACHED_HOST - name: MEMCACHED_PORT valueFrom: configMapKeyRef: name: seafile-config key: MEMCACHED_PORT - name: JWT_PRIVATE_KEY valueFrom: secretKeyRef: name: seafile-secrets key: jwt-private-key volumeMounts: - name: seafile-data mountPath: /shared resources: requests: cpu: "1000m" memory: "2Gi" limits: cpu: "2000m" memory: "4Gi" livenessProbe: tcpSocket: port: 80 initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: tcpSocket: port: 80 initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 6 volumes: - name: seafile-data persistentVolumeClaim: claimName: seafile-data-pvc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 apiVersion: v1 kind: Secret metadata: name: seafile-secrets namespace: seafile type: Opaque stringData: mariadb-root-password: "SeafileRoot123!" mariadb-database: "seafile" mariadb-user: "seafile" mariadb-password: "SeafileDB123!" seafile-admin-email: "admin@seafile.local" seafile-admin-password: "bobo647468" jwt-private-key: "FjMDpUVCVpCH7OgLAY5dbmWt0jtaOEZwZMDm6MGH" onlyoffice-jwt-secret: "FjMDpUVCVpCH7OgLAY5dbmWt0jtaOEZwZMDm6MGH"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 piVersion: v1 kind: Service metadata: name: mariadb namespace: seafile labels: app: mariadb spec: type: ClusterIP ports: - port: 3306 targetPort: 3306 protocol: TCP name: mysql selector: app: mariadb --- apiVersion: v1 kind: Service metadata: name: memcached namespace: seafile labels: app: memcached spec: type: ClusterIP ports: - port: 11211 targetPort: 11211 protocol: TCP name: memcached selector: app: memcached --- apiVersion: v1 kind: Service metadata: name: seafile namespace: seafile labels: app: seafile spec: type: NodePort ports: - port: 80 targetPort: 80 protocol: TCP name: http nodePort: 30085 - port: 8082 targetPort: 8082 protocol: TCP name: seahub selector: app: seafile --- apiVersion: v1 kind: Service metadata: name: onlyoffice namespace: seafile labels: app: onlyoffice spec: type: NodePort ports: - port: 80 targetPort: 80 protocol: TCP name: http nodePort: 30081 selector: app: onlyoffice
1 2 3 4 5 6 apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: local-storage provisioner: kubernetes.io/no-provisioner volumeBindingMode: WaitForFirstConsumer