apiVersion: apps/v1
kind: Deployment
metadata:
  name: azdevops-deployment
  namespace: azdevops
  labels:
    app: azdevops-agent
spec:
  replicas: 2 # here is the configuration for the actual agent always running
  selector:
    matchLabels:
      app: azdevops-agent
  template:
    metadata:
      labels:
        app: azdevops-agent
    spec:
      nodeSelector:
        kubernetes.azure.com/mode: user
      tolerations:
      - key: "kubernetes.azure.com/scalesetpriority"
        operator: "Exists"
        effect: "NoSchedule"
      containers:
      - name: kubepodcreation
        image: containerrepoakstest.azurecr.io/azdevops:2
        env:
          - name: AZP_URL
            valueFrom:
              secretKeyRef:
                name: azdevops
                key: AZP_URL
          - name: AZP_TOKEN
            valueFrom:
              secretKeyRef:
                name: azdevops
                key: AZP_TOKEN
          - name: AZP_POOL
            valueFrom:
              secretKeyRef:
                name: azdevops
                key: AZP_POOL
        resources:
          requests:
            cpu: "1000m"
            memory: "1024Mi"
          limits:
            cpu: "1000m"
            memory: "1024Mi"
        volumeMounts:
        - mountPath: /var/run/docker.sock
          name: docker-volume
      volumes:
      - name: docker-volume
        hostPath:
          path: /var/run/docker.sock