Skip to content

Commit d254cf7

Browse files
authored
Merge pull request #340 from Fedosin/remove_kube_rbac_proxy
⚠️ Remove kube-rbac-proxy and expose metrics on localhost:8080
2 parents d0f318d + 50b7f2f commit d254cf7

File tree

11 files changed

+2
-245
lines changed

11 files changed

+2
-245
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

hack/charts/cluster-api-operator/templates/deployment.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -101,30 +101,6 @@ spec:
101101
volumeMounts:
102102
{{- toYaml . | nindent 12 }}
103103
{{- end }}
104-
- args:
105-
- --secure-listen-address=0.0.0.0:8443
106-
- --upstream=http://127.0.0.1:8080/
107-
- --logtostderr=true
108-
{{- if .Values.logLevel }}
109-
- --v={{ .Values.logLevel }}
110-
{{- end }}
111-
{{- with .Values.image.kubeRBACProxy }}
112-
image: "{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}"
113-
{{- end }}
114-
imagePullPolicy: {{ .Values.image.kubeRBACProxy.pullPolicy }}
115-
name: kube-rbac-proxy
116-
ports:
117-
- containerPort: 8443
118-
name: https
119-
protocol: TCP
120-
{{- with .Values.resources.kubeRBACProxy }}
121-
resources:
122-
{{- toYaml . | nindent 12 }}
123-
{{- end }}
124-
{{- with .Values.containerSecurityContext.kubeRBACProxy }}
125-
securityContext:
126-
{{- toYaml . | nindent 12 }}
127-
{{- end }}
128104
terminationGracePeriodSeconds: 10
129105
{{- with .Values.volumes }}
130106
volumes:

hack/charts/cluster-api-operator/values.yaml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ image:
2626
repository: gcr.io/k8s-staging-capi-operator/cluster-api-operator
2727
tag: dev
2828
pullPolicy: IfNotPresent
29-
kubeRBACProxy:
30-
repository: gcr.io/kubebuilder/kube-rbac-proxy
31-
tag: v0.14.1
32-
pullPolicy: IfNotPresent
3329
healthAddr: ":8081"
3430
metricsBindAddr: "127.0.0.1:8080"
3531
imagePullSecrets: {}
@@ -41,19 +37,7 @@ resources:
4137
requests:
4238
cpu: 100m
4339
memory: 100Mi
44-
kubeRBACProxy:
45-
limits:
46-
cpu: 500m
47-
memory: 128Mi
48-
requests:
49-
cpu: 5m
50-
memory: 64Mi
51-
containerSecurityContext:
52-
kubeRBACProxy:
53-
allowPrivilegeEscalation: false
54-
capabilities:
55-
drop:
56-
- ALL
40+
containerSecurityContext: {}
5741
affinity:
5842
nodeAffinity:
5943
requiredDuringSchedulingIgnoredDuringExecution:

0 commit comments

Comments
 (0)