Jenkins + Kubernetes

12/20/2018

I am wondering what is the pattern to proper integrate Jenkins and Kubernetes to satisfy the following scenario :

  • A developer checks in some code relative to a new feature
  • Jenkins build the container creating a pod for Kubernetes
  • Kubenetes assigns a proper dns name to the pod, this is to allow the tester to connect exactly to the pod containing such feature to test
  • Carry on tests

I may be able to configure steps 1 to 2 but I am wondering if there is a way to automatically connect exactly to the pod that has the new feature I need to test.

Just to be more clear, system builds the code automatically, a message is sent to the tester telling him which pod has that feature he is looking to test, in some way he tests the container with such a feature and if everything is ok the feature is merged in master.

cheers

-- user1583007
jenkins
kubernetes

2 Answers

12/20/2018

Sorry, not a complete answer but what you describe sounds like the Auto Dev Ops Feature of Gitlab. You deploy a new "environment" to k8 for each branch, isolated into a namespace. I think you will be able to copy the procedure that Gitlab takes:

https://www.youtube.com/watch?v=uWC2QKv15mk&t=1730s

useful links:

Dns http://xip.io/

Gitlab File (dont be scared by length) https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/ci/templates/Auto-DevOps.gitlab-ci.yml

Helm Chart used https://gitlab.com/charts/auto-deploy-app

The helm chart expects your app as a docker container exposed on port 5000 and brings Postgres.

-- Can
Source: StackOverflow

1/2/2019

Jenkins X will deploy your pull requests to a new preview environment and give you a URL you can connect to, so you can carry your tests

https://jenkins-x.io/about/features/#preview-environments

-- csanchez
Source: StackOverflow