How to configure imagePullPolicy from fabric8-maven-plugin -
context:
i'm using fabric8-maven-plugin generate docker image , deploy kubernetes cluster.
question:
it's possible configure imagepullpolicy parameter default value ifnotpresent?
current configuration in pom.xml
<build> <plugins> <plugin> <groupid>io.fabric8</groupid> <artifactid>fabric8-maven-plugin</artifactid> <version>3.5.25</version> <configuration> <images> <image> <name>my-service</name> <alias>service</alias> <build> <from>java:8</from> <tags> <tag>latest</tag> <tag>${project.version}</tag> </tags> <!-- entry point path used "maven/" since default folder: https://dmp.fabric8.io/#building-images, "launch.sh" copied container based in assembly.xml descriptor file. --> <entrypoint> <exec> <arg>maven/launch.sh</arg> </exec> </entrypoint> <assembly> <descriptor>assembly.xml</descriptor> </assembly> </build> </image> </images> <generator> <includes> <include>java-exec</include> </includes> <config> <java-exec> <webport>8080</webport> </java-exec> </config> </generator> </configuration> </plugin> </plugins> </build>
what got is:
spec: containers: - env: - name: kubernetes_namespace valuefrom: fieldref: fieldpath: metadata.namespace image: 394148814603.dkr.ecr.us-east-1.amazonaws.com/dkrecr-nafiux-ncp/kcluster-ncp-myservice imagepullpolicy: ifnotpresent <---- want personalize value always, instance. name: service securitycontext: privileged: false
why want change value always? because i'm doing lot of tests cluster, , don't want assign new version docker image each test do, @ point.
i appreciate support.
finally found parameter looking for:
1) add latest docker image:
<name>myservice:latest</name>
2) add pullpolicy in enricher configuration.
<enricher> <config> <fmp-controller> <pullpolicy>always</pullpolicy> </fmp-controller> </config> </enricher>
full example:
<build> <plugins> <plugin> <groupid>io.fabric8</groupid> <artifactid>fabric8-maven-plugin</artifactid> <version>3.5.25</version> <configuration> <images> <image> <alias>service</alias> <name>myservice:latest</name> <build> <from>java:8</from> <tags> <tag>latest</tag> <tag>${project.version}</tag> </tags> <!-- entry point path used "maven/" since default folder: https://dmp.fabric8.io/#building-images, "launch.sh" copied container based in assembly.xml descriptor file. --> <entrypoint> <exec> <arg>maven/launch.sh</arg> </exec> </entrypoint> <assembly> <descriptor>assembly.xml</descriptor> </assembly> </build> </image> </images> <generator> <includes> <include>java-exec</include> </includes> <config> <java-exec> <webport>8080</webport> </java-exec> </config> </generator> <enricher> <config> <fmp-controller> <pullpolicy>always</pullpolicy> </fmp-controller> </config> </enricher> </configuration> </plugin> </plugins> </build>
Comments
Post a Comment