Who determines the image?

I read the following description about Kubernetes and I have a question where it says which container images they use.

Isn’t tools like Docker determine the image when the container is created?

I am new to the containerization world so hopefully my question is not a dumb question.

A Kubernetes cluster is a set of node machines for running containerized applications. If you’re running Kubernetes, you’re running a cluster.

At a minimum, a cluster contains a control plane and one or more compute machines, or nodes. The control plane is responsible for maintaining the desired state of the cluster, such as which applications are running and which container images they use. Nodes actually run the applications and workloads.

Hi Hamam,

I think the wording on this is causing some confusion:

  • The control plane is responsible for maintaining the desired state of the cluster, such as which applications are running and which container images they use .

You determine the the image.

When you have you application that you want to put in a container, you generally choose a base OS image and layer your application and it’s dependencies on top to form a new container image.

For example if I was developing a Python application I might choose a base image that has Python libraries pre-installed, and they I can just add my Python code.
Or if I wanted more control I could take a minimal Ubuntu image and install Python myself, and then add my Python code.
The end result is a container image with your code and all dependencies.

That container image can then be run by Docker or Kubernetes, whichever you use.
They don’t care what is inside the image, they will just execute it as you specify.

Kind regards,
Stephen

1 Like