Jenkins with kubernetes on GKE

10/2/2017

I'm new to kubernetes in combination with jenkins. Therefor I've done some tutorials.

My goal is: 1) build docker images 2) push docker images to GCR 3) deploy image in kubernetes

I've setup my GKE 1:1 like the tutorial. https://cloud.google.com/solutions/continuous-delivery-jenkins-container-engine Also did these tutorials: "jenkins-on-container-engine-tutorial" "configuring-jenkins-container-engine"

Since these tutorials are depending on each other I've done them multiple times completely from scratch to avoid errors from my side.

The issue is the build agent can't find the docker command! I've also tried some custom images like in this thread: Easiest way to do docker build command within Jenkinsfile running on Jenkins slave node?

But nothing seems to work :(

-- stxe
docker
gcloud
google-kubernetes-engine
jenkins
kubernetes

1 Answer

11/16/2017

I'm running on GKE, so I also needed the gcloud cli which also provides docker commands.

So here are the steps: 1) create custom Jenkins image with gcloud cli installed 2) Be sure to enable the scope "cloud plattform" 3) use gcloud docker command :)

-- stxe
Source: StackOverflow