Skip to content

Commit 47fd760

Browse files
authored
Move kube-rbac-proxy into base manager yaml (#695)
Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 38da6fc commit 47fd760

File tree

3 files changed

+40
-82
lines changed

3 files changed

+40
-82
lines changed

config/default/kustomization.yaml

-8
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ resources:
2626
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2727
#- ../prometheus
2828

29-
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
34-
35-
36-
3729
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
3830
# crd/kustomization.yaml
3931
#- manager_webhook_patch.yaml

config/default/manager_auth_proxy_patch.yaml

-53
This file was deleted.

config/manager/manager.yaml

+40-21
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,22 @@ spec:
2828
labels:
2929
control-plane: controller-manager
3030
spec:
31-
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
32-
# according to the platforms which are supported by your solution.
33-
# It is considered best practice to support multiple architectures. You can
34-
# build your manager image using the makefile target docker-buildx.
35-
# affinity:
36-
# nodeAffinity:
37-
# requiredDuringSchedulingIgnoredDuringExecution:
38-
# nodeSelectorTerms:
39-
# - matchExpressions:
40-
# - key: kubernetes.io/arch
41-
# operator: In
42-
# values:
43-
# - amd64
44-
# - arm64
45-
# - ppc64le
46-
# - s390x
47-
# - key: kubernetes.io/os
48-
# operator: In
49-
# values:
50-
# - linux
31+
affinity:
32+
nodeAffinity:
33+
requiredDuringSchedulingIgnoredDuringExecution:
34+
nodeSelectorTerms:
35+
- matchExpressions:
36+
- key: kubernetes.io/arch
37+
operator: In
38+
values:
39+
- amd64
40+
- arm64
41+
- ppc64le
42+
- s390x
43+
- key: kubernetes.io/os
44+
operator: In
45+
values:
46+
- linux
5147
securityContext:
5248
runAsNonRoot: true
5349
seccompProfile:
@@ -56,7 +52,10 @@ spec:
5652
- command:
5753
- /manager
5854
args:
59-
- --leader-elect
55+
- "--health-probe-bind-address=:8081"
56+
- "--metrics-bind-address=127.0.0.1:8080"
57+
- "--leader-elect"
58+
- "--feature-gates=ForceSemverUpgradeConstraints=true"
6059
image: controller:latest
6160
imagePullPolicy: IfNotPresent
6261
name: manager
@@ -86,6 +85,26 @@ spec:
8685
requests:
8786
cpu: 10m
8887
memory: 64Mi
88+
- name: kube-rbac-proxy
89+
securityContext:
90+
allowPrivilegeEscalation: false
91+
capabilities:
92+
drop:
93+
- "ALL"
94+
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
95+
args:
96+
- "--secure-listen-address=0.0.0.0:8443"
97+
- "--upstream=http://127.0.0.1:8080/"
98+
- "--logtostderr=true"
99+
- "--v=0"
100+
ports:
101+
- containerPort: 8443
102+
protocol: TCP
103+
name: https
104+
resources:
105+
requests:
106+
cpu: 5m
107+
memory: 64Mi
89108
serviceAccountName: controller-manager
90109
terminationGracePeriodSeconds: 10
91110
volumes:

0 commit comments

Comments
 (0)