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

Bug 1887392: allow configuring authn/z caches TTLs #970

Merged
merged 1 commit into from Jan 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/config/serving/server.go
Expand Up @@ -39,6 +39,8 @@ func ToServerConfig(ctx context.Context, servingInfo configv1.HTTPServingInfo, a
if !authenticationConfig.Disabled {
authenticationOptions := genericapiserveroptions.NewDelegatingAuthenticationOptions()
authenticationOptions.RemoteKubeConfigFile = kubeConfigFile
// the platform generally uses 30s for /metrics scraping, avoid API request for every other /metrics request to the component
authenticationOptions.CacheTTL = 35 * time.Second

// In some cases the API server can return connection refused when getting the "extension-apiserver-authentication"
// config map.
Expand All @@ -58,6 +60,8 @@ func ToServerConfig(ctx context.Context, servingInfo configv1.HTTPServingInfo, a
if !authorizationConfig.Disabled {
authorizationOptions := genericapiserveroptions.NewDelegatingAuthorizationOptions()
authorizationOptions.RemoteKubeConfigFile = kubeConfigFile
// the platform generally uses 30s for /metrics scraping, avoid API request for every other /metrics request to the component
authorizationOptions.AllowCacheTTL = 35 * time.Second

// In some cases the API server can return connection refused when getting the "extension-apiserver-authentication"
// config map.
Expand Down