Jenkins, Docker and Kubernetes (using minikube)

3/20/2018

I have already used Jenkins in the past integrated with GitHub and deploying zip file to AWS Elastic beanstalk.

I am new to kubernetes, how can I make full CI/CD pipeline to create dockers images from jenkins and deploying it to kubernetes cluster running minikube.

Any links, experiences from experts or guidance will be appreciated

Regards, Aziz

-- Aziz Zoaib
docker
kubernetes
minikube

2 Answers

5/22/2018

We're working on an open source project called Jenkins X which is a proposed sub project of the Jenkins foundation aimed at automating CI/CD on Kubernetes using Jenkins pipelines and GitOps for promotion across environments.

If you want to see how to automate CI/CD with multiple environments on Kubernetes using GitOps for promotion between environments and Preview Environments on Pull Requests you might wanna check out my recent talk on Jenkins X at DevOxx UK where I do a live demo of this on GKE. Though Jenkins X works on AWS, AKS and GKE and other kubernetes clusters like minikube too.

The only issue on minikube is there's no webhooks so it can take a while for promotion to kick in (there's a 5 minute backup poll for git events). You can manually trigger the jobs in the Jenkins UI though to work around the lack of webhooks ;)

-- James Strachan
Source: StackOverflow

3/20/2018

There are multiple stages in this workflow.

  1. Checkout the source code from Github and build a Docker image from a Dockerfile.
  2. Push the resulting image to a remote Docker image registery such as Dockerhub.
  3. Deploy the image to the Kubernetes cluster.

It doesn't matter if kubernetes is running on Minikube or some other cloud platform. To deploy to a kubernetes cluster you can either use kubectl or the Jenkins Kubernetes Continuous Deploy Plugin.

-- yamenk
Source: StackOverflow