Skip to content

Commit f870879

Browse files
Remove kube-rbac-proxy and open metrics endpoint
1 parent c885e0a commit f870879

10 files changed

+28
-90
lines changed

config/default/kustomization.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ bases:
2525
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2626
# - ../prometheus
2727

28+
resources:
29+
# Add metrics service
30+
- metrics_service.yaml
31+
2832
patchesStrategicMerge:
2933
# Protect the /metrics endpoint by putting it behind auth.
3034
# If you want your controller-manager to expose the /metrics
3135
# endpoint w/o any authn/z, please comment the following line.
32-
- manager_auth_proxy_patch.yaml
36+
# - manager_auth_proxy_patch.yaml
3337

3438
# Mount the controller config file for loading manager configurations
3539
# through a ComponentConfig type

config/default/manager_auth_proxy_patch.yaml

-39
This file was deleted.

config/rbac/auth_proxy_service.yaml renamed to config/default/metrics_service.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ metadata:
55
namespace: system
66
spec:
77
ports:
8-
- name: https
9-
port: 8443
8+
- name: metrics
9+
port: 8080
1010
protocol: TCP
11-
targetPort: 8080
11+
targetPort: metrics
1212
selector:
1313
app.kubernetes.io/name: codeflare-operator
1414
app.kubernetes.io/part-of: codeflare

config/manager/controller_manager_config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: ControllerManagerConfig
33
health:
44
healthProbeBindAddress: :8081
55
metrics:
6-
bindAddress: 127.0.0.1:8080
6+
bindAddress: 0.0.0.0:8080
77
webhook:
88
port: 9443
99
leaderElection:

config/manager/manager.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ spec:
3535
- command:
3636
- /manager
3737
args:
38-
- --leader-elect
38+
- "--health-probe-bind-address=:8081"
39+
- "--metrics-bind-address=0.0.0.0:8080"
40+
- "--leader-elect"
3941
image: controller:latest
4042
imagePullPolicy: Always
4143
name: manager
@@ -44,6 +46,10 @@ spec:
4446
capabilities:
4547
drop:
4648
- "ALL"
49+
ports:
50+
- containerPort: 8080
51+
protocol: TCP
52+
name: metrics
4753
livenessProbe:
4854
httpGet:
4955
path: /healthz

config/rbac/auth_proxy_client_clusterrole.yaml

-9
This file was deleted.

config/rbac/auth_proxy_role.yaml

-17
This file was deleted.

config/rbac/auth_proxy_role_binding.yaml

-12
This file was deleted.

config/rbac/kustomization.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,3 @@ resources:
1010
- edit_role_binding.yaml # We are using this binding as mcad requires this role
1111
- leader_election_role.yaml
1212
- leader_election_role_binding.yaml
13-
# Comment the following 4 lines if you want to disable
14-
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
15-
# which protects your /metrics endpoint.
16-
- auth_proxy_service.yaml
17-
- auth_proxy_role.yaml
18-
- auth_proxy_role_binding.yaml
19-
- auth_proxy_client_clusterrole.yaml

config/rbac/role.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,18 @@ rules:
314314
- patch
315315
- update
316316
- watch
317+
- apiGroups:
318+
- authentication.k8s.io
319+
resources:
320+
- tokenreviews
321+
verbs:
322+
- create
323+
- apiGroups:
324+
- authorization.k8s.io
325+
resources:
326+
- subjectaccessreviews
327+
verbs:
328+
- create
317329
- apiGroups:
318330
- scheduling.sigs.k8s.io
319331
resources:

0 commit comments

Comments
 (0)