Skip to content

Commit

Permalink
Merge pull request cert-manager#1942 from Starefossen/helm/servicemon…
Browse files Browse the repository at this point in the history
…itor-labels

helm: fix lables and add Service for Prometheus ServiceMonitor
  • Loading branch information
jetstack-bot committed Aug 2, 2019
2 parents 946b1f2 + a751a46 commit 465541a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
22 changes: 22 additions & 0 deletions deploy/charts/cert-manager/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.prometheus.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "cert-manager.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
app: {{ template "cert-manager.name" . }}
app.kubernetes.io/name: {{ template "cert-manager.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ template "cert-manager.chart" . }}
spec:
type: ClusterIP
ports:
- protocol: TCP
port: 9402
targetPort: 9402
selector:
app.kubernetes.io/name: {{ template "cert-manager.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
11 changes: 6 additions & 5 deletions deploy/charts/cert-manager/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ metadata:
namespace: {{ .Release.Namespace | quote }}
labels:
app: {{ template "cert-manager.name" . }}
chart: {{ template "cert-manager.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/name: {{ template "cert-manager.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ template "cert-manager.chart" . }}
prometheus: {{ .Values.prometheus.servicemonitor.prometheusInstance }}
spec:
jobLabel: {{ template "cert-manager.fullname" . }}
selector:
matchLabels:
app: {{ template "cert-manager.name" . }}
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ template "cert-manager.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
endpoints:
- targetPort: {{ .Values.prometheus.servicemonitor.targetPort }}
path: {{ .Values.prometheus.servicemonitor.path }}
Expand Down

0 comments on commit 465541a

Please sign in to comment.