/ KUBERNETES

k8s 部署 禅道

禅道是一款开源的全生命周期项目管理软件,基于敏捷和CMMI管理理念进行设计,集产品管理、项目管理、质量管理、文档管理、组织管理和事务管理于一体,完整地覆盖了项目管理的核心流程。

部署

创建yaml文件

vi zentao.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: zentao
  name: zentao
  namespace: project
spec:
  ports:
    - name: port-nginx
      port: 80
      protocol: TCP
      targetPort: 80
  selector:
    app: zentao
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: zentao
  namespace: project
spec:
  replicas: 1
  selector:
    matchLabels:
      app: zentao
  template:
    metadata:
      name: zentao
      creationTimestamp: null
      labels:
        app: zentao
    spec:
      nodeName: k8s-node1
      containers:
        - image: 192.168.186.132/library/easysoft/zentao
          name: zentao
          imagePullPolicy: IfNotPresent
          env:
            - name: MYSQL_INTERNAL
              value: "true"
          volumeMounts:
            - name: docdata
              mountPath: /data
      volumes:
        - name: docdata
          hostPath:
            type: DirectoryOrCreate
            path: /zentao_data
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-zentao
  namespace: project
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  ingressClassName: nginx
  rules:
    - host: zentao.test.com
      http:
        paths:
          - path: /(.*)
            pathType: ImplementationSpecific
            backend:
              service:
                name: zentao
                port:
                  number: 80

执行安装

kubectl apply -f zentao.yaml

访问地址 zentao.test.com

alt