Skip to content

Commit

Permalink
Move kube-rbac-proxy into base manager yaml (#695)
Browse files Browse the repository at this point in the history
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
  • Loading branch information
m1kola authored Mar 13, 2024
1 parent 38da6fc commit 47fd760
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 82 deletions.
8 changes: 0 additions & 8 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- path: manager_auth_proxy_patch.yaml



# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- manager_webhook_patch.yaml
Expand Down
53 changes: 0 additions & 53 deletions config/default/manager_auth_proxy_patch.yaml

This file was deleted.

61 changes: 40 additions & 21 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,22 @@ spec:
labels:
control-plane: controller-manager
spec:
# TODO(user): Uncomment the following code to configure the nodeAffinity expression
# according to the platforms which are supported by your solution.
# It is considered best practice to support multiple architectures. You can
# build your manager image using the makefile target docker-buildx.
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/arch
# operator: In
# values:
# - amd64
# - arm64
# - ppc64le
# - s390x
# - key: kubernetes.io/os
# operator: In
# values:
# - linux
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
- ppc64le
- s390x
- key: kubernetes.io/os
operator: In
values:
- linux
securityContext:
runAsNonRoot: true
seccompProfile:
Expand All @@ -56,7 +52,10 @@ spec:
- command:
- /manager
args:
- --leader-elect
- "--health-probe-bind-address=:8081"
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
- "--feature-gates=ForceSemverUpgradeConstraints=true"
image: controller:latest
imagePullPolicy: IfNotPresent
name: manager
Expand Down Expand Up @@ -86,6 +85,26 @@ spec:
requests:
cpu: 10m
memory: 64Mi
- name: kube-rbac-proxy
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
args:
- "--secure-listen-address=0.0.0.0:8443"
- "--upstream=http://127.0.0.1:8080/"
- "--logtostderr=true"
- "--v=0"
ports:
- containerPort: 8443
protocol: TCP
name: https
resources:
requests:
cpu: 5m
memory: 64Mi
serviceAccountName: controller-manager
terminationGracePeriodSeconds: 10
volumes:
Expand Down

0 comments on commit 47fd760

Please sign in to comment.