feat(hatchery/kubernetes): make default ImagePullPolicy configurable #5402
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This modifies
hatchery:kubernetes
configuration to add adefaultPullPolicy
configuration field for hatchery config.If defined, it sets
ImagePullPolicy
field in worker pod specs, which by default is set toAlways
by Kubernetes.The config field is named
defaultPullPolicy
in case the pull policy become customizable per worker-model in a future release.When no value is given, it's defaulted to
Always
in order to fallback to the current behaviour.ImagePullPolicy = Never
is needed mainly for developing and testing worker images, for example in a dev environment like minikube, kind, kubernetes for windows, or more generally when uploading to a registry is undesirable.ImagePullPolicy = IfNotPresent
could be usefull to not block a pipeline execution if the registry is down while the image is already present on the node.About tests
When a worker pod is started (or during registration), run a
kubectl describe pod <worker pod name> -o yaml
and verify theimagePullPolicy
value on the pod's container specMentions
@ovh/cds
Signed-off-by: phsym [email protected]