You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Thomas Diesler (Jira)" <ji...@apache.org> on 2025/02/27 13:00:00 UTC

[jira] [Comment Edited] (CAMEL-21751) camel-jbang k8s cannot add trusted cert to image

    [ https://issues.apache.org/jira/browse/CAMEL-21751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17931156#comment-17931156 ] 

Thomas Diesler edited comment on CAMEL-21751 at 2/27/25 12:59 PM:
------------------------------------------------------------------

We can get this to work when we provide our own entrypoint (a slight variation of __cacert_entrypoint.sh) and add the trusted certificate like this ...

{code:xml}
                                <assembly>
                                    <layers>
                                        <layer>
                                            <id>cacert-entrypoint</id>
                                            <files>
                                                <file>
                                                    <source>etc/cacert_entrypoint.sh</source>
                                                    <outputDirectory>.</outputDirectory>
                                                    <fileMode>755</fileMode>
                                                </file>
                                            </files>
                                        </layer>
                                        <layer>
                                            <id>trusted-cert</id>
                                            <fileSets>
                                                <fileSet>
                                                    <directory>etc/tls</directory>
                                                    <outputDirectory>tls</outputDirectory>
                                                </fileSet>
                                            </fileSets>
                                        </layer>
                                    </layers>
                                </assembly>
{code}


was (Author: tdiesler):
We can get this to work when we provide our own entrypoint (a slight variation of __cacert_entrypoint.sh) and add the trusted certificate like this ...

{code:xml}
                                <assembly>
                                    <layers>
                                        <layer>
                                            <id>cacert-entrypoint</id>
                                            <files>
                                                <file>
                                                    <source>etc/cacert_entrypoint.sh</source>
                                                    <outputDirectory>.</outputDirectory>
                                                    <fileMode>755</fileMode>
                                                </file>
                                            </files>
                                        </layer>
                                        <layer>
                                            <id>trusted-cert</id>
                                            <fileSets>
                                                <fileSet>
                                                    <directory>etc/tls</directory>
                                                    <outputDirectory>./tls</outputDirectory>
                                                </fileSet>
                                            </fileSets>
                                        </layer>
                                    </layers>
                                </assembly>
{code}

> camel-jbang k8s cannot add trusted cert to image
> ------------------------------------------------
>
>                 Key: CAMEL-21751
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21751
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jbang
>            Reporter: Thomas Diesler
>            Assignee: Thomas Diesler
>            Priority: Major
>
> I have a plugin configuration like this ...
> {code:xml}
>             <plugin>
>                 <groupId>org.eclipse.jkube</groupId>
>                 <artifactId>kubernetes-maven-plugin</artifactId>
>                 <version>1.18.1</version>
>                 <configuration>
>                     <buildStrategy>docker</buildStrategy>
>                     <images>
>                         <image>
>                             <build>
>                                 <from>eclipse-temurin:17</from>
>                                 <entryPoint>
>                                     <exec>
>                                         <arg>__cacert_entrypoint.sh</arg>
>                                         <arg>java</arg>
>                                         <arg>-jar</arg>
>                                         <arg>/maven/${project.artifactId}-${project.version}.jar</arg>
>                                     </exec>
>                                 </entryPoint>
>                                 <assembly>
>                                     <layers>
>                                         <layer>
>                                             <id>trusted-certs</id>
>                                             <fileSets>
>                                                 <fileSet>
>                                                     <directory>src/main/certs</directory>
>                                                     <outputDirectory>/tmp</outputDirectory>
>                                                     <includes>
>                                                         <include>*crt</include>
>                                                     </includes>
>                                                 </fileSet>
>                                             </fileSets>
>                                         </layer>
>                                     </layers>
>                                 </assembly>
>                             </build>
>                         </image>
>                     </images>
>                 </configuration>
>                 <executions>
>                     <execution>
>                         <goals>
>                             <goal>build</goal>
>                             <goal>resource</goal>
>                             <goal>push</goal>
>                         </goals>
>                         <phase>package</phase>
>                     </execution>
>                 </executions>
>             </plugin>
> {code}
> and get 
> {code}
> [INFO] k8s: [examples/platform-http-oauth:1.0.0]: Created docker-build.tar in 86 milliseconds
> [INFO] k8s: Step 1/4 : FROM eclipse-temurin:17
> [INFO] k8s: 
> [INFO] k8s: ---> 1e83e0efd1de
> [INFO] k8s: Step 2/4 : COPY /trusted-certs/maven /maven/
> [INFO] k8s: 
> [ERROR] k8s: Failed to execute the build [Error while trying to build the image: Unable to build image [examples/platform-http-oauth:1.0.0] : "COPY failed: file not found in build context or excluded by .dockerignore: stat trusted-certs/maven: file does not exist" ]
> {code}
> or 
> {code}
> [ERROR] k8s: Failed to execute the build [Error while trying to build the image: Cannot create directory '/certificates'.]
> {code}
> CrossRef: https://github.com/eclipse-jkube/jkube/issues/3672
>  



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