apiVersion: apps/v1
kind: Deployment
metadata:
  name: ${SERVICE_NAME}-deployment
spec:
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: ${SERVICE_NAME}
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: ${SERVICE_NAME}
      name: ${SERVICE_NAME}
    spec:
      containers:
      - name: ${SERVICE_NAME}
        image: ${SERVICE_NAME}
        imagePullPolicy: Always
        env:
        - name: K8S_ENV_NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: K8S_ENV_POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: K8S_ENV_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: K8S_ENV_POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: K8S_ENV_DEPLOYMENT_NAME
          value: ${SERVICE_NAME}-deployment
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      imagePullSecrets:
      - name: cpy-docker-test-registry
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
