• 在K8S中部署禅道zentao



    官方文档中并没有说明K8S下的部署,只在docker下部署,所以官方的镜像不是通用的。直接从官方拉个镜像放在K8S上并不能运行。本例中用的镜像可能是原作者修改好的,直接拿来用就好了。

    创建pv、pvc

    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: zentao
    spec:
      capacity:
        storage: 20Gi
      accessModes:
        - ReadWriteOnce
      persistentVolumeReclaimPolicy: Recycle
      storageClassName: nfs-zentao
      nfs:
        path: /data/zentao
        server: 10.61.150.16
    
    ---
    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
      name: pvc-zentao
      namespace: servers
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 20Gi
      storageClassName: nfs-zentao
    

    创建dp

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: zentao-server
      namespace: servers
      labels:
        app: zentao
    spec:
      selector:
        matchLabels:
          app: zentao
      replicas: 1
      template:
        metadata:
          labels:
            app: zentao
        spec:
          containers:
          - name: zentao
            image: hub.ict.ac.cn/dev/zentao:12.3
            imagePullPolicy: IfNotPresent
            env:
            - name: ADMINER_USER
              value: 'root'
              #mysql用户名
            - name: ADMINER_PASSWD
              value: '0ckrtsxmdfg_4z7uvR'
              #mysql密码
            - name: BIND_ADDRESS
              value: 'true'
            - name: SMTP_HOST
              value: 'smtp.test.cn'
            ports:
            - name: zentao
              containerPort: 80
            - name: mysql
              containerPort: 3306
            volumeMounts:
            - name: zentao-data
              mountPath: /opt/zbox
          volumes:
            - name: zentao-data
              persistentVolumeClaim:
                claimName: pvc-zentao
    

    创建svr

    apiVersion: v1
    kind: Service
    metadata:
      labels:
        app: zentao
      name: zentao
      namespace: servers
    spec:
      ports:
      - name: zentao
        port: 80
        protocol: TCP
        targetPort: 80
        nodePort: 30051
      - name: mysql
        port: 3306
        protocol: TCP
        targetPort: 3306
        nodePort: 30052
      selector:
        app: zentao
    
    

    测试

    http://172.16.0.21:30051
    admin 123456
    

    创建ingress

    附件

    yaml文件git地址
    参考文档
    官方文档

  • 相关阅读:
    Random 种子问题
    Matrix issue
    Two sum.
    Best Time to Buy and Sell Stock
    Maximum difference between two elements
    二分查找法的实现和应用汇总
    Why you want to be restrictive with shrink of database files [From karaszi]
    Palindrome
    NetBeans vs Eclipse 之性能参数对比 [java060515]
    国内各大互联网公司相关技术站点不完全收录[转]
  • 原文地址:https://www.cnblogs.com/zhaobowen/p/13691926.html
Copyright © 2020-2023  润新知