apiVersion: apps/v1
kind: Deployment
metadata:
  name: http-adapter-deployment
  namespace: default
  labels:
    app: http-adapter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: http-adapter
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  minReadySeconds: 15
  revisionHistoryLimit: 5
  progressDeadlineSeconds: 180
  template:
    metadata:
      labels:
        app: http-adapter
    spec:
      containers:
      - name: http-adapter-container
        image: code2life/http-adapter:1.0.2
        imagePullPolicy: IfNotPresent
        env:
        - name: PORT
          value: "8080"
        - name: CONF_PATH
          value: /conf
        - name: SERVER_VERSION
          value: 1.0.5
        - name: DEBUG
          value: server:*
        livenessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 10
          timeoutSeconds: 5
          periodSeconds: 15
        ports:
        - containerPort: 8080
        resources:
          limits:
            cpu: "1"
            memory: 512Mi
          requests:
            cpu: 50m
            memory: 128Mi
        volumeMounts:
        - name: conf
          mountPath: /conf
      restartPolicy: Always
      terminationGracePeriodSeconds: 60
      dnsPolicy: ClusterFirst
      volumes: 
      - name: conf
        hostPath: 
          path: /opt/http-adapter-conf
          type: DirectoryOrCreate