Skip to content

Latest commit

 

History

History
93 lines (75 loc) · 2.65 KB

jkubekubernetesplugin.adoc

File metadata and controls

93 lines (75 loc) · 2.65 KB

Jkube Kubernetes Plugin

Plugin configuration

      <plugin>
        <groupId>org.eclipse.jkube</groupId>
        <artifactId>kubernetes-maven-plugin</artifactId>
        <version>1.10.1</version>
        <configuration>
          <buildStrategy>jib</buildStrategy>
          <images>
            <image>
              <name>localhost:5000/firstimage/${project.artifactId}:%l</name>
              <build>
                <from>eclipse-temurin:11</from>
                <assembly>
                  <mode>dir</mode>
                  <targetDir>/deployments</targetDir>
                  <layers>
                    <layer>
                      <id>dependencies</id>
                      <fileSets>
                        <fileSet>
                          <directory>${project.basedir}/../context/dependencies</directory>
                          <outputDirectory>dependencies</outputDirectory>
                        </fileSet>
                      </fileSets>
                    </layer>
                  </layers>
                  <excludeFinalOutputArtifact>true</excludeFinalOutputArtifact>
                </assembly>
                <cmd>
                  <shell>jshell</shell>
                </cmd>
              </build>
            </image>
          </images>
        </configuration>
      </plugin>

By default the plugin send the packaged application to /maven.

Default image
Figure 1. Default image

The assembly configuration is used to override the default build from the plugin to create the specific layer containing the context content as it is in /deployments/dependencies.

The maven command used is k8s:build k8s:push. An example would be :

mvn -e k8s:build k8s:push -Dmaven.repo.local=/tmp/artifacts/m2 --global-settings /tmp/kit-cfkvvqjdm89s73c9irb0-351212210/maven/settings.xml -Dmaven.artifact.threads=12 -T 12

Incremental build

✔️
Incremental build is validated
First image
Figure 2. First image
Second image
Figure 3. Second image
Third image
Figure 4. Third image

Multi-architecture

Multi-architecture is not available

The Jkube Kubernetes maven plugin does not yet provides any way to build images for multiple architectures : eclipse-jkube/jkube#1876.