k8s icon indicating copy to clipboard operation
k8s copied to clipboard

Feature/awscliv2

Open Orachigami opened this issue 2 years ago • 13 comments

Replaced aws-cli v1 with aws-cli v2. aws-cli v2.1.39 is compatible with gcompat + groff

https://github.com/aws/aws-cli/issues/4685

Orachigami avatar Apr 05 '22 13:04 Orachigami

that's great. Let me review.

In fact, I worked on this feature before via

https://github.com/alpine-docker/k8s/pull/10

https://github.com/alpine-docker/k8s/issues/9

but can't work it out at that time.

ozbillwang avatar Apr 08 '22 03:04 ozbillwang

I'd like to keep both versions, I explained it in https://github.com/alpine-docker/k8s/pull/10

We need keep compatible in this image.

  • install both aws cli v1 and v2 in same image
  • set ENTRYPOINT to switch default aws cli version when run the container.
    • if environment variable awscli is set to v2, default aws cli version is v2
    • if environment variable awscli is set to v1, not set or set to anything else, except v2, aws cli will be run from /usr/bin, and version is v1
  • you can still run specific version with full path in container.
$ docker build -t k8s .
$ docker run -ti --rm -e awscli=v2 k8s aws --version
aws-cli/2.1.22 Python/3.7.3 Linux/4.19.121-linuxkit exe/x86_64.alpine.3 prompt/off
$ docker run -ti --rm -e awscli=v1 k8s aws --version
aws-cli/1.18.223 Python/3.8.7 Linux/4.19.121-linuxkit botocore/1.19.63
$ docker run -ti --rm k8s --version
aws-cli/1.18.223 Python/3.8.7 Linux/4.19.121-linuxkit botocore/1.19.63

can you adjust your codes to keep both versions?

ozbillwang avatar Apr 12 '22 09:04 ozbillwang

@ozbillwang added entrypoint script, results here:

$ docker build -t k8s .
$ docker run -ti --rm -e awscli=v2 k8s aws --version
aws-cli/2.1.39 Python/3.8.8 Linux/5.10.76-linuxkit exe/x86_64.alpine.3 prompt/off
$ docker run -ti --rm k8s aws --version
aws-cli/1.22.96 Python/3.9.7 Linux/5.10.76-linuxkit botocore/1.24.41
$ docker run -ti --rm -e awscli=100500 k8s aws --version
aws-cli/1.22.96 Python/3.9.7 Linux/5.10.76-linuxkit botocore/1.24.41

I reread your message and reverted aws iam authenticator to Dockerfile for compatibility

Orachigami avatar Apr 14 '22 19:04 Orachigami

@ozbillwang, shall I make any other changes for this image?

Orachigami avatar Jun 06 '22 21:06 Orachigami

how can I use / test this? I am using AWS v2 and I can't get helm work on a k8s 1.22 cluster (AWS EKS). Wondering is it because AWS v1 is not supported anymore.

Also the latest AWS v2 seems to be aws-cli/2.4.5.

yi-yang-github avatar Jun 06 '22 23:06 yi-yang-github

also maybe need to specify kubectl version (1.23.6) instead of latest https://github.com/actions/virtual-environments/issues/5493#issuecomment-1118447292

yi-yang-github avatar Jun 06 '22 23:06 yi-yang-github

@Orachigami

So should we lock the aws v2 version in Dockerfile, or we can always install the latest version? I put the comments before.

ozbillwang avatar Jun 07 '22 02:06 ozbillwang

@ozbillwang have you checked this comment? https://github.com/alpine-docker/k8s/pull/31#discussion_r851463552

Orachigami avatar Jun 09 '22 10:06 Orachigami

oh, I missed that comment, let me check

ozbillwang avatar Jun 09 '22 22:06 ozbillwang

Is this PR abandoned, and is it missing something?

bombergio avatar Jun 27 '24 14:06 bombergio

Is this PR abandoned, and is it missing something?

Kinda abandoned I suppose 😃

If all packages are still available then it still should work

Orachigami avatar Jun 28 '24 20:06 Orachigami