Skip to content

Commit c01af8f

Browse files
⚠️ Discontinue Kube RBAC Proxy in Default Kubebuilder Scaffolding (#3899)
Discontinue Kube RBAC Proxy in Default Kubebuilder Scaffolding
1 parent 94a5ab8 commit c01af8f

File tree

102 files changed

+580
-1686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+580
-1686
lines changed

.github/workflows/test-sample-go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH
2727
sed -i '27s/^#//' $KUSTOMIZATION_FILE_PATH
2828
sed -i '42s/^#//' $KUSTOMIZATION_FILE_PATH
29-
sed -i '46,143s/^#//' $KUSTOMIZATION_FILE_PATH
29+
sed -i '46,142s/^#//' $KUSTOMIZATION_FILE_PATH
3030
3131
- name: Test
3232
run: |

docs/book/src/component-config-tutorial/testdata/project/config/default/kustomization.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ resources:
2727
#- ../prometheus
2828

2929
patches:
30-
# Protect the /metrics endpoint by putting it behind auth.
31-
# If you want your controller-manager to expose the /metrics
32-
# endpoint w/o any authn/z, please comment the following line.
33-
- path: manager_auth_proxy_patch.yaml
30+
# [METRICS] The following patch will enable the metrics endpoint. Ensure that you also protect this endpoint.
31+
# More info: https://book.kubebuilder.io/reference/metrics
32+
# If you want to expose the metric endpoint of your controller-manager uncomment the following line.
33+
#- path: manager_metrics_patch.yaml
3434

3535
# Mount the controller config file for loading manager configurations
3636
# through a ComponentConfig type

docs/book/src/component-config-tutorial/testdata/project/config/default/manager_auth_proxy_patch.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This patch adds the args to allow exposing the metrics endpoint securely
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: controller-manager
6+
namespace: system
7+
spec:
8+
template:
9+
spec:
10+
containers:
11+
- name: manager
12+
args:
13+
- "--metrics-bind-address=0.0.0.0:8080"

docs/book/src/component-config-tutorial/testdata/project/config/prometheus/monitor.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ metadata:
1111
spec:
1212
endpoints:
1313
- path: /metrics
14-
port: https
15-
scheme: https
16-
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
17-
tlsConfig:
18-
insecureSkipVerify: true
14+
port: http # Ensure this is the name of the port that exposes HTTP metrics
15+
scheme: http
1916
selector:
2017
matchLabels:
2118
control-plane: controller-manager

docs/book/src/component-config-tutorial/testdata/project/config/rbac/auth_proxy_client_clusterrole.yaml

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

docs/book/src/component-config-tutorial/testdata/project/config/rbac/auth_proxy_role.yaml

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

docs/book/src/component-config-tutorial/testdata/project/config/rbac/auth_proxy_role_binding.yaml

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

docs/book/src/component-config-tutorial/testdata/project/config/rbac/kustomization.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +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+
- metrics_service.yaml
1913
# For each CRD, "Editor" and "Viewer" roles are scaffolded by
2014
# default, aiding admins in cluster management. Those roles are
2115
# not used by the Project itself. You can comment the following lines
2216
# if you do not want those helpers be installed with your Project.
2317
- projectconfig_editor_role.yaml
2418
- projectconfig_viewer_role.yaml
19+

docs/book/src/component-config-tutorial/testdata/project/config/rbac/auth_proxy_service.yaml renamed to docs/book/src/component-config-tutorial/testdata/project/config/rbac/metrics_service.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ metadata:
99
namespace: system
1010
spec:
1111
ports:
12-
- name: https
13-
port: 8443
12+
- name: http
13+
port: 8080
1414
protocol: TCP
15-
targetPort: https
15+
targetPort: 8080
1616
selector:
1717
control-plane: controller-manager

0 commit comments

Comments
 (0)