[ 
https://issues.apache.org/jira/browse/CAMEL-21007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Diesler updated CAMEL-21007:
-----------------------------------
    Description: 
Currently we build a multiarch image like this ...

{code}
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>${camel.springboot.jib.version}</version>
                <configuration>
                    <from>
                        <image>eclipse-temurin:17</image>
                        <platforms>
                            <platform>
                                <architecture>amd64</architecture>
                                <os>linux</os>
                            </platform>
                            <platform>
                                <architecture>arm64</architecture>
                                <os>linux</os>
                            </platform>
                        </platforms>
                    </from>
                    <to>
                        <image>${camel.springboot.kubernetes.image-name}</image>
                    </to>
                    <allowInsecureRegistries>true</allowInsecureRegistries>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>dockerBuild</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
{code}

and later reference it in JKube like this ...

{code}
            <plugin>
                <groupId>org.eclipse.jkube</groupId>
                <artifactId>kubernetes-maven-plugin</artifactId>
                <version>${camel.springboot.jkube.version}</version>
                <configuration>
                    
<imagePullPolicy>${camel.springboot.kubernetes.image-pull-policy}</imagePullPolicy>
                    <buildStrategy>jib</buildStrategy>
                    <images>
                        <image>
                            
<name>${camel.springboot.kubernetes.image-name}</name>
                        </image>
                    </images>
                    <resources>
                        <labels>
                            <all>
                                <property>
                                    <name>camel.apache.org/integration</name>
                                    <value>${project.artifactId}</value>
                                </property>
                                <property>
                                    <name>app.kubernetes.io/runtime</name>
                                    <value>camel</value>
                                </property>
                            </all>
                        </labels>
                    </resources>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>resource</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
{code}

We also need to explicitly set property `jkube.generator.name`, otherwise 
kubernetes.yml may not reference the correct image name.

Perhaps this would better all be done by the JKube plugin

  was:
Currently we build a multiarch image like this ...

{code}
            <plugin>
                <groupId>com.google.cloud.tools</groupId>
                <artifactId>jib-maven-plugin</artifactId>
                <version>${camel.springboot.jib.version}</version>
                <configuration>
                    <from>
                        <image>eclipse-temurin:17</image>
                        <platforms>
                            <platform>
                                <architecture>amd64</architecture>
                                <os>linux</os>
                            </platform>
                            <platform>
                                <architecture>arm64</architecture>
                                <os>linux</os>
                            </platform>
                        </platforms>
                    </from>
                    <to>
                        <image>${camel.springboot.kubernetes.image-name}</image>
                    </to>
                    <allowInsecureRegistries>true</allowInsecureRegistries>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>dockerBuild</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
{code}

and later reference it on JKube like this ...

{code}
            <plugin>
                <groupId>org.eclipse.jkube</groupId>
                <artifactId>kubernetes-maven-plugin</artifactId>
                <version>${camel.springboot.jkube.version}</version>
                <configuration>
                    
<imagePullPolicy>${camel.springboot.kubernetes.image-pull-policy}</imagePullPolicy>
                    <buildStrategy>jib</buildStrategy>
                    <images>
                        <image>
                            
<name>${camel.springboot.kubernetes.image-name}</name>
                        </image>
                    </images>
                    <resources>
                        <labels>
                            <all>
                                <property>
                                    <name>camel.apache.org/integration</name>
                                    <value>${project.artifactId}</value>
                                </property>
                                <property>
                                    <name>app.kubernetes.io/runtime</name>
                                    <value>camel</value>
                                </property>
                            </all>
                        </labels>
                    </resources>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>resource</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
{code}

We also need to explicitly set property `jkube.generator.name`, otherwise 
kubernetes.yml may not reference the correct image name.

Perhaps this would better all be done by the JKube plugin


> camel-jbang: Find a way to build a multiarch image with jkube
> -------------------------------------------------------------
>
>                 Key: CAMEL-21007
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21007
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jbang
>            Reporter: Thomas Diesler
>            Priority: Major
>
> Currently we build a multiarch image like this ...
> {code}
>             <plugin>
>                 <groupId>com.google.cloud.tools</groupId>
>                 <artifactId>jib-maven-plugin</artifactId>
>                 <version>${camel.springboot.jib.version}</version>
>                 <configuration>
>                     <from>
>                         <image>eclipse-temurin:17</image>
>                         <platforms>
>                             <platform>
>                                 <architecture>amd64</architecture>
>                                 <os>linux</os>
>                             </platform>
>                             <platform>
>                                 <architecture>arm64</architecture>
>                                 <os>linux</os>
>                             </platform>
>                         </platforms>
>                     </from>
>                     <to>
>                         
> <image>${camel.springboot.kubernetes.image-name}</image>
>                     </to>
>                     <allowInsecureRegistries>true</allowInsecureRegistries>
>                 </configuration>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>dockerBuild</goal>
>                         </goals>
>                         <phase>package</phase>
>                     </execution>
>                 </executions>
>             </plugin>
> {code}
> and later reference it in JKube like this ...
> {code}
>             <plugin>
>                 <groupId>org.eclipse.jkube</groupId>
>                 <artifactId>kubernetes-maven-plugin</artifactId>
>                 <version>${camel.springboot.jkube.version}</version>
>                 <configuration>
>                     
> <imagePullPolicy>${camel.springboot.kubernetes.image-pull-policy}</imagePullPolicy>
>                     <buildStrategy>jib</buildStrategy>
>                     <images>
>                         <image>
>                             
> <name>${camel.springboot.kubernetes.image-name}</name>
>                         </image>
>                     </images>
>                     <resources>
>                         <labels>
>                             <all>
>                                 <property>
>                                     <name>camel.apache.org/integration</name>
>                                     <value>${project.artifactId}</value>
>                                 </property>
>                                 <property>
>                                     <name>app.kubernetes.io/runtime</name>
>                                     <value>camel</value>
>                                 </property>
>                             </all>
>                         </labels>
>                     </resources>
>                 </configuration>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>resource</goal>
>                         </goals>
>                         <phase>package</phase>
>                     </execution>
>                 </executions>
>             </plugin>
> {code}
> We also need to explicitly set property `jkube.generator.name`, otherwise 
> kubernetes.yml may not reference the correct image name.
> Perhaps this would better all be done by the JKube plugin



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to