How to handle "docker-in-docker" problem when using Jenkins inside K8S

3/22/2020

New to Kubernetes, a little complex question needs help.

Background

  1. Using Jenkins in GKE (Google Kubernetes Engine)
  2. Want to use jenkins-docker plugin to provide the specific test environment for each type of tests
  3. Don't want to mixin docker binary in the Jenkins image (because it is large)
  4. Don't want docker-in-docker
    1. More specifically, I don't want the Jenkins Pod be a new Docker Server

What I want

  1. Each test environment can create a new pod in GKE Cluster, rather than creating containers inside the Jenkins Pod

P.S.

I have just read some articles, but half of them are telling about "how to use K8S to scale up the Jenkins (using jenkins-slave + jenkins-kubernates plugin)", another half are telling about how to "use docker plugin in a dockerized jenkins container on a bare metal machine (you can use /var/run/docker.sock to communicate between the host and the docker container)", but I cannot find **how to use docker plugin (to provide a specific environment) in a dockerized jenkins container inside K8S

-- Ukonn Ra
continuous-integration
docker
jenkins
kubernetes
kubernetes-helm

0 Answers