fix(prometheus): migrate away services

This commit is contained in:
kjeld Schouten-Lebbing
2021-11-22 22:37:49 +01:00
parent d3efd3f03d
commit 73e36d360b
6 changed files with 3 additions and 89 deletions

View File

@@ -20,7 +20,7 @@ sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
type: application
version: 0.0.4
version: 0.0.5
annotations:
truecharts.org/catagories: |
- metrics

View File

@@ -1,43 +0,0 @@
{{- if .Values.alertmanager.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "kube-prometheus.alertmanager.fullname" . }}
namespace: {{ .Release.Namespace }}
labels: {{- include "kube-prometheus.alertmanager.labels" . | nindent 4 }}
{{- with .Values.alertmanager.service.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.alertmanager.service.type }}
{{- if index .Values.alertmanager "stickySessions" }}
sessionAffinity: ClientIP
{{- end }}
{{- if and .Values.alertmanager.service.loadBalancerIP (eq .Values.alertmanager.service.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.alertmanager.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.alertmanager.service.type "LoadBalancer") .Values.alertmanager.service.loadBalancerSourceRanges }}
{{- with .Values.alertmanager.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- if and (eq .Values.alertmanager.service.type "LoadBalancer") .Values.alertmanager.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.alertmanager.service.externalTrafficPolicy }}
{{- end }}
{{- if and (eq .Values.alertmanager.service.type "LoadBalancer") (eq .Values.alertmanager.service.externalTrafficPolicy "Local") .Values.alertmanager.service.healthCheckNodePort }}
healthCheckNodePort: {{ .Values.alertmanager.service.healthCheckNodePort }}
{{- end }}
{{- if and (eq .Values.alertmanager.service.type "ClusterIP") .Values.alertmanager.service.clusterIP }}
clusterIP: {{ .Values.alertmanager.service.clusterIP }}
{{- end }}
ports:
- name: http
port: {{ .Values.alertmanager.service.port }}
targetPort: 9093
{{- if and .Values.alertmanager.service.nodePort (or (eq .Values.alertmanager.service.type "NodePort") (eq .Values.alertmanager.service.type "LoadBalancer")) }}
nodePort: {{ .Values.alertmanager.service.nodePort }}
{{- end }}
selector:
app.kubernetes.io/name: alertmanager
alertmanager: {{ template "kube-prometheus.alertmanager.fullname" . }}
{{- end }}

View File

@@ -9,7 +9,6 @@
{{- include "prometheus.prometheus.prometheus" . }}
{{- include "prometheus.prometheus.additionalprometheusrules" . }}
{{- include "prometheus.prometheus.additionalscrapejobs" . }}
{{- include "prometheus.prometheus.thanos.service" . }}
{{- include "prometheus.prometheus.servicemonitor" . }}

View File

@@ -239,7 +239,7 @@ spec:
resources: {{- toYaml .Values.prometheus.thanos.resources | nindent 8 }}
{{- end }}
ports:
- name: grpc
- name: thanos
containerPort: 10901
protocol: TCP
- name: http

View File

@@ -1,42 +0,0 @@
{{- define "prometheus.prometheus.thanos.service" -}}
{{- if and .Values.prometheus.enabled .Values.prometheus.thanos.create }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "kube-prometheus.prometheus.fullname" . }}-thanos
namespace: {{ .Release.Namespace }}
labels: {{- include "kube-prometheus.prometheus.labels" . | nindent 4 }}
app.kubernetes.io/subcomponent: thanos
{{- if .Values.prometheus.thanos.service.annotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.prometheus.thanos.service.annotations "context" $) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.prometheus.thanos.service.type }}
{{- if and .Values.prometheus.thanos.service.loadBalancerIP (eq .Values.prometheus.thanos.service.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.prometheus.thanos.service.loadBalancerIP }}
{{- end }}
{{- if and (eq .Values.prometheus.thanos.service.type "LoadBalancer") .Values.prometheus.thanos.service.loadBalancerSourceRanges }}
{{- with .Values.prometheus.thanos.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- if and (eq .Values.prometheus.thanos.service.type "ClusterIP") .Values.prometheus.thanos.service.clusterIP }}
clusterIP: {{ .Values.prometheus.thanos.service.clusterIP }}
{{- end }}
ports:
- name: grpc
port: {{ .Values.prometheus.thanos.service.port }}
targetPort: grpc
protocol: TCP
{{- if and .Values.prometheus.thanos.service.nodePort (or (eq .Values.prometheus.thanos.service.type "NodePort") (eq .Values.prometheus.thanos.service.type "LoadBalancer")) }}
nodePort: {{ .Values.prometheus.thanos.service.nodePort }}
{{- end }}
{{- if .Values.prometheus.thanos.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.prometheus.thanos.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector:
app.kubernetes.io/name: prometheus
prometheus: {{ template "kube-prometheus.prometheus.fullname" . }}
{{- end }}
{{- end }}

View File

@@ -1164,7 +1164,7 @@ alertmanager:
routePrefix: /
## @param alertmanager.portName Port name used for the pods and governing service. This defaults to web
##
portName: web
portName: alertmanager
## @param alertmanager.configNamespaceSelector AlertmanagerConfigs to be selected for to merge and configure Alertmanager with. This defaults to {}
##
configNamespaceSelector: {}