Skip to content

Commit

Permalink
Add Required kustomize changes to remove kube-rbac-proxy
Browse files Browse the repository at this point in the history
Signed-off-by: Furkat gofurov <furkat.gofurov@suse.com>
  • Loading branch information
furkatgofurov7 committed Nov 29, 2023
1 parent c3b56d4 commit ebc5c58
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 239 deletions.
5 changes: 0 additions & 5 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ bases:
- ../namespace

patchesStrategicMerge:
# 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.
- manager_auth_proxy_patch.yaml
# Provide customizable hook for make targets.
- manager_image_patch.yaml
- manager_pull_policy.yaml

Expand Down
54 changes: 0 additions & 54 deletions config/default/manager_auth_proxy_patch.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ spec:
containers:
- command:
- /manager
args:
- "--leader-elect"
- "--diagnostics-address=${CAPI_OPERATOR_DIAGNOSTICS_ADDRESS:=:8443}"
- "--insecure-diagnostics=${CAPI_OPERATOR_INSECURE_DIAGNOSTICS:=false}"
image: controller:latest
name: manager
ports:
- containerPort: 8443
name: metrics
protocol: TCP
resources:
limits:
cpu: 100m
Expand Down
7 changes: 0 additions & 7 deletions config/rbac/auth_proxy_client_clusterrole.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions config/rbac/auth_proxy_role.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions config/rbac/auth_proxy_role_binding.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions config/rbac/auth_proxy_service.yaml

This file was deleted.

9 changes: 1 addition & 8 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,4 @@ resources:
- role.yaml
- role_binding.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml
- leader_election_role_binding.yaml
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@ spec:
containers:
- name: manager
args:
- --metrics-bind-addr=:8080
- --leader-elect
- --leader-elect-retry-period=5s
- "--diagnostics-address=${CAPI_OPERATOR_DIAGNOSTICS_ADDRESS:=:8443}"
- "--insecure-diagnostics=${CAPI_OPERATOR_INSECURE_DIAGNOSTICS:=false}"
- --v=5
env:...
```
Expand Down
27 changes: 0 additions & 27 deletions hack/charts/cluster-api-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ spec:
{{- if .Values.healthAddr }}
- --health-addr={{ .Values.healthAddr }}
{{- end }}
{{- if .Values.metricsBindAddr }}
- --metrics-bind-addr={{ .Values.metricsBindAddr }}
{{- end }}
{{- with .Values.leaderElection }}
- --leader-elect={{ .enabled }}
{{- if .leaseDuration }}
Expand Down Expand Up @@ -101,30 +98,6 @@ spec:
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
{{- if .Values.logLevel }}
- --v={{ .Values.logLevel }}
{{- end }}
{{- with .Values.image.kubeRBACProxy }}
image: "{{- if .registry -}}{{ .registry }}/{{- end -}}{{ .repository }}{{- if (.digest) -}} @{{ .digest }}{{- else -}}:{{ default $.Chart.AppVersion .tag }} {{- end -}}"
{{- end }}
imagePullPolicy: {{ .Values.image.kubeRBACProxy.pullPolicy }}
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
protocol: TCP
{{- with .Values.resources.kubeRBACProxy }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.containerSecurityContext.kubeRBACProxy }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: 10
{{- with .Values.volumes }}
volumes:
Expand Down
5 changes: 0 additions & 5 deletions hack/charts/cluster-api-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ image:
repository: gcr.io/k8s-staging-capi-operator/cluster-api-operator
tag: dev
pullPolicy: IfNotPresent
kubeRBACProxy:
repository: gcr.io/kubebuilder/kube-rbac-proxy
tag: v0.14.1
pullPolicy: IfNotPresent
healthAddr: ":8081"
metricsBindAddr: "127.0.0.1:8080"
imagePullSecrets: {}
resources:
manager:
Expand Down
93 changes: 0 additions & 93 deletions test/e2e/resources/full-chart-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13966,40 +13966,6 @@ rules:
---
# Source: cluster-api-operator/templates/operator-components.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
clusterctl.cluster.x-k8s.io/core: capi-operator
name: capi-operator-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
# Source: cluster-api-operator/templates/operator-components.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
clusterctl.cluster.x-k8s.io/core: capi-operator
name: capi-operator-proxy-role
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
---
# Source: cluster-api-operator/templates/operator-components.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
Expand All @@ -14016,22 +13982,6 @@ subjects:
---
# Source: cluster-api-operator/templates/operator-components.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
clusterctl.cluster.x-k8s.io/core: capi-operator
name: capi-operator-proxy-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: capi-operator-proxy-role
subjects:
- kind: ServiceAccount
name: default
namespace: 'default'
---
# Source: cluster-api-operator/templates/operator-components.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
Expand Down Expand Up @@ -14098,24 +14048,6 @@ subjects:
# Source: cluster-api-operator/templates/operator-components.yaml
apiVersion: v1
kind: Service
metadata:
labels:
clusterctl.cluster.x-k8s.io/core: capi-operator
control-plane: controller-manager
name: capi-operator-controller-manager-metrics-service
namespace: 'default'
spec:
ports:
- name: https
port: 8443
targetPort: https
selector:
clusterctl.cluster.x-k8s.io/core: capi-operator
control-plane: controller-manager
---
# Source: cluster-api-operator/templates/operator-components.yaml
apiVersion: v1
kind: Service
metadata:
labels:
clusterctl.cluster.x-k8s.io/core: capi-operator
Expand Down Expand Up @@ -14165,7 +14097,6 @@ spec:
- args:
- --v=2
- --health-addr=:8081
- --metrics-bind-addr=127.0.0.1:8080
- --leader-elect=true
command:
- /manager
Expand All @@ -14187,30 +14118,6 @@ spec:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=2
image: "gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1"
imagePullPolicy: IfNotPresent
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
protocol: TCP
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
terminationGracePeriodSeconds: 10
volumes:
- name: cert
Expand Down

0 comments on commit ebc5c58

Please sign in to comment.