【发布时间】:2017-08-18 16:34:21
【问题描述】:
上下文:
我正在使用 fabric8-maven-plugin 生成 docker 映像并将其部署到 Kubernetes 集群。
问题:
是否可以配置默认值为IfNotPresent的imagePullPolicy参数?
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>
<!--
The entry point path used is "maven/" since this is the default folder: https://dmp.fabric8.io/#building-images,
"launch.sh" is copied to the container based in the 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>
我得到的是:
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 <---- I want to personalize this value to Always, for instance.
name: service
securityContext:
privileged: false
为什么我要将值更改为始终?主要是因为我正在对集群进行大量测试,此时我不想为我所做的每个测试分配一个新版本到 docker 映像。
感谢您的支持。
【问题讨论】:
标签: fabric8