Skip to content

Commit 9938bfd

Browse files
committed
Migration of kube-rbac-proxy in gitops-operator
Signed-off-by: akhil nittala <nakhil@redhat.com>
1 parent 6dfdfcf commit 9938bfd

File tree

8 files changed

+26
-18
lines changed

8 files changed

+26
-18
lines changed

bundle/manifests/gitops-operator.clusterserviceversion.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ metadata:
190190
capabilities: Deep Insights
191191
console.openshift.io/plugins: '["gitops-plugin"]'
192192
containerImage: quay.io/redhat-developer/gitops-operator
193-
createdAt: "2026-04-08T05:55:24Z"
193+
createdAt: "2026-04-09T07:23:41Z"
194194
description: Enables teams to adopt GitOps principles for managing cluster configurations
195195
and application delivery across hybrid multi-cluster Kubernetes environments.
196196
features.operators.openshift.io/disconnected: "true"
@@ -859,7 +859,8 @@ spec:
859859
containers:
860860
- args:
861861
- --health-probe-bind-address=:8081
862-
- --metrics-bind-address=127.0.0.1:8080
862+
- --metrics-bind-address=:8443
863+
- --metrics-secure
863864
- --leader-elect
864865
command:
865866
- /usr/local/bin/manager
@@ -885,6 +886,9 @@ spec:
885886
- containerPort: 9443
886887
name: webhook-server
887888
protocol: TCP
889+
- containerPort: 8443
890+
name: metrics
891+
protocol: TCP
888892
readinessProbe:
889893
httpGet:
890894
path: /readyz

config/default/kustomization.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ bases:
2525
- ../prometheus
2626

2727
patchesStrategicMerge:
28-
# Protect the /metrics endpoint by putting it behind auth.
29-
# If you want your controller-manager to expose the /metrics
30-
# endpoint w/o any authn/z, please comment the following line.
31-
- manager_auth_proxy_patch.yaml
28+
# Protect the /metrics endpoint with controller-runtime authn/authz.
29+
# If you comment out manager_metrics_patch.yaml, also comment out metrics_service.yaml,
30+
# metrics_role.yaml, metrics_role_binding.yaml, and metrics_reader_clusterrole.yaml
31+
# in ../rbac/kustomization.yaml so the metrics Service is disabled as well.
32+
patchesStrategicMerge:
33+
- manager_metrics_patch.yaml
3234

3335
# Mount the controller config file for loading manager configurations
3436
# through a ComponentConfig type

config/default/manager_auth_proxy_patch.yaml renamed to config/default/manager_metrics_patch.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# This patch inject a sidecar container which is a HTTP proxy for the
2-
# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
1+
# This patch configures the manager to serve metrics securely using
2+
# controller-runtime's built-in authn/authz (replacing the deprecated
3+
# kube-rbac-proxy sidecar).
34
apiVersion: apps/v1
45
kind: Deployment
56
metadata:

config/rbac/kustomization.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ resources:
99
- role_binding.yaml
1010
- leader_election_role.yaml
1111
- leader_election_role_binding.yaml
12-
# Comment the following 4 lines if you want to disable
13-
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
14-
# which protects your /metrics endpoint.
15-
- auth_proxy_service.yaml
16-
- auth_proxy_role.yaml
17-
- auth_proxy_role_binding.yaml
18-
# - auth_proxy_client_clusterrole.yaml
12+
# These resources expose /metrics over HTTPS on port 8443 and grant the
13+
# controller-runtime authn/authz permissions required by manager_metrics_patch.yaml.
14+
# Comment these lines together with manager_metrics_patch.yaml if you want to
15+
# disable secure metrics for the controller-manager.
16+
- metrics_service.yaml
17+
- metrics_role.yaml
18+
- metrics_role_binding.yaml
19+
# - metrics_reader_clusterrole.yaml
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRole
33
metadata:
4-
name: proxy-role
4+
name: metrics-role
55
rules:
66
- nonResourceURLs:
77
- "/metrics"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apiVersion: rbac.authorization.k8s.io/v1
22
kind: ClusterRoleBinding
33
metadata:
4-
name: proxy-rolebinding
4+
name: metrics-rolebinding
55
roleRef:
66
apiGroup: rbac.authorization.k8s.io
77
kind: ClusterRole
8-
name: proxy-role
8+
name: metrics-role
99
subjects:
1010
- kind: ServiceAccount
1111
name: controller-manager

0 commit comments

Comments
 (0)