image-builder
image-builder copied to clipboard
Include ecr-credential-provider binary in CAPI images
Is your feature request related to a problem? Please describe.
There is a regression in 1.27+ based image-builder capi images, as unlike with <= 1.26.x capi images, it is no longer possible for the Kubelet to pull images from private ECR repos.
In Kubernetes 1.27, the in-tree kubelet credential provider for AWS was removed (https://github.com/kubernetes/kubernetes/pull/116329). This followed GA of the external kubelet credential provider feature in 1.26.
Describe the solution you'd like We would like the CAPV OVA templates published at https://storage.googleapis.com/capv-templates/ to include the ecr-credential-provider binary.
It is suggested that the binary be dropped into /usr/local/bin
.
If users wish to make use of the credential provider, they will be responsible for configuring the following items via KubeadmConfig.Files
and KubeadmConfig.PreKubeadmCommands
or another method of their choosing:
- IAM credentials.
- Creation of a CredentialProviderConfig file, located for example at
/etc/kubernetes/credential-provder-config
. - Adding
--image-credential-provider-bin-dir=/usr/local/bin --image-credential-provider-config=/etc/kubernetes/crededntial-provider-config
to KUBELET_EXTRA_ARGS.
Describe alternatives you've considered Use KubeadmConfig.PreKubeadmCommands to retrieve the ecr-credential-provider binary as each node is bootstrapped. Custom building images.
Additional context At my organisation, we pull most of our images from private ECR repos, so since this removal in 1.27, we need the external ecr-credential-provider binary in our CAPV machines.
It would make sense to co-ordinate the solution for this with the CAPA maintainers.
I am certain that AWS customers will want this in CAPA images. It is also fairly likely that some commercial Tanzu customers will want this functionality.
Image-builder's custom_role
functionality may be useful.
To the best of my knowledge, there is no publicly hosted binary artefact for ecr-credential-proivder. The source can be retrieved from https://github.com/kubernetes/cloud-provider-aws/releases/tag/v1.27.1 and built with:
cd cloud-provider-aws-1.27.1/cmd/ecr-credential-provider
go build
The ecr-credential-provider binary is ~20MB or 4.5MB after stripping and compressing with goupx.
/kind feature