diff --git a/charts/prom-aggregation-gateway/Chart.yaml b/charts/prom-aggregation-gateway/Chart.yaml index 3edf0b0b..bb8897e6 100644 --- a/charts/prom-aggregation-gateway/Chart.yaml +++ b/charts/prom-aggregation-gateway/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: prom-aggregation-gateway -version: 0.0.1 +version: 0.0.2 home: https://github.com/zapier/prom-aggregation-gateway appVersion: latest description: cLabs prometheus aggregation gateway diff --git a/charts/prom-aggregation-gateway/README.md b/charts/prom-aggregation-gateway/README.md index 42c5cb37..e51d2fd5 100644 --- a/charts/prom-aggregation-gateway/README.md +++ b/charts/prom-aggregation-gateway/README.md @@ -1,6 +1,6 @@ # prom-aggregation-gateway -![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) +![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square) cLabs prometheus aggregation gateway diff --git a/charts/prom-aggregation-gateway/templates/_helpers.tpl b/charts/prom-aggregation-gateway/templates/_helpers.tpl index c84c3e05..db111788 100644 --- a/charts/prom-aggregation-gateway/templates/_helpers.tpl +++ b/charts/prom-aggregation-gateway/templates/_helpers.tpl @@ -2,6 +2,24 @@ {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "prom-aggregation-gateway.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + {{- define "prom-aggregation-gateway.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end -}} diff --git a/charts/prom-aggregation-gateway/templates/controller.yaml b/charts/prom-aggregation-gateway/templates/controller.yaml index 856afbd7..19688e62 100644 --- a/charts/prom-aggregation-gateway/templates/controller.yaml +++ b/charts/prom-aggregation-gateway/templates/controller.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: {{ .Values.controller.type }} metadata: - name: {{ .Release.Name }} + name: {{ include "prom-aggregation-gateway.fullname" . }} labels: {{- include "prom-aggregation-gateway.labels" . | nindent 4 }} {{- if .Values.controller.labels }} diff --git a/charts/prom-aggregation-gateway/templates/ingress.yaml b/charts/prom-aggregation-gateway/templates/ingress.yaml index 39909c43..8104d9f3 100644 --- a/charts/prom-aggregation-gateway/templates/ingress.yaml +++ b/charts/prom-aggregation-gateway/templates/ingress.yaml @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ .Release.Name }} + name: {{ include "prom-aggregation-gateway.fullname" . }} labels: {{- include "prom-aggregation-gateway.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} @@ -33,7 +33,7 @@ spec: {{- end }} backend: service: - name: {{ .Release.Name }} + name: {{ include "prom-aggregation-gateway.fullname" . }} port: number: api-port {{- end }} diff --git a/charts/prom-aggregation-gateway/templates/podmonitor.yaml b/charts/prom-aggregation-gateway/templates/podmonitor.yaml index c1751402..05023ac8 100644 --- a/charts/prom-aggregation-gateway/templates/podmonitor.yaml +++ b/charts/prom-aggregation-gateway/templates/podmonitor.yaml @@ -2,7 +2,7 @@ apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: - name: {{ .Release.Name }}-metrics + name: {{ include "prom-aggregation-gateway.fullname" . }} {{- with .Values.podMonitor.additionalLabels }} labels: {{- toYaml . | nindent 4 }} diff --git a/charts/prom-aggregation-gateway/templates/service.yaml b/charts/prom-aggregation-gateway/templates/service.yaml index 670c4029..9c84d3bb 100644 --- a/charts/prom-aggregation-gateway/templates/service.yaml +++ b/charts/prom-aggregation-gateway/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Release.Name }} + name: {{ include "prom-aggregation-gateway.fullname" . }} labels: {{- include "prom-aggregation-gateway.selectorLabels" . | nindent 4 }} {{- with .Values.service.annotations }} diff --git a/charts/prom-aggregation-gateway/templates/servicemonitor.yaml b/charts/prom-aggregation-gateway/templates/servicemonitor.yaml index fb17879b..0071f66b 100644 --- a/charts/prom-aggregation-gateway/templates/servicemonitor.yaml +++ b/charts/prom-aggregation-gateway/templates/servicemonitor.yaml @@ -2,7 +2,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ .Release.Name }} + name: {{ include "prom-aggregation-gateway.fullname" . }} {{- with .Values.serviceMonitor.additionalLabels }} labels: {{- toYaml . | nindent 4 }}