Creating a deployment

Before creating a deployment, we need to have our Docker image ready and published to a registry, the same as the Docker Hub for example. Of course, it can also be a private repository hosted in your organization. As you remember from the Chapter 7, Introduction to Kubernetes, each Docker container in a Pod has its own image. By default, the kubectl process in a Pod will try to pull each image from the specified registry. You can change this behavior by specifying a value for the imagePullPolicy property in a deployment descriptor. It can have the following values:

  • IfNotPresent: With this setting, the image will be pulled from the registry only if not present on the local host
  • Never: With this one, kubelet will use ...

Get Docker and Kubernetes for Java Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.