我试着使用JKube的maven插件。我有一个私有的docker存储库,我在pom.xml中指定了它,如下所示:
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>${jkube.version}</version>
<configuration>
<registry>zamek.xxx:nnnn</registry>
<images>
<image>
<name>helloworld-java:${project.version}</name>
<alias>hello-world</alias>
<build>
<from>openjdk:latest</from>
<cmd>java -jar maven/${project.artifactId}-${project.version}.jar</cmd>
</build>
<run>
<wait>
<log>Hello World!</log>
</wait>
</run>
</image>
</images>
<resources>
<secrets>
<secret>
<dockerServerId>zamek.xxx:nnnn</dockerServerId>
<name>hello-world-secret</name>
</secret>
</secrets>
</resources>
</configuration>
</plugin>
</plugins>
</build>它创建了hello-world-secrets,并且包含了所有内容。但是插件不会在生成的helloworld-deployment.yml中创建imagePullSecret。然后我尝试在我的src/main/jkube目录中创建一个名为deployment.yaml的模板:
---
spec:
imagePullSecrets:
-name: hello-world-secret但是插件没有生成包含imagePullSecret的部署。如何指定我的私有docker注册表?
thx,Zamek
发布于 2021-11-19 15:54:39
这是我的错误,因为我的模板错了。这是正确的deployment.yaml:
---
spec:
template:
spec:
imagePullSecrets:
- name: hello-world-secrethttps://stackoverflow.com/questions/70025380
复制相似问题