apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: {PROJECT_NAMESPACE}
  name: {PROJECT_NAME}
spec:
  selector:
    matchLabels:
      app: {PROJECT_NAME}
  replicas: 1
  template:
    metadata:
      namespace: {PROJECT_NAMESPACE}
      labels:
        app: {PROJECT_NAME}
    spec:
      containers:
      - name: {PROJECT_NAME}
        image: {PROJECT_IMAGE}
        imagePullPolicy: Always
        env:
        - name: SPRING_PROFILES_ACTIVE
          value: {PROJECT_ACTIVE}
        ports:
        - containerPort: {PROJECT_PORT}
        readinessProbe:
          tcpSocket:
            port: {PROJECT_PORT}
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 10
          failureThreshold: 3
        livenessProbe:
          tcpSocket:
            port: {PROJECT_PORT}
          initialDelaySeconds: 30
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 10
          failureThreshold: 3
        volumeMounts:
        - name: spring-log
          mountPath: /user/local/logs
        - name: host-time
          mountPath: /etc/localtime
      volumes:
      - name: host-time
        hostPath:
         path: "/etc/localtime"
      - name: spring-log
        persistentVolumeClaim:
          claimName: log-pvc
---
#service
apiVersion: v1
kind: Service
metadata:
  namespace: {PROJECT_NAMESPACE}
  name: {PROJECT_NAME}
spec:
  ports:
  - port: {PROJECT_PORT}
    targetPort: {PROJECT_PORT}
    nodePort: {PROJECT_NODEPORT}
  type: NodePort
  selector:
    app: {PROJECT_NAME}
