---
apiVersion: v1
kind: Service
metadata:
  name: revit-algorithm
  labels:
    app: revit-algorithm
spec:
  selector:
    app: revit-algorithm
  ports:
    - port: 8080
      targetPort: 8080
      name: server-port

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: revit-algorithm
spec:
  replicas: 1
  selector:
    matchLabels:
      app: revit-algorithm
  template:
    metadata:
      labels:
        app: revit-algorithm
    spec:
      imagePullSecrets:
        - name: persagy
      containers:
      - name: revit-algorithm
        image: labisenlin.persagy.com/library/revit-algorithm:develop-fbcc3cd
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
          name: server-port
        env:
        - name: TZ
          value: Asia/Shanghai
        resources:
          limits:
            memory: 4Gi
          requests:
            memory: 1Gi
        volumeMounts:
          - name: admpath
            mountPath: /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/application.yml
            subPath: path/to/application.yml
      volumes:
        - name: admpath
          configMap:
            name: revit-algorithm
            defaultMode: 511
            items:
              - key: application.yml
                path: path/to/application.yml