apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    scheduler.alpha.kubernetes.io/critical-pod: ""
  labels:
    tier: control-plane
  name: autopilot
  namespace: kube-test
spec:
  selector:
    matchLabels:
      name: autopilot
      tier: control-plane
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  replicas: 1
  template:
    metadata:
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ""
      labels:
        name: autopilot
        tier: control-plane
    spec:
      containers:
      - command:
        - /autopilot
        - --config=/etc/config/config.yaml
        - --log-level=debug
        imagePullPolicy: Always
        image: portworx/autopilot:1.1.1
        resources:
          requests:
            cpu: '0.1'
        name: autopilot
        volumeMounts:
        - name: config-volume
          mountPath: /etc/config
        env:
        - name: PX_NAMESPACE
          value: kube-test
      hostPID: false
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: "name"
                    operator: In
                    values:
                    - autopilot
              topologyKey: "kubernetes.io/hostname"
      serviceAccountName: autopilot
      volumes:
        - name: config-volume
          configMap:
            name: autopilot-config
            defaultMode: 420
            items:
            - key: config.yaml
              path: config.yaml
