diff --git a/charts/dragonfly-operator/templates/deployment.yaml b/charts/dragonfly-operator/templates/deployment.yaml index 0c24699..188abec 100644 --- a/charts/dragonfly-operator/templates/deployment.yaml +++ b/charts/dragonfly-operator/templates/deployment.yaml @@ -67,6 +67,10 @@ spec: {{- toYaml .Values.manager.livenessProbe | nindent 12 }} readinessProbe: {{- toYaml .Values.manager.readinessProbe | nindent 12 }} + ports: + - containerPort: 8080 + name: metrics + protocol: TCP resources: {{- toYaml .Values.manager.resources | nindent 12 }} {{- with .Values.manager.volumeMounts }} diff --git a/charts/dragonfly-operator/templates/service.yaml b/charts/dragonfly-operator/templates/service.yaml index ba0a0db..9d177d1 100644 --- a/charts/dragonfly-operator/templates/service.yaml +++ b/charts/dragonfly-operator/templates/service.yaml @@ -12,6 +12,10 @@ spec: targetPort: https protocol: TCP name: https + - port: {{ .Values.service.metricsPort }} + targetPort: metrics + protocol: TCP + name: metrics selector: {{- include "dragonfly-operator.selectorLabels" . | nindent 4 }} - control-plane: controller-manager \ No newline at end of file + control-plane: controller-manager diff --git a/charts/dragonfly-operator/templates/servicemonitor.yaml b/charts/dragonfly-operator/templates/servicemonitor.yaml index c5f3e76..d7e8827 100644 --- a/charts/dragonfly-operator/templates/servicemonitor.yaml +++ b/charts/dragonfly-operator/templates/servicemonitor.yaml @@ -12,7 +12,7 @@ metadata: name: {{ include "dragonfly-operator.fullname" . }}-controller-manager-metrics spec: endpoints: - - targetPort: {{ .Values.service.port }} + - targetPort: {{ .Values.service.metricsPort }} {{- if .Values.serviceMonitor.interval }} interval: {{ .Values.serviceMonitor.interval }} {{- end }} @@ -23,11 +23,11 @@ spec: scrapeTimeout: {{ .Values.serviceMonitor.timeout }} {{- end }} {{- if .Values.serviceMonitor.relabelings }} - relabelings: + relabelings: {{- toYaml .Values.serviceMonitor.relabelings | nindent 4 }} {{- end }} {{- if .Values.serviceMonitor.metricRelabelings }} - metricRelabelings: + metricRelabelings: {{- toYaml .Values.serviceMonitor.metricRelabelings | nindent 4 }} {{- end }} jobLabel: {{ template "dragonfly-operator.fullname" . }} diff --git a/charts/dragonfly-operator/values.yaml b/charts/dragonfly-operator/values.yaml index 18e67b7..0901e74 100644 --- a/charts/dragonfly-operator/values.yaml +++ b/charts/dragonfly-operator/values.yaml @@ -40,6 +40,7 @@ podSecurityContext: service: type: ClusterIP port: 8443 + metricsPort: 8080 terminationGracePeriodSeconds: 10