我正在尝试通过以下命令使用JKubedeployment.yml
生成我的 Kubernetes 清单(和service.yml
) :mvn k8s:resource
但我收到了这个错误:
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< io.social.carpooling:trips-api >-------------------
[INFO] Building trips-api 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kubernetes-maven-plugin:1.1.1:resource (default-cli) @ trips-api ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.979 s
[INFO] Finished at: 2021-03-18T19:11:24+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.1.1:resource (default-cli) on project trips-api: Execution default-cli of goal org.eclipse.jkube:kubernetes-maven-plugin:1.1.1:resource failed.: NullPointerException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
这是我的pom.xml
样子:
<properties>
...
<jkube.version>1.1.1</jkube.version>
<jkube.generator.name>my-dockerhub-username/${project.artifactId}:${project.version}</jkube.generator.name>
...
</properties>
...
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>${jkube.version}</version>
<configuration>
<images>
<image>
<name>my-dockerhub-username/${project.artifactId}:${project.version}</name>
</image>
</images>
</configuration>
</plugin>
我尝试使用插件文档获取更多详细信息,但没有找到太多。有没有人成功生成 yaml 文件并部署到 Kubernetes 集群。