forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPSTREAM: <carry>: allow kubelet to self-authorize metrics scraping
OpenShift-Rebase-Source: 5ab0f5e
- Loading branch information
1 parent
5123525
commit b6cc9bf
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package app | ||
|
||
import ( | ||
"github.com/openshift/library-go/pkg/authorization/hardcodedauthorizer" | ||
"k8s.io/apiserver/pkg/authorization/authorizer" | ||
"k8s.io/apiserver/pkg/authorization/union" | ||
) | ||
|
||
// wrapAuthorizerWithMetricsScraper add an authorizer to always approver the openshift metrics scraper. | ||
// This eliminates an unnecessary SAR for scraping metrics and enables metrics gathering when network access | ||
// to the kube-apiserver is interrupted | ||
func wrapAuthorizerWithMetricsScraper(authz authorizer.Authorizer) authorizer.Authorizer { | ||
return union.New( | ||
hardcodedauthorizer.NewHardCodedMetricsAuthorizer(), | ||
authz, | ||
) | ||
} |