已解决 使用华为云硬盘备份了禅道的文件,pod一旦重启,容器内的mysql就被初始化了,没有把禅道的数据库恢复
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: chandao-pvc
  namespace: lstack
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: chandao-sas
  resources:
    requests:
      storage: 1Gi

---

apiVersion: v1
kind: Service
metadata:
  labels:
    app: chandao
  name: chandao-client
  namespace: lstack
spec:
  ports:
    - name: chandao
      port: 80
      targetPort: 80
      nodePort: 31526
    - name: mysql
      port: 3306
      targetPort: 3306
      nodePort: 31234
  selector:
    app: chandao
  type: NodePort

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: chandao
  namespace: lstack
  labels:
    app: chandao
spec:
  selector:
    matchLabels:
      app: chandao
  replicas: 1
  template:
    metadata:
      labels:
        app: chandao
    spec:
      containers:
        - name: chandao
          image: easysoft/zentao:18.3
          resources:
            requests:
              memory: "2Gi"
              cpu: "2000m"
          env:
          - name: MYSQL_ROOT_PASSWORD
            value: '123456'
          ports:
          - name: chandao
            containerPort: 80
          - name: mysql
            containerPort: 3306
          volumeMounts:
          - name: chandao
            mountPath: /www/zentaopms
      volumes:
        - name: chandao
          persistentVolumeClaim:
            claimName: chandao-pvc

禅道版本 18.3 源码包
操作系统 CentOS
客户端浏览器 Chrome

提问者: light 悬赏:5 日期: 2023-05-12 12:05:52 答案:2 点击:346

获取技术支持

QQ: 电话:
设置备注
答案列表
2023/05/12

https://www.zentao.net/book/zentaopms/405.html

可以看下docker的安装文档,mysql的数据目录/var/lib/mysql需要做下持久化映射出来的

2023/05/15
这个目录我持久化之后服务就起不来了 看日志 init mysql环节失败
2023/05/15
可以添加页面上方QQ,邀请您技术技术交流群沟通问题。
2023/05/15
把mysql拿出来
2023/05/15
拿出来意味着我要自己维护mysql的服务了?这增加了私有化部署成本呀
2023/05/15
把mysql映射出来只是把数据持久化,并没有额外部署数据库的。