Skip to content

Commit

Permalink
Remove kube-rbac-proxy and open metrics endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianZaccaria committed Jul 25, 2023
1 parent c885e0a commit c3ec772
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 93 deletions.
8 changes: 3 additions & 5 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ bases:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
# - ../prometheus

patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
resources:
# Add metrics service
- metrics_service.yaml

# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
Expand Down
39 changes: 0 additions & 39 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +0,0 @@
# This patch inject a sidecar container which is a HTTP proxy for the
# controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews.
apiVersion: apps/v1
kind: Deployment
metadata:
name: manager
namespace: system
spec:
template:
spec:
containers:
- name: kube-rbac-proxy
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
- "--logtostderr=true"
- "--v=0"
ports:
- containerPort: 8443
protocol: TCP
name: https
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
- name: manager
args:
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=0.0.0.0:8080"
- "--leader-elect"
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ metadata:
namespace: system
spec:
ports:
- name: https
- name: metrics
port: 8443
protocol: TCP
targetPort: 8080
targetPort: metrics
selector:
app.kubernetes.io/name: codeflare-operator
app.kubernetes.io/part-of: codeflare
2 changes: 1 addition & 1 deletion config/manager/controller_manager_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: ControllerManagerConfig
health:
healthProbeBindAddress: :8081
metrics:
bindAddress: 127.0.0.1:8080
bindAddress: 0.0.0.0:8080
webhook:
port: 9443
leaderElection:
Expand Down
8 changes: 7 additions & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ spec:
- command:
- /manager
args:
- --leader-elect
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=0.0.0.0:8080"
- "--leader-elect"
image: controller:latest
imagePullPolicy: Always
name: manager
Expand All @@ -44,6 +46,10 @@ spec:
capabilities:
drop:
- "ALL"
ports:
- containerPort: 8080
protocol: TCP
name: metrics
livenessProbe:
httpGet:
path: /healthz
Expand Down
9 changes: 0 additions & 9 deletions config/rbac/auth_proxy_client_clusterrole.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions config/rbac/auth_proxy_role.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions config/rbac/auth_proxy_role_binding.yaml

This file was deleted.

8 changes: 1 addition & 7 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,4 @@ resources:
- edit_role_binding.yaml # We are using this binding as mcad requires this role
- leader_election_role.yaml
- leader_election_role_binding.yaml
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml

0 comments on commit c3ec772

Please sign in to comment.