
apiVersion: apps/v1
kind: Deployment
metadata:
  name: pu-ordercenter-v1x0x1
  labels:
    app: pu-ordercenter-v1x0x1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pu-ordercenter-v1x0x1
  template:
    metadata:
      labels:
        app: pu-ordercenter-v1x0x1
    spec:
      hostname: pu-ordercenter-v1x0x1
      hostAliases:
        - ip: "172.35.10.4"
          hostnames:
            - "api-glb.daline.com.cn"
      containers:
        - name: pu-ordercenter-v1x0x1
          image: dockerhub.daline.com.cn/pu_ordercenter_b9b168c:1.0.1
          volumeMounts:
            - name: nfs-store
              mountPath: /var/store/nfs
            - name: nfs-store-author
              mountPath: /var/store/nfs_author
            - name: http-store
              mountPath: /var/store/http
            - name: localtime
              mountPath: /etc/localtime
              readOnly: true
          ports:
            - containerPort: 80
              name: "http"
            - containerPort: 81
              name: "websocket"
          env:
            - name: "TZ"
              value: "Asia/Shanghai"
            - name: "SERVE"
              value: "1"
            - name: "IN_K8S"
              value: "1"
            - name: "AUTHOR"
              value: "kun.z"
            - name: "GIT_COMMIT"
              value: "b9b168c26d5fae5d7ed70486713130a0262ed07c"
            - name: "DAL_ENV"
              value: "dev"
            - name: "DAL_SPACE"
              value: "guojinfutu"
            # log config
            - name: "LOG_LEVEL"
              value: "info"
            - name: "LOG_DIR"
              value: "/var/log/daline"
            # file storage config
            - name: "TEMP_FOLDER"
              value: "/tmp/"
            - name: "NFS_FOLDER"
              value: "/var/store/nfs/"
            - name: "NFS_FOLDER_AUTHOR"
              value: "/var/store/nfs_author/"
            - name: "HTTP_FOLDER"
              value: "/var/store/http/"
            - name: "HTTP_BASE_URL"
              value: "/httpstore/dev/guojinfutu/kun.z/pu_ordercenter/1_0_1/"
            - name: "RUN_MODE"
              value: "run"
      volumes:
        - name: nfs-store
          nfs:
            server: nfs.daline.com.cn
            path: "/home/NFSData/dev/guojinfutu/kun.z/pu_ordercenter/1_0_1/"
        - name: nfs-store-author
          nfs:
            server: nfs.daline.com.cn
            path: "/home/NFSData/dev/guojinfutu/kun.z/"
        - name: http-store
          nfs:
            server: nfs.daline.com.cn
            path: "/home/NFSData/FileServer/files/dev/guojinfutu/kun.z/pu_ordercenter/1_0_1/"
        - name: localtime
          hostPath:
            path: "/etc/localtime"

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: pu-ordercenter-v1x0x1
  name: pu-ordercenter-v1x0x1
spec:
  ports:
    - port: 80
      targetPort: 80
      name: "http"
    - port: 81
      targetPort: 81
      name: "websocket"
  selector:
    app: pu-ordercenter-v1x0x1

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: pu-ordercenter-v1x0x1
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/proxy-body-size: 0m
spec:
  ingressClassName: nginx
  rules:
  - host: api-htz.gjqh.com.cn
    http:
      paths:
      - path: /guojinfutu/pu-ordercenter-v1x0x1(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: pu-ordercenter-v1x0x1
            port:
              number: 80

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: pu-ordercenter-v1x0x1-ws
spec:
  ingressClassName: nginx
  rules:
  - host: ws-guojinfutu-pu-ordercenter-v1x0x1.htz.gjqh.com.cn
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: pu-ordercenter-v1x0x1
            port:
              number: 81
