Skip to content

Upgrade to AWS SDK for java v2 #3732

@bernermic

Description

@bernermic

Component

JKube Kit

Is your enhancement related to a problem? Please describe

Hey guys,

AWS announced an EOL date for AWS SDK for java v1

I tried to upgrade to the latest AWS SDK in v2 and then the ECR authentication stops to log in via AWS SDK.

I assume this is not yet implemented. Are there any plans to do so?

Best regards

Describe the solution you'd like

AWS SDK can be used for loading credentials from WebIdentityTokenCredentialsProvider

[DEBUG] k8s: AuthConfig: AWS credentials from AWS SDK
[DEBUG] k8s: registry = ....dkr.ecr.eu-central-1.amazonaws.com, isValid= true
[DEBUG] k8s: Get ECR AuthorizationToken from api.ecr.eu-central-1.amazonaws.com
[DEBUG] k8s: Response status 200

Describe alternatives you've considered

Doing a docker login against aws ecr before starting maven build probably would be the alternative.

Additional context

Log shows:
[INFO] k8s: Generators:
[INFO] k8s: - dockerfile-simple
[INFO] k8s: - quarkus
[INFO] k8s: - spring-boot
[INFO] k8s: - thorntail-v2
[INFO] k8s: - wildfly-jar
[INFO] k8s: - openliberty
[INFO] k8s: - karaf
[INFO] k8s: - vertx
[INFO] k8s: - micronaut
[INFO] k8s: - helidon
[INFO] k8s: - java-exec
[INFO] k8s: - webapp
[INFO] k8s: It appears that you're using AWS ECR. Consider integrating the AWS SDK in order to make use of common AWS authentication mechanisms, see https://www.eclipse.dev/jkube/docs/kubernetes-maven-plugin#extended-authentication
[ERROR] k8s: Failed to execute the build [Error while trying to build the image: Unable to pull 'eclipse-temurin:21' from registry '....dkr.ecr.eu-central-1.amazonaws.com' : {"message":"Head "https://....dkr.ecr.eu-central-1.amazonaws.com/v2/eclipse-temurin/manifests/21": no basic auth credentials"} (Internal Server Error: 500)]

My pom looks like this

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.jkube</groupId>
            <artifactId>kubernetes-maven-plugin</artifactId>
            <version>1.18.1</version>
            <dependencies>
              <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>sdk-core</artifactId>
                <version>2.32.11</version>
              </dependency>
              <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>sts</artifactId>
                <version>2.32.11</version>
              </dependency>
            </dependencies>

            <executions>
                <execution>
                    <goals>
                        <goal>build</goal>
                        <goal>push</goal>
                    </goals>
                </execution>
            </executions>

            <configuration>
                <pullRegistry>redacted.dkr.ecr.eu-central-1.amazonaws.com</pullRegistry>
                <pushRegistry>redacted.dkr.ecr.eu-central-1.amazonaws.com</pushRegistry>

                <images>
                    <image>
                        <registry>redacted.dkr.ecr.eu-central-1.amazonaws.com</registry>
                        ...
                    </image>
                </images>

                <verbose>true</verbose>
            </configuration>
        </plugin>
    </plugins>
</build>

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions