From e653ebd4807c3f78d3d42a310bfbe6031ae66a29 Mon Sep 17 00:00:00 2001 From: Marek Date: Tue, 3 May 2022 15:15:34 +0200 Subject: [PATCH] #10 helm charts --- charts/eck-custom-resources-operator/Chart.yaml | 2 +- .../templates/configmap.yaml | 4 ++-- .../templates/deployment.yaml | 11 +++++++---- .../templates/service.yaml | 4 ++-- .../templates/service_monitor.yaml | 8 ++++++-- charts/eck-custom-resources-operator/values.yaml | 2 +- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/charts/eck-custom-resources-operator/Chart.yaml b/charts/eck-custom-resources-operator/Chart.yaml index 4327ebe..b5e8b93 100644 --- a/charts/eck-custom-resources-operator/Chart.yaml +++ b/charts/eck-custom-resources-operator/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: eck-custom-resources-operator description: A Helm chart for Kubernetes type: application -version: 0.8.0 +version: 0.1.0 appVersion: 0.0.1-beta1 diff --git a/charts/eck-custom-resources-operator/templates/configmap.yaml b/charts/eck-custom-resources-operator/templates/configmap.yaml index 7d287c4..31e8a2c 100644 --- a/charts/eck-custom-resources-operator/templates/configmap.yaml +++ b/charts/eck-custom-resources-operator/templates/configmap.yaml @@ -15,9 +15,9 @@ data: kind: ControllerManagerConfig manager: health: - healthProbeBindAddress: {{ .Values.manager.health.healthProbeBindAddress }} + healthProbeBindAddress: :{{ .Values.manager.health.healthProbePort }} metrics: - bindAddress: 127.0.0.1:{{ .Values.metrics.service.port }} + bindAddress: :{{ .Values.metrics.service.port }} webhook: port: {{ .Values.manager.webhook.port }} leaderElection: diff --git a/charts/eck-custom-resources-operator/templates/deployment.yaml b/charts/eck-custom-resources-operator/templates/deployment.yaml index 7714db0..e81ada9 100644 --- a/charts/eck-custom-resources-operator/templates/deployment.yaml +++ b/charts/eck-custom-resources-operator/templates/deployment.yaml @@ -38,19 +38,22 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - - name: http - containerPort: 8081 + - name: health + containerPort: {{ .Values.manager.health.healthProbePort }} + protocol: TCP + - name: metrics + containerPort: {{ .Values.metrics.service.port }} protocol: TCP livenessProbe: httpGet: path: /healthz - port: http + port: health initialDelaySeconds: 15 periodSeconds: 20 readinessProbe: httpGet: path: /readyz - port: http + port: health initialDelaySeconds: 5 periodSeconds: 10 resources: diff --git a/charts/eck-custom-resources-operator/templates/service.yaml b/charts/eck-custom-resources-operator/templates/service.yaml index 0b4d02e..c684673 100644 --- a/charts/eck-custom-resources-operator/templates/service.yaml +++ b/charts/eck-custom-resources-operator/templates/service.yaml @@ -9,9 +9,9 @@ spec: type: {{ .Values.metrics.service.type }} ports: - port: {{ .Values.metrics.service.port }} - targetPort: http + targetPort: metrics protocol: TCP - name: http + name: metrics selector: {{- include "eck-custom-resources-operator.selectorLabels" . | nindent 4 }} {{- end }} diff --git a/charts/eck-custom-resources-operator/templates/service_monitor.yaml b/charts/eck-custom-resources-operator/templates/service_monitor.yaml index fccd529..cd7fcf8 100644 --- a/charts/eck-custom-resources-operator/templates/service_monitor.yaml +++ b/charts/eck-custom-resources-operator/templates/service_monitor.yaml @@ -6,8 +6,12 @@ metadata: spec: endpoints: - path: /metrics - port: http + port: metrics scheme: http + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} selector: - {{- include "eck-custom-resources-operator.labels" . | nindent 4 }} + matchLabels: + {{- include "eck-custom-resources-operator.labels" . | nindent 6 }} {{- end }} diff --git a/charts/eck-custom-resources-operator/values.yaml b/charts/eck-custom-resources-operator/values.yaml index 73b767f..2aba30f 100644 --- a/charts/eck-custom-resources-operator/values.yaml +++ b/charts/eck-custom-resources-operator/values.yaml @@ -72,7 +72,7 @@ affinity: {} manager: health: - healthProbeBindAddress: ":8081" + healthProbePort: 8081 webhook: port: 9443 leaderElection: