<p>I recently spun <a href="https://github.com/Azure/helm-vsts-agent" rel="nofollow noreferrer">this</a> chart up on kubernetes. It has been archived. These are the changes I have made to get it to run:</p>
<h3>Image</h3>
<p>Changed the image from <code>microsoft/vsts-agent</code> to <code>mcr.microsoft.com/azure-pipelines/vsts-agent</code>
Changed the tags from <code>latest</code> to <code>ubuntu-16.04-docker-17.12.0-ce</code></p>
<h3>Limits</h3>
<p>Reduced the limits from 4 CPU and 8Gbi to 1 and 1 respectively because I'm cheap and am using weak VMs.</p>
<h3>Api Version</h3>
<p>Changed from <code>apiVersion: apps/v1beta2</code> to <code>apiVersion: apps/v1</code> to allow for Statefulset</p>
<hr />
<p>That being said everything spun up and was healthy on the cluster. So far so good, right? Well. Not so good.</p>
<p>The next step was to actually use the agents. I setup Azure Devops with the agent pool and configured a very simple pipeline using the GUI.</p>
<p><a href="https://i.stack.imgur.com/53hts.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/53hts.png" alt="enter image description here" /></a></p>
<p>Step 1 succeeds but step 2 fails. So this is where I'm down the rabbit hole. The chart uses a mounted docker-socket which I believe has been removed from AKS (<a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops#use-azure-kubernetes-service-cluster" rel="nofollow noreferrer">read about this here</a>).</p>
<p>I am not sure why step 1 would succeed, telling me that docker is installed, but step 2 fails citing that it cannot find docker.</p>
<p>The main error I am seeing: <code>Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?</code></p>
<hr />
<p>Is there an alternative solution out there? Right now I just paid for a hosted agent on Devops just to get some builds through but I do not want to do this, I want to use Kubernetes if possible to run these agents.</p>

Questioning
<p>Running on (any recent version) of AKS you cannot use docker-in-docker (which is what you want to do here). See this article for the limitations that got introduced when AKS switched to containerd: <a href="https://learn.microsoft.com/en-us/azure/aks/cluster-configuration#containerd-limitationsdifferences" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/aks/cluster-configuration#containerd-limitationsdifferences</a></p>
<p>As an alternative I suggest using <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/scale-set-agents?view=azure-devops" rel="nofollow noreferrer">VMSS-self hosted Build Agents</a>. Works like a charm for me. Use cloud-init to define the software you want to have and ADO takes care of scaling up and down your agents.</p>
