I've been able to build and deploy my spring boot service image into openshift using fabric8 plugin.
I need to add some configmap.
I've tried to add an striaghtforward configmap.yml into src/main/fabric8.
Currently, I'm getting this message:
[INFO] --- fabric8-maven-plugin:4.4.1:resource (default-cli) @ connector ---
[INFO] F8: Using Container image name of namespace: arxius-linia
[INFO] F8: Running generator spring-boot
[INFO] F8: spring-boot: Using Container image fabric8/java-centos-openjdk11-jdk:1.6.3 as base / builder
[INFO] F8: using resource templates from /home/jeusdi/projects/arxius-linia/connector/src/main/fabric8
[INFO] F8: fmp-controller: Adding a default Deployment
[INFO] F8: fmp-service: Adding a default service 'connector' with ports [8080]
[WARNING] F8: fmp-git: Could not detect any git remote
[WARNING] F8: fmp-git: Could not detect any git remote
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.839 s
[INFO] Finished at: 2020-11-25T14:08:29+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:4.4.1:resource (default-cli) on project connector: Execution default-cli of goal io.fabric8:fabric8-maven-plugin:4.4.1:resource failed.: NullPointerException -> [Help 1]
My configmap.yml is:
data:
application.properties: |
spring.profiles.active=dev
My current related pom.xml configuration is:
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>4.4.1</version>
</plugin>
</plugins>
</build>
It's zero configuration based.
Any ideas about how to add my configmap.yml?
I'm from Fabric8/Eclipse JKube team.
As I've mentioned in the comment, you should try switching to Eclipse JKube since it's going to be supported in future. Migrating to Eclipse JKube is as simple as running this goal:
I tried out your
ConfigMapresource fragment with this version ofkubernetes-maven-pluginin one of my demo projects:I added your
ConfigMapto mysrc/main/jkubedirectory:When I did
mvn k8s:resource k8s:apply, I was able to seeConfigMapbeing created:When I checked, I was able to see
ConfigMapcreated indefaultnamespace: