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

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: labsl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: labsl
  template:
    metadata:
      labels:
        app: labsl
    spec:
      imagePullSecrets:
        - name: persagy
      containers:
        - name: labsl
          image: labisenlin.persagy.com/library/labsl: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: labsl
            defaultMode: 511
            items:
              - key: application.yml
                path: path/to/application.yml