Why imagePullPolicy cannot be changed to other than Always in Kubernetes Why imagePullPolicy cannot be changed to other than Always in Kubernetes kubernetes kubernetes

Why imagePullPolicy cannot be changed to other than Always in Kubernetes


welcome on StackOverflow.

It happens so, because your Kubernetes cluster has presumably enabled admission control plugin in api server, called 'AlwaysPullImages', which role is to overwrite (mutate) objects prior storing them in Kubernetes data store - etcd.

This is a default behavior of clusters bootstrapped with Kontena Pharos since version v2.0.0-alpha.2.

You can disable this admission plugin in your main cluster.yml config file:

...addons:  ingress-nginx:    enabled: trueadmission_plugins:  - name: AlwaysPullImages    enabled: false... 

You should expect then to see PODs failing with different status reason, if image is not found on local registry:

client-deployment-99699599d-lfqmr    0/1     ErrImageNeverPull   0          42s

Please read more on using of Admission Controllers here