Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

[concourse] Add service which targets prometheus port when prometheus metrics are enabled #6422

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stable/concourse/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: concourse
version: 1.10.1
version: 1.11.0
appVersion: 3.14.1
description: Concourse is a simple and scalable CI system.
icon: https://avatars1.githubusercontent.com/u/7809479
Expand Down
5 changes: 5 additions & 0 deletions stable/concourse/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "concourse.prometheus.fullname" -}}
{{- $name := default "web" .Values.web.nameOverride -}}
{{- printf "%s-%s-prometheus" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "concourse.worker.fullname" -}}
{{- $name := default "worker" .Values.worker.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
Expand Down
19 changes: 19 additions & 0 deletions stable/concourse/templates/web-prometheus-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.web.metrics.prometheus.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "concourse.prometheus.fullname" . }}
labels:
app: {{ template "concourse.prometheus.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
clusterIP: "None"
ports:
- name: prometheus
port: {{ .Values.web.metrics.prometheus.port }}
targetPort: prometheus
selector:
app: {{ template "concourse.web.fullname" . }}
{{- end -}}