apiVersion: apps/v1
kind: Deployment
metadata:
  name: aks-go113
  labels:
    app: golang-agent
spec:
  replicas: 2
  selector:
    matchLabels:
      app: golang-agent
  template:
    metadata:
      labels:
        app: golang-agent
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: app
                    operator: In
                    values:
                      - golang-agent
              topologyKey: kubernetes.io/hostname
      containers:
        - name: golang-agent
          image: serbrech/azdevops-agent:docker-1.13.0
          imagePullPolicy: Always
          env:
            - name: AZP_URL
              value: https://dev.azure.com/project-genesys
            # - name: AZP_POOL
            #   value: k8s
            - name: AZP_TOKEN
              valueFrom:
                secretKeyRef:
                  name: azp
                  key: AZP_TOKEN
            - name: AZP_POOL
              value: aks-go113
            - name: DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER
              value: "0"
            - name: DOCKER_BUILDKIT
              value: "1"
          volumeMounts:
            - mountPath: /var/run/docker.sock
              name: docker-socket-volume
          securityContext:
            privileged: true
      volumes:
        - name: docker-socket-volume
          hostPath:
            path: /var/run/docker.sock
            type: File
