jkube: k8s:push failed with aws ecr credential helper for docker
Description
I have aws ecr credential helper for docker install on Ubuntu 20.04
{
"credsStore": "ecr-login"
}
the setup works well, if i use native docker cli to pull or push.
however, when i tried with jkube maven plugin 1.1.0, 1.2.0. or 1.3.0, got the same error below Error: k8s: null
[INFO] --- kubernetes-maven-plugin:1.3.0:push (default-cli) @ feed-product-service ---
[INFO] k8s: Running in Kubernetes mode
[INFO] k8s: Building Docker image in Kubernetes mode
[INFO] k8s: Generators:
[INFO] k8s: - quarkus
[INFO] k8s: - spring-boot
[INFO] k8s: - wildfly-swarm
[INFO] k8s: - thorntail-v2
[INFO] k8s: - wildfly-jar
[INFO] k8s: - openliberty
[INFO] k8s: - karaf
[INFO] k8s: - vertx
[INFO] k8s: - micronaut
[INFO] k8s: - java-exec
[INFO] k8s: - webapp
Error: k8s: null
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:07 min
[INFO] Finished at: 2021-05-18T09:41:56-07:00
[INFO] ------------------------------------------------------------------------
Error: Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.3.0:push (default-cli) on project my-service: null: MojoExecutionException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.jkube:kubernetes-maven-plugin:1.3.0:push (default-cli) on project feed-product-service: null
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Caused by: org.apache.maven.plugin.MojoExecutionException
at org.eclipse.jkube.maven.plugin.mojo.build.PushMojo.executeInternal (PushMojo.java:61)
at org.eclipse.jkube.maven.plugin.mojo.build.AbstractDockerMojo.execute (AbstractDockerMojo.java:444)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:39)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:122)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:61)
Error:
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/MojoExecutionException
Error: Process completed with exit code 1.
my project is a spring boot app, the k8s:build works, and below is the kubernetes-maven-plugin config in pom.xml
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>1.3.0</version>
<configuration>
<verbose>true</verbose>
<registry><my_account_id_masked>.dkr.ecr.us-west-2.amazonaws.com</registry>
<images>
<image>
<name>my-service:${docker.image.tag}</name>
<build>
<dockerFile>${project.basedir}/Dockerfile</dockerFile>
<args>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
<ASSEMBLY_PATH>target</ASSEMBLY_PATH>
</args>
<assembly>
<name>target</name>
</assembly>
</build>
</image>
</images>
</configuration>
</plugin>
Info
- Eclipse JKube version : 1.3.0
- Maven version (
mvn -v) : 3.6.3 with Java 11
-
Kubernetes / Red Hat OpenShift setup and version :
-
If it’s a bug, how to reproduce :
-
If it’s a feature request, what is your use case :
-
Sample Reproducer Project : [GitHub Clone URL]
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (10 by maintainers)
Commits related to this issue
- Update ECR authorization Token URL Port of https://github.com/fabric8io/docker-maven-plugin/pull/1318 Related to https://github.com/eclipse/jkube/issues/702 — committed to rohanKanojia/jkube by rohanKanojia 3 years ago
- Update ECR authorization Token URL Port of https://github.com/fabric8io/docker-maven-plugin/pull/1318 Related to https://github.com/eclipse/jkube/issues/702 Signed-off-by: Rohan Kumar <rohaan@redha... — committed to rohanKanojia/jkube by rohanKanojia 3 years ago
- Update ECR authorization Token URL Port of https://github.com/fabric8io/docker-maven-plugin/pull/1318 Related to https://github.com/eclipse/jkube/issues/702 Signed-off-by: Rohan Kumar <rohaan@redha... — committed to rohanKanojia/jkube by rohanKanojia 3 years ago
- Update ECR authorization Token URL Port of https://github.com/fabric8io/docker-maven-plugin/pull/1318 Related to https://github.com/eclipse/jkube/issues/702 Signed-off-by: Rohan Kumar <rohaan@redha... — committed to eclipse/jkube by rohanKanojia 3 years ago
- Fetch AWS Credentials from AWS SDK/Environment variables Add support in AuthConfigFactory to retrieve credentials from different mechanisms for AWS. Port of https://github.com/fabric8io/docker-maven... — committed to rohanKanojia/jkube by rohanKanojia 3 years ago
- Fetch AWS Credentials from AWS SDK/Environment variables Add support in AuthConfigFactory to retrieve credentials from different mechanisms for AWS. Port of https://github.com/fabric8io/docker-maven... — committed to rohanKanojia/jkube by rohanKanojia 3 years ago
- Fetch AWS Credentials from AWS SDK/Environment variables Add support in AuthConfigFactory to retrieve credentials from different mechanisms for AWS. Port of https://github.com/fabric8io/docker-maven... — committed to rohanKanojia/jkube by rohanKanojia 3 years ago
- Fetch AWS Credentials from AWS SDK/Environment variables Add support in AuthConfigFactory to retrieve credentials from different mechanisms for AWS. Port of https://github.com/fabric8io/docker-maven... — committed to rohanKanojia/jkube by rohanKanojia 3 years ago
- Fetch AWS Credentials from AWS SDK/Environment variables Add support in AuthConfigFactory to retrieve credentials from different mechanisms for AWS. Port of https://github.com/fabric8io/docker-maven... — committed to rohanKanojia/jkube by rohanKanojia 3 years ago
- Fetch AWS Credentials from AWS SDK/Environment variables Add support in AuthConfigFactory to retrieve credentials from different mechanisms for AWS. Port of https://github.com/fabric8io/docker-maven... — committed to rohanKanojia/jkube by rohanKanojia 3 years ago
- Fetch AWS Credentials from AWS SDK/Environment variables Add support in AuthConfigFactory to retrieve credentials from different mechanisms for AWS. Port of https://github.com/fabric8io/docker-maven... — committed to eclipse/jkube by rohanKanojia 3 years ago
@manusa , i think better to update the doc with mentioning the above plugin dependencies for ECR login
hi @rohanKanojia
No. I have IAM role for service account (IRSA) attached on my build pod in k8s. i assume the AWS Java SDK should be able to login with AWS_WEB_IDENTITY_TOKEN_FILE.
BTW, DMP works for me, yes pls port the change i can test it.
Thanks, Nick