From 70ecb80b08d569848f296bc7ce25e011bd34a15a Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Mon, 29 Jul 2024 09:02:46 -0700 Subject: [PATCH] chore: remove metrics service and kube-rbac-proxy image (#261) * chore: remove metrics service and kube-rbac-proxy image * f --- .../templates/embedded-cluster-operator-deployment.yaml | 2 ++ ...embedded-cluster-operator-metrics-reader-clusterrole.yaml | 2 ++ .../templates/embedded-cluster-operator-metrics-service.yaml | 2 ++ .../embedded-cluster-operator-proxy-clusterrole.yaml | 2 ++ .../embedded-cluster-operator-proxy-rolebinding.yaml | 2 ++ charts/embedded-cluster-operator/values.yaml | 5 ++++- charts/embedded-cluster-operator/values.yaml.tmpl | 5 ++++- 7 files changed, 18 insertions(+), 2 deletions(-) diff --git a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-deployment.yaml b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-deployment.yaml index 2e90c14a..d8cf23c0 100644 --- a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-deployment.yaml +++ b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-deployment.yaml @@ -22,6 +22,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} containers: +{{- if .Values.metrics.enabled }} - args: - --secure-listen-address=0.0.0.0:8443 - --upstream=http://127.0.0.1:8080/ @@ -45,6 +46,7 @@ spec: capabilities: drop: - ALL +{{- end }} - args: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 diff --git a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-metrics-reader-clusterrole.yaml b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-metrics-reader-clusterrole.yaml index 378e8e27..cd171165 100644 --- a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-metrics-reader-clusterrole.yaml +++ b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-metrics-reader-clusterrole.yaml @@ -1,3 +1,4 @@ +{{- if .Values.metrics.enabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -10,3 +11,4 @@ rules: - /metrics verbs: - get +{{- end }} diff --git a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-metrics-service.yaml b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-metrics-service.yaml index 9b078caf..44907fca 100644 --- a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-metrics-service.yaml +++ b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-metrics-service.yaml @@ -1,3 +1,4 @@ +{{- if .Values.metrics.enabled }} apiVersion: v1 kind: Service metadata: @@ -12,3 +13,4 @@ spec: protocol: TCP targetPort: https selector: {{- include "embedded-cluster-operator.selectorLabels" $ | nindent 4 }} +{{- end }} diff --git a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-proxy-clusterrole.yaml b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-proxy-clusterrole.yaml index 7cfb425f..8844eb91 100644 --- a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-proxy-clusterrole.yaml +++ b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-proxy-clusterrole.yaml @@ -1,3 +1,4 @@ +{{- if .Values.metrics.enabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -18,3 +19,4 @@ rules: - subjectaccessreviews verbs: - create +{{- end }} diff --git a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-proxy-rolebinding.yaml b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-proxy-rolebinding.yaml index 1b420831..dd9dbb55 100644 --- a/charts/embedded-cluster-operator/templates/embedded-cluster-operator-proxy-rolebinding.yaml +++ b/charts/embedded-cluster-operator/templates/embedded-cluster-operator-proxy-rolebinding.yaml @@ -1,3 +1,4 @@ +{{- if .Values.metrics.enabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -13,3 +14,4 @@ subjects: - kind: ServiceAccount name: {{ include "embedded-cluster-operator.serviceAccountName" $ | trunc 63 | trimAll "-"}} namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/embedded-cluster-operator/values.yaml b/charts/embedded-cluster-operator/values.yaml index 1e734a25..f68fdf23 100644 --- a/charts/embedded-cluster-operator/values.yaml +++ b/charts/embedded-cluster-operator/values.yaml @@ -13,7 +13,6 @@ image: tag: 0.0.8 pullPolicy: IfNotPresent -kubeProxyImage: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 utilsImage: busybox:latest extraEnv: [] @@ -59,6 +58,10 @@ affinity: values: - linux +metrics: + enabled: false +kubeProxyImage: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 + crds: enabled: true diff --git a/charts/embedded-cluster-operator/values.yaml.tmpl b/charts/embedded-cluster-operator/values.yaml.tmpl index 94fa2b3b..b2c26526 100644 --- a/charts/embedded-cluster-operator/values.yaml.tmpl +++ b/charts/embedded-cluster-operator/values.yaml.tmpl @@ -12,7 +12,6 @@ image: tag: ${OPERATOR_IMAGE_TAG} pullPolicy: IfNotPresent -kubeProxyImage: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 utilsImage: busybox:latest extraEnv: [] @@ -58,6 +57,10 @@ affinity: values: - linux +metrics: + enabled: false +kubeProxyImage: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 + crds: enabled: true