diff --git a/Makefile b/Makefile index 3a211f2..761954b 100644 --- a/Makefile +++ b/Makefile @@ -79,9 +79,20 @@ release-helm: cd .. release: release-docker release-helm helm-docs + # Prod release # ex. make VERSION=1.6.2 release + # Prerelease Candidate + # ex. make VERSION=1.6.3-rc01 release + +prerelease-github: + # Prerelease Candidate + # ex. make VERSION=1.6.3-rc01 prerelease-github + gh release create ${VERSION} --generate-notes --prerelease + gh release upload ${VERSION} "chart/k8s-ephemeral-storage-metrics-${VERSION}.tgz" + rm chart/k8s-ephemeral-storage-metrics-*.tgz release-github: + # Prod release # ex. make VERSION=1.6.2 release-github gh release create ${VERSION} --generate-notes gh release upload ${VERSION} "chart/k8s-ephemeral-storage-metrics-${VERSION}.tgz" diff --git a/chart/README.md.gotmpl b/chart/README.md.gotmpl index 6b6d89b..fb03109 100644 --- a/chart/README.md.gotmpl +++ b/chart/README.md.gotmpl @@ -10,9 +10,9 @@ helm upgrade --install my-deployment k8s-ephemeral-storage-metrics/k8s-ephemeral ## Contribute -### Start Kind +### Start minikube ```bash -make new_kind +make new_minikube ``` ### Run locally diff --git a/chart/templates/metrics.yaml b/chart/templates/metrics.yaml index 3c46f5a..aae2ec6 100644 --- a/chart/templates/metrics.yaml +++ b/chart/templates/metrics.yaml @@ -11,12 +11,32 @@ spec: port: metrics scheme: http interval: "{{ .Values.interval }}s" + {{- if .Values.serviceMonitor.metricRelabelings }} + metricRelabelings: + {{ toYaml .Values.serviceMonitor.metricRelabelings | indent 4 }} + {{- end }} + {{- if .Values.serviceMonitor.relabelings }} + relabelings: + {{ toYaml .Values.serviceMonitor.relabelings | indent 4 }} + {{- end }} namespaceSelector: matchNames: - {{ .Release.Namespace }} selector: matchLabels: {{- include "chart.selectorLabels" . | nindent 6 }} + {{- if .Values.serviceMonitor.targetLabels }} + targetLabels: + {{- range .Values.serviceMonitor.targetLabels }} + - {{ . }} + {{- end }} + {{- end }} + {{- if .Values.serviceMonitor.podTargetLabels }} + podTargetLabels: + {{- range .Values.serviceMonitor.podTargetLabels }} + - {{ . }} + {{- end }} + {{- end }} --- diff --git a/chart/values.yaml b/chart/values.yaml index da26d1f..3100831 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -3,6 +3,17 @@ image: tag: 1.6.2 imagePullPolicy: IfNotPresent +serviceMonitor: + # Set relabelings as per https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.RelabelConfig + relabelings: [] + # Set metricRelabelings as per https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.RelabelConfig + metricRelabelings: [] + # Set targetLabels as per https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.ServiceMonitorSpec + targetLabels: [] + # Set podTargetLabels as per https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.ServiceMonitorSpec + podTargetLabels: [] + + # -- Set metrics you want to enable metrics: # -- Percentage of ephemeral storage used by a container in a pod