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

Improve resilience when reconciling OIDC resources that require remote JWKS #154

Open
dimityrmirchev opened this issue May 9, 2024 · 0 comments
Labels
kind/enhancement Enhancement, improvement, extension

Comments

@dimityrmirchev
Copy link
Member

What would you like to be added:
The logic that immediately removes the authentication handler when a request to retrieve a remote JWKS fails can be improved to better handle intermittent failures.

keySet, err = remoteKeySet(ctx, config.Spec.IssuerURL, config.Spec.CABundle)
if err != nil {
log.Error(err, "Invalid remote JWKS KeySet")
r.deleteHandler(req.Name)
return reconcile.Result{RequeueAfter: 10 * time.Second}, nil
}

It would be better to implement a retry mechanism that tries the request a couple of times before finally removing the auth handler from store. This will improve stability of the service. In addition to that the default resync period can be increased from its current default value of 10min.

fs.DurationVar(&s.Duration, "resync-period", time.Minute*10, "resync period")

Why is this needed:
An intermittent failure, i.e. DNS or network issue can cause an authentication handler to be removed from store causing request to the kube-apiserver to be unauthorized.

@dimityrmirchev dimityrmirchev added the kind/enhancement Enhancement, improvement, extension label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Enhancement, improvement, extension
Projects
None yet
Development

No branches or pull requests

1 participant