---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: vsts-aks-agent
  namespace: vsts
  labels:
    app: vsts-aks-agent
spec:
  replicas: 5
  selector:
    matchLabels:
      app: vsts-aks-agent
  template:
    metadata:
      labels:
        app: vsts-aks-agent
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app.kubernetes.io/component
                operator: In
                values:
                - jenkins-master
            topologyKey: "kubernetes.io/hostname"
      containers:
      - name: vsts-aks-agent
        image: hmctspublic.azurecr.io/hmcts/vsts-agent:dbebvx
        env:
        - name: AZP_URL
          value: https://dev.azure.com/hmcts
        - name: AZP_TOKEN
          valueFrom:
            secretKeyRef:
              name: vsts-token
              key: token
        - name: AZP_POOL
          value: hmcts-cftptl-agent-pool
        resources:
          requests:
            memory: "1024Mi"
            cpu: "250m"
          limits:
            memory: "4096Mi"
            cpu: "2000m"
