Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't configure MinTokenExpiration #155

Open
everpeace opened this issue Jun 10, 2022 · 0 comments
Open

Can't configure MinTokenExpiration #155

everpeace opened this issue Jun 10, 2022 · 0 comments

Comments

@everpeace
Copy link

everpeace commented Jun 10, 2022

What would you like to be added:

make MinTokenExpiration configurable because there is no way to configure token expiration duration less than this value

Why is this needed:

Although the comment of MinTokenExpiration says:

// 1hr is min for kube-apiserver
MinTokenExpiration = int64(3600)

k8s API says:

https://github.com/kubernetes/api/blob/1eb735bf86030410bc1d8323332500c7502dad70/core/v1/types.go#L1667-L1674

type ServiceAccountTokenProjection struct {
...
	// expirationSeconds is the requested duration of validity of the service
	// account token. As the token approaches expiration, the kubelet volume
	// plugin will proactively rotate the service account token. The kubelet will
	// start trying to rotate the token if the token is older than 80 percent of
	// its time to live or if the token is older than 24 hours.Defaults to 1 hour
	// and must be at least 10 minutes.
	//+optional
	ExpirationSeconds *int64 `json:"expirationSeconds,omitempty" protobuf:"varint,2,opt,name=expirationSeconds"`

Thus, token expiration can configure more shorter value. However, it is not possible for users to change it. I think making MinTokenExpiration configurable with validation(at least 10 min) is reasonable.

I'm very welcome to contribute to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant