Skip to content

Commit 1262b44

Browse files
authored
Merge pull request #27 from sapcc/deprecate-kube-rbac-proxy
Deprecate kube rbac proxy
2 parents c487369 + 9994c7d commit 1262b44

File tree

11 files changed

+20
-66
lines changed

11 files changed

+20
-66
lines changed

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func main() {
4242
var metricsAddr string
4343
var enableLeaderElection bool
4444
var probeAddr string
45-
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
45+
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8443", "The address the metric endpoint binds to.")
4646
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
4747
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
4848
"Enable leader election for controller manager. "+

config/crd/kustomization.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ resources:
55
- bases/controlplane.cluster.x-k8s.io_kubernikuscontrolplanes.yaml
66
#+kubebuilder:scaffold:crdkustomizeresource
77

8-
commonLabels:
9-
cluster.x-k8s.io/v1beta1: v1alpha1
8+
labels:
9+
- includeSelectors: true
10+
includeTemplates: true
11+
pairs:
12+
cluster.x-k8s.io/v1beta1: v1alpha1
1013

1114
patches:
1215
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.

config/default/kustomization.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ namePrefix: capi-kks-
1414
# pairs:
1515
# someName: someValue
1616

17-
commonLabels:
18-
cluster.x-k8s.io/provider: kubernikus
17+
labels:
18+
- includeSelectors: true
19+
includeTemplates: true
20+
pairs:
21+
cluster.x-k8s.io/provider: kubernikus
1922

2023
resources:
2124
- ../crd
@@ -29,12 +32,6 @@ resources:
2932
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
3033
#- ../prometheus
3134

32-
patches:
33-
# Protect the /metrics endpoint by putting it behind auth.
34-
# If you want your controller-manager to expose the /metrics
35-
# endpoint w/o any authn/z, please comment the following line.
36-
- path: manager_auth_proxy_patch.yaml
37-
3835
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
3936
# crd/kustomization.yaml
4037
#- path: manager_webhook_patch.yaml

config/default/manager_auth_proxy_patch.yaml

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

config/manager/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
resources:
22
- manager.yaml
3+
- metrics_service.yaml
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ metadata:
55
control-plane: controller-manager
66
app.kubernetes.io/name: service
77
app.kubernetes.io/instance: controller-manager-metrics-service
8-
app.kubernetes.io/component: kube-rbac-proxy
98
app.kubernetes.io/created-by: cluster-api-control-plane-provider-kubernikus
109
app.kubernetes.io/part-of: cluster-api-control-plane-provider-kubernikus
1110
app.kubernetes.io/managed-by: kustomize
@@ -16,6 +15,6 @@ spec:
1615
- name: https
1716
port: 8443
1817
protocol: TCP
19-
targetPort: https
18+
targetPort: 8443
2019
selector:
2120
control-plane: controller-manager

config/rbac/kustomization.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ 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_auth_role.yaml
13+
- metrics_auth_role_binding.yaml
14+
- metrics_reader_role.yaml
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ metadata:
44
labels:
55
app.kubernetes.io/name: clusterrole
66
app.kubernetes.io/instance: proxy-role
7-
app.kubernetes.io/component: kube-rbac-proxy
87
app.kubernetes.io/created-by: cluster-api-control-plane-provider-kubernikus
98
app.kubernetes.io/part-of: cluster-api-control-plane-provider-kubernikus
109
app.kubernetes.io/managed-by: kustomize
11-
name: proxy-role
10+
name: metrics-auth-role
1211
rules:
1312
- apiGroups:
1413
- authentication.k8s.io

config/rbac/auth_proxy_role_binding.yaml renamed to config/rbac/metrics_auth_role_binding.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ metadata:
44
labels:
55
app.kubernetes.io/name: clusterrolebinding
66
app.kubernetes.io/instance: proxy-rolebinding
7-
app.kubernetes.io/component: kube-rbac-proxy
87
app.kubernetes.io/created-by: cluster-api-control-plane-provider-kubernikus
98
app.kubernetes.io/part-of: cluster-api-control-plane-provider-kubernikus
109
app.kubernetes.io/managed-by: kustomize
11-
name: proxy-rolebinding
10+
name: metrics-auth-rolebinding
1211
roleRef:
1312
apiGroup: rbac.authorization.k8s.io
1413
kind: ClusterRole
15-
name: proxy-role
14+
name: metrics-auth-role
1615
subjects:
1716
- kind: ServiceAccount
1817
name: controller-manager

config/rbac/auth_proxy_client_clusterrole.yaml renamed to config/rbac/metrics_reader_role.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ metadata:
44
labels:
55
app.kubernetes.io/name: clusterrole
66
app.kubernetes.io/instance: metrics-reader
7-
app.kubernetes.io/component: kube-rbac-proxy
87
app.kubernetes.io/created-by: cluster-api-control-plane-provider-kubernikus
98
app.kubernetes.io/part-of: cluster-api-control-plane-provider-kubernikus
109
app.kubernetes.io/managed-by: kustomize

0 commit comments

Comments
 (0)