imagePullPolicy configuration not working
See original GitHub issueInfo
I have a following configuration as mentioned by documentation.
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${fmp.version}</version>
<configuration>
<images>
<image>
<name>username/repository:${project.build.finalName}</name>
<build>
<from>java:8</from>
<maintainer>maintainer</maintainer>
<assembly>
<name>assembly</name>
<targetDir>/user/local/projects</targetDir>
<descriptorRef>artifact</descriptorRef>
</assembly>
<entryPoint>
<exec>
<arg>java</arg>
<arg>-Xmx128m</arg>
<arg>-jar</arg>
<arg>/user/local/projects/${project.build.finalName}.jar</arg>
</exec>
</entryPoint>
<ports>
<port>${port}</port>
</ports>
<imagePullPolicy>Always</imagePullPolicy>
</build>
</image>
</images>
</configuration>
</plugin>
Also my deployment.yml is minimal.
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${project.artifactId}
labels:
app: ${project.artifactId}
spec:
replicas: 1
selector:
matchLabels:
app: ${project.artifactId}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: ${project.artifactId}
Everything works fine, only imagePullPolicy is always ifNotPresent in generated deployment.yml file. I am trying to make it to Always as you can see in configuration file. I tried using enricher as well as mentioned in this https://stackoverflow.com/questions/45746984/how-to-configure-imagepullpolicy-from-fabric8-maven-plugin, but no success yet.
- f-m-p version : 4.1.0
- Maven version (
mvn -v
) : 3.3.9
UPDATE
The above mentioned stackoverflow solution works only in case we don’t have explicitly written deployment.yml under fabric8 folder. In case we are enriching already existing deployment.yml file, we must use fmp-controller-from-configuration
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Kubernetes: --image-pull-policy always does not work
The image pull policy specifies how to acquire the image to run the container. Always means it will try to pull a new...
Read more >imagePullPolicy Setup Seems to not working as expected
hello,. I setup pull_policy = "if-not-present" in my runner config for k8s and for docker but the runner is still getting images from...
Read more >Images - Kubernetes
Image pull policy · IfNotPresent: the image is pulled only if it is not already present locally. · Always: every time the kubelet...
Read more >Kubernetes Image Pull Policy: A Definitive Guide - ContainIQ
To use an image in a cluster, its name and registry are specified in the POD or Deployment configuration file. If a registry...
Read more >Kubernetes How to: Ensure imagePullPolicy set to Always
In the Kubernetes config, you can just specify tag 1.2, ... Avoid problems with images by ensuring that imagePullPolicy is set to Always....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mani-rai : DefaultControllerEnricher was splitted into two enrichers, see #401 , now fragments are handled by a different enricher. So you should use this configuration:
Thanks @rohanKanojia. The given solution is working.