---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: demo-sdm
  namespace: sdm
  labels:
    app: demo-sdm
    owner: atomist
spec:
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: demo-sdm
      owner: atomist
  template:
    metadata:
      labels:
        app: demo-sdm
        owner: atomist
        version: "0"
      annotations:
        atomist.com/k8vent: '{"webhooks":["https://webhook.atomist.com/atomist/kube/teams/T29E48P34"]}'
    spec:
      serviceAccountName: sdm-serviceaccount
      containers:
      - name: demo-sdm
        image: atomist/demo-sdm:0.1.0
        imagePullPolicy: IfNotPresent
        env:
        - name: ATOMIST_DEPLOYMENT_NAME
          value: demo-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
          valueFrom:
            secretKeyRef:
              name: atm-sdm
              key: config
        - name: ATOMIST_CONFIG_PATH
          value: "/opt/atm/atomist-config.json"
        ports:
        - name: http
          containerPort: 2866
          protocol: TCP
        readinessProbe:
          httpGet:
            path: "/health"
            port: http
            scheme: HTTP
          initialDelaySeconds: 20
          timeoutSeconds: 3
          periodSeconds: 20
          successThreshold: 1
          failureThreshold: 3
        livenessProbe:
          httpGet:
            path: "/health"
            port: http
            scheme: HTTP
          initialDelaySeconds: 20
          timeoutSeconds: 3
          periodSeconds: 20
          successThreshold: 1
          failureThreshold: 3
        resources:
          limits:
            cpu: 2000m
            memory: 3000Mi
          requests:
            cpu: 500m
            memory: 1000Mi
        volumeMounts:
        - name: docker-sock
          mountPath: "/var/run/docker.sock"
        - name: automation
          mountPath: "/opt/atm"
          readOnly: true
      volumes:
      - name: docker-sock
        hostPath:
          path: "/var/run/docker.sock"
      - name: automation
        secret:
          secretName: automation
      restartPolicy: Always
      terminationGracePeriodSeconds: 180
      dnsPolicy: ClusterFirst
      imagePullSecrets:
      - name: atomistjfrog
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 1
