Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(this is the first of two PRs addressing the challenge described below, link to the second one is at the bottom)
A big thing that is happening in the k8s world is the release of Kubernetes 1.21, in which BoundServiceAccountTokenVolume got graduated to beta and is enabled by default. In particular, it will be enabled and used in AWS hosted k8s.
Release notes: https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html#kubernetes-1.21 (see the first
Important
banner).In short, this means that the auth token available within the cluster (in
/var/run/secrets/kubernetes.io/serviceaccount/token
) will now have an expiration time.This means that we can no longer provide a token upon creation of the
KubeConfig
and expect it to work (it might expire in an hour or in a minute – we don't know).This PR introduces a change to the way
KubeConfig
is created (when providing a token): the user will need to provide a token inside anF[_]
and the client will evaluate it every time it needs a token.If the user wants to keep the previous behaviour, they can provide
theToken.pure[F]
.Most of the files here have been changed solely because
KubeConfig
now has a type parameter:The second PR is built on top of this one and introduces more functionality related to this matter, as well as some improvements: #173