apiVersion: apps/v1
kind: Deployment
metadata:
  name: kuboard
  labels:
    app: kuboard
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kuboard
  template:
    metadata:
      labels:
        app: kuboard
    spec:
      containers:
      - name: kuboard
        image: swr.cn-east-2.myhuaweicloud.com/kuboard/kuboard:v4
        ports:
        - containerPort: 80
          hostPort: 80
          protocol: TCP
        env:
        - name: TZ
          value: "Asia/Shanghai"
        - name: DB_DRIVER
          value: "org.postgresql.Driver"
        - name: DB_URL
          value: "jdbc:postgresql://172.23.6.22:5432/kuboard?currentSchema=kuboard&characterEncoding=UTF8"
        - name: DB_USERNAME
          value: "kuboard"
        - name: DB_PASSWORD
          value: "Kuboard123"
        volumeMounts:
        - name: log-volume
          mountPath: /app/logs
      volumes:
      - name: log-volume
        emptyDir: {}
        #hostPath:
        #  path: /var/log/kuboard
        #  type: DirectoryOrCreate  # 不存在则自动创建
      restartPolicy: Always        # 对应 --restart=unless-stopped（与 Always 行为相近）
