k8s
k8s copied to clipboard
Feature/awscliv2
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
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.
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 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
@ozbillwang, shall I make any other changes for this image?
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.
also maybe need to specify kubectl version (1.23.6) instead of latest https://github.com/actions/virtual-environments/issues/5493#issuecomment-1118447292
@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 have you checked this comment? https://github.com/alpine-docker/k8s/pull/31#discussion_r851463552
oh, I missed that comment, let me check
Is this PR abandoned, and is it missing something?
Is this PR abandoned, and is it missing something?
Kinda abandoned I suppose 😃
If all packages are still available then it still should work