---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: ipcrmdemo-sdm
  namespace: testing
  labels:
    app: ipcrmdemo-sdm
spec:
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: ipcrmdemo-sdm
  template:
    metadata:
      labels:
        app: ipcrmdemo-sdm
        version: "0"
    spec:
      serviceAccountName: sdm-serviceaccount
      containers:
      - name: ipcrmdemo-sdm
        image: ipcrm/ipcrmdemo-sdm:latest
        imagePullPolicy: Always
        env:
        - name: ATOMIST_DEPLOYMENT_NAME
          value: seed-sdm
        - name: ATOMIST_DEPLOYMENT_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: NODE_ENV
          value: production
        - name: FORCE_COLOR
          value: "1"
        - name: ATOMIST_GOAL_LAUNCHER
          value: kubernetes
        - name: ATOMIST_CONFIG_PATH
          value: /opt/atm/client.config.json
        ports:
        - name: http
          containerPort: 2866
          protocol: TCP
        livenessProbe:
          httpGet:
            path: "/health"
            port: 2866
            scheme: HTTP
          initialDelaySeconds: 20
          timeoutSeconds: 3
          periodSeconds: 20
          successThreshold: 1
          failureThreshold: 3
        readinessProbe:
          httpGet:
            path: "/health"
            port: 2866
            scheme: HTTP
          initialDelaySeconds: 20
          timeoutSeconds: 3
          periodSeconds: 20
          successThreshold: 1
          failureThreshold: 3
        resources:
          limits:
            cpu: 1000m
            memory: 512Mi
          requests:
            cpu: 100m
            memory: 384Mi
        volumeMounts:
        - name: automation
          mountPath: /opt/atm
          readOnly: true
      volumes:
      - name: automation
        secret:
          secretName: automation
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 1

