With Alauda Container Platform you can interact with images, depending on where the registries of the images are located, any authentication requirements around those registries, and how you want your builds and deployments to behave.
Each container in a pod has a container image. After you have created an image and pushed it to a registry, you can then refer to it in the pod.
When Alauda Container Platform creates containers, it uses the container imagePullPolicy
to determine if the image should be pulled prior to starting the container. There are three possible values for imagePullPolicy
:
Table imagePullPolicy
values:
Value | Description |
---|---|
Always | Always pull the image. |
IfNotPresent | Only pull the image if it does not already exist on the node. |
Never | Never pull the image. |
If a container imagePullPolicy parameter is not specified, Alauda Container Platform sets it based on the image tag:
If you are using the Alauda Container Platform image registry, then your pod service account should already have the correct permissions and no additional action should be required.
However, for other scenarios, such as referencing images across Alauda Container Platform projects or from secured registries, additional configuration steps are required.
To pull a secured container from other private or secured registries, you must create a pull secret from your container client credentials, such as Docker
, and add it to your service account.
Docker use a configuration file to store authentication details to log in to secured or insecure registry:
By default, Docker uses $HOME/.docker/config.json.
These files store your authentication information if you have previously logged in to a secured or insecure registry.
You can obtain the image pull secret to pull an image from a private container image registry or repository. You can refer to Pull an Image from a Private Registry.
You can use a pull secret to allow workloads to pull images from a private registry with one of the following methods:
ServiceAccount
, which automatically applies the secret to all pods using that service account.imagePullSecrets
in the pod specification, which is useful for environments like GitOps or ArgoCD.You can use a secret for pulling images for pods by adding the secret to your service account. Note that the name of the service account should match the name of the service account that pod uses.
Example output:
Instead of linking the secret to a service account, you can alternatively reference it directly in your pod or workload definition. This is useful for GitOps workflows such as ArgoCD. For example:
Example pod specification:
Example ArgoCD workflow: