Moving Jenkins from ec2 to k8s how do I configure docker?

We currently run Jenkins instances as web service under Tomcat on CentOS7 ec2s. Docker is also running as a service on the instances. Most of our applications now live in eks. We would like to try setting up a Jenkins controller and agents in eks. I can’t quite wrap my head around where Docker can live. Can Docker run as a Docker container in the same pod as the Jenkins Controller container? I’ve been searching for the documentation that may spell this out for me to no avail.

Why would you want to run docker in a docker container? (Some people do this to build docker images, for example).

You could run Jenkins controller as a Kubernetes application - Kubernetes

You could run your agents on Kubernetes directly via the Kubernetes plugin.

In fact, you can do those things independently - for example first move agents to Kubernetes and keep Jenkins under Tomcat on ec2, and then move the controller to Kubernetes when you are ready. Or the other way around. It is only important to make sure the agents are reachable via artificial network created by Kubernetes.