在k8s上部署项目管理软件: 禅道(ZenTao)

本文最后更新于 408 天前, 如有失效请评论区留言.

ZenTao 是一款开源的项目管理软件, 本文主要通过两种方式来在k8s上部署禅道软件

禅道k8s部署其实也简单, 尤其是helm方式

前提

已经有SC存储类了, 这里默认使用NFS存储类,如果没有安装请参考k8s集群快速部署NFS存储类

如果你要跑高可用需要使用分布式存储

yaml手动部署(不推荐)

yaml方式部署稍微复杂些

数据库部署

偷懒式helm部署, 默认创建一个zentao的数据库

数据库helm配置
# 由于我的默认SC就是opencfs, 这里就不指定了
# global:
#   storageClass: "opencfs"
auth:
  rootPassword: "mokahz4ahvei1oReing6oh5ubaen1veV"
  database: "zentao"
  username: "zentao"
  password: "zt6666666666666"

volumePermissions:
  enabled: true
helm部署数据库
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm upgrade -i mysql bitnami/mysql -f ./mysql.yaml

yaml部署禅道

部署禅道
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: zentao
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 10Gi
  storageClassName: opencfs
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: zentao
  labels:
    app: zentao
spec:
  selector:
    matchLabels:
      app: zentao
  replicas: 1
  template:
    metadata:
      labels:
        app: zentao
    spec:
      containers:
      - name: zentao
        # 具体版本可以: https://hub.docker.com/r/easysoft/zentao
        image: easysoft/zentao
        imagePullPolicy: IfNotPresent
        env:
        - name: ZT_MYSQL_HOST
          value: 'mysql.default.svc'
        - name: ZT_MYSQL_USER
          value: 'zentao'
        - name: ZT)MYSQL_PASSWORD
          value: 'zt6666666666666'
        - name: IS_CONTAINER
          value: 'true'
        - name: APP_DEFAULT_PORT
          value: '80'
        ports:
        - name: http
          containerPort: 80
        volumeMounts:
        - name: zentao-data
          mountPath: /data
      volumes:
        - name: zentao-data
          persistentVolumeClaim:
            claimName: zentao
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: zentao
  name: zentao
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: zentao

helm方式部署

很简单, 几条命令一执行就ok了

helm部署禅道
helm repo add zentao https://hub.qucheng.com/chartrepo/stable
helm repo update
helm search repo zentao/zentao
helm upgrade -i zentao-open zentao/zentao --set ingress.enabled=true --set ingress.host=zentao.example.local

高级配置

高级配置
# 下载zentao charts
helm pull zentao/zentao --untar
# 自定义配置 zentao/values.yaml, 示例
helm upgrade -i zentao-open zentao/zentao -f custom.yaml

最后

你看禅道k8s部署其实也简单

Chapters

Sponsor

Like this article? $1 reward

Comments