0
votes

I am trying to use kubernetes and Jenkins for my deployment of micro services developed using spring boot. When I am exploring , many Youtube videos and other documentation tutorials are using dockerhub.com as keeping published image as repository. Here I am feeling little bit doubts. I am adding here,

  1. Can I deploy docker image in kubernetes by using Jenkins docker image build without using this dockerhub.com ? Menas I don't want to share client code in a public place. So can I use Jenkins without dockerhub.com

Can anyone clarify my doubt please?

1
hi, you can persist your images in a private registry rather than using dockerhub registry. It's all about persistence. As you know that Jenkins is also running as a pod which can be terminated.Suresh Vishnoi

1 Answers

1
votes

You do need to use some registry- kubernetes needs a registry URL to be able to pull and instantiate a particular image as a container in a pod. To avoid having the images themselves be publicly accessible you have 2 options:

  • use a business account at a public registry. You can get one of these from Docker, or from other services like Google or Quay. When you push images using a business account, you get a private space in the public registry and only your account credentials can push and pull those images. In this case your Kubernetes- and your Jenkins- has to be configured with credentials derived from your account to be able to pull those private images into your cluster.
  • run a private registry in your cluster or on your non-cluster infrastructure There are many flavors of private registries, including Docker's, Atlassian's, and many others. This keeps your images entirely on your infrastructure. The tradeoff is that you have to configure and run this as a production service, and most private registries suitable for production use have a lot of moving parts for scalable image storage, indexing, backup, and so forth.