I started building CI/CD pipeline using two Kubernetes clusters and one Jenkins. Two clusters are totally isolated as one is in the test environment and other in production.

After searching from many blogs, I come up with these approaches:

  1. Setup Jenkins master in production and one Jenkins slave/agent in the testing environment.
  2. Make Kubernetes api-server of test environment accessible in production environment with proper firewall whitelisting and setup jenkins in production to deploy in both environments.

I like to know which approach is better.

  • Have you considered using a single Kubernetes cluster and isolating workloads with affinity/taint?
    – casey vega
    Commented Oct 8, 2019 at 3:38

1 Answer 1


For the best practices will be great to install Jenkins master on the lower Environments (best Dev env) and to leave Production in peace with only necessary things (with your end-user application and their dependencies).

The reason why is because production means production and if something will happen with Jenkins or if you will allow a lot of people accessing Jenkins in production you increase your failure rate.

Will be better to install Jenkins separated from production and to do VPC Peering between clusters and after you can create a fully CI/CD pipeline where you can create a Jenkins slave/agent which will deploy your application to PROD.

PROD suppose to be more focused to an end Product result. You didn't specify which cloud provider do you use so, I can't help too much... Hope this will clarify your vision.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.