Skip to content

Commit 7af99ae

Browse files
committed
Remove kube-rbac-proxy and expose metrics on localhost:8080
Following the upstream cluster-api instruction, remove unneeded component kube-rbac-proxy.
1 parent d0f318d commit 7af99ae

9 files changed

+1
-180
lines changed

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func init() {
7878

7979
// InitFlags initializes the flags.
8080
func InitFlags(fs *pflag.FlagSet) {
81-
fs.StringVar(&metricsBindAddr, "metrics-bind-addr", ":8080",
81+
fs.StringVar(&metricsBindAddr, "metrics-bind-addr", "localhost:8080",
8282
"The address the metric endpoint binds to.")
8383

8484
fs.BoolVar(&enableLeaderElection, "leader-elect", false,

config/default/kustomization.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ bases:
2626
- ../namespace
2727

2828
patchesStrategicMerge:
29-
# Protect the /metrics endpoint by putting it behind auth.
30-
# If you want your controller-manager to expose the /metrics
31-
# endpoint w/o any authn/z, please comment the following line.
32-
- manager_auth_proxy_patch.yaml
3329
# Provide customizable hook for make targets.
3430
- manager_image_patch.yaml
3531
- manager_pull_policy.yaml

config/default/manager_auth_proxy_patch.yaml

Lines changed: 0 additions & 54 deletions
This file was deleted.

config/rbac/auth_proxy_client_clusterrole.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

config/rbac/auth_proxy_role.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

config/rbac/auth_proxy_role_binding.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

config/rbac/auth_proxy_service.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

config/rbac/kustomization.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,3 @@ resources:
33
- role_binding.yaml
44
- leader_election_role.yaml
55
- leader_election_role_binding.yaml
6-
# Comment the following 4 lines if you want to disable
7-
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
8-
# which protects your /metrics endpoint.
9-
- auth_proxy_service.yaml
10-
- auth_proxy_role.yaml
11-
- auth_proxy_role_binding.yaml
12-
- auth_proxy_client_clusterrole.yaml

test/e2e/resources/full-chart-install.yaml

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -13961,40 +13961,6 @@ rules:
1396113961
---
1396213962
# Source: cluster-api-operator/templates/operator-components.yaml
1396313963
apiVersion: rbac.authorization.k8s.io/v1
13964-
kind: ClusterRole
13965-
metadata:
13966-
labels:
13967-
clusterctl.cluster.x-k8s.io/core: capi-operator
13968-
name: capi-operator-metrics-reader
13969-
rules:
13970-
- nonResourceURLs:
13971-
- /metrics
13972-
verbs:
13973-
- get
13974-
---
13975-
# Source: cluster-api-operator/templates/operator-components.yaml
13976-
apiVersion: rbac.authorization.k8s.io/v1
13977-
kind: ClusterRole
13978-
metadata:
13979-
labels:
13980-
clusterctl.cluster.x-k8s.io/core: capi-operator
13981-
name: capi-operator-proxy-role
13982-
rules:
13983-
- apiGroups:
13984-
- authentication.k8s.io
13985-
resources:
13986-
- tokenreviews
13987-
verbs:
13988-
- create
13989-
- apiGroups:
13990-
- authorization.k8s.io
13991-
resources:
13992-
- subjectaccessreviews
13993-
verbs:
13994-
- create
13995-
---
13996-
# Source: cluster-api-operator/templates/operator-components.yaml
13997-
apiVersion: rbac.authorization.k8s.io/v1
1399813964
kind: ClusterRoleBinding
1399913965
metadata:
1400013966
labels:
@@ -14011,22 +13977,6 @@ subjects:
1401113977
---
1401213978
# Source: cluster-api-operator/templates/operator-components.yaml
1401313979
apiVersion: rbac.authorization.k8s.io/v1
14014-
kind: ClusterRoleBinding
14015-
metadata:
14016-
labels:
14017-
clusterctl.cluster.x-k8s.io/core: capi-operator
14018-
name: capi-operator-proxy-rolebinding
14019-
roleRef:
14020-
apiGroup: rbac.authorization.k8s.io
14021-
kind: ClusterRole
14022-
name: capi-operator-proxy-role
14023-
subjects:
14024-
- kind: ServiceAccount
14025-
name: default
14026-
namespace: 'default'
14027-
---
14028-
# Source: cluster-api-operator/templates/operator-components.yaml
14029-
apiVersion: rbac.authorization.k8s.io/v1
1403013980
kind: Role
1403113981
metadata:
1403213982
labels:
@@ -14093,24 +14043,6 @@ subjects:
1409314043
# Source: cluster-api-operator/templates/operator-components.yaml
1409414044
apiVersion: v1
1409514045
kind: Service
14096-
metadata:
14097-
labels:
14098-
clusterctl.cluster.x-k8s.io/core: capi-operator
14099-
control-plane: controller-manager
14100-
name: capi-operator-controller-manager-metrics-service
14101-
namespace: 'default'
14102-
spec:
14103-
ports:
14104-
- name: https
14105-
port: 8443
14106-
targetPort: https
14107-
selector:
14108-
clusterctl.cluster.x-k8s.io/core: capi-operator
14109-
control-plane: controller-manager
14110-
---
14111-
# Source: cluster-api-operator/templates/operator-components.yaml
14112-
apiVersion: v1
14113-
kind: Service
1411414046
metadata:
1411514047
labels:
1411614048
clusterctl.cluster.x-k8s.io/core: capi-operator

0 commit comments

Comments
 (0)