-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jintao Zhang <[email protected]>
- Loading branch information
1 parent
7635386
commit 52e95f6
Showing
15 changed files
with
162 additions
and
56 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
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
config/default/manager_metrics_access_filter_rbac_patch.yaml
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 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: controller-manager | ||
namespace: system | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: manager | ||
args: | ||
- "--metrics-bind-address=0.0.0.0:8443" | ||
- "--metrics-access-filter=rbac" | ||
ports: | ||
- containerPort: 8443 | ||
protocol: TCP | ||
name: https |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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,47 @@ | ||
/* | ||
Copyright 2025 Kong Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package manager | ||
|
||
import "fmt" | ||
|
||
// MetricsAccessFilter defines the access filter function for the metrics endpoint. | ||
type MetricsAccessFilter string | ||
|
||
// Set implements flag.Value. | ||
func (mf *MetricsAccessFilter) Set(v string) error { | ||
switch v { | ||
case string(MetricsAccessFilterOff), string(MetricsAccessFilterRBAC): | ||
*mf = MetricsAccessFilter(v) | ||
default: | ||
return fmt.Errorf("invalid value %q for metrics access filter", v) | ||
} | ||
return nil | ||
} | ||
|
||
const ( | ||
// MetricsAccessFilterOff disabled the access filter on metrics endpoint. | ||
MetricsAccessFilterOff MetricsAccessFilter = "off" | ||
// MetricsAccessFilterRBAC enables the access filter on metrics endpoint. | ||
// For more information consult: | ||
// https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/metrics/filters#WithAuthenticationAndAuthorization | ||
MetricsAccessFilterRBAC MetricsAccessFilter = "rbac" | ||
) | ||
|
||
// String returns the string representation of the MetricsFilter. | ||
func (mf MetricsAccessFilter) String() string { | ||
return string(mf) | ||
} | ||
Oops, something went wrong.