mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-24 07:59:02 +00:00
enable prometheus servicemonitor (#164)
also enable proper healthchecks Fixes #160 Fixes #161 Signed-off-by: Jeff Billimek <jeff@billimek.com>
This commit is contained in:
parent
018c383c7c
commit
a2f4de737f
@ -2,7 +2,7 @@ apiVersion: v1
|
||||
appVersion: "v0.5"
|
||||
description: DNS proxy as ad-blocker for local network
|
||||
name: blocky
|
||||
version: 1.1.2
|
||||
version: 2.0.0
|
||||
keywords:
|
||||
- blocky
|
||||
- dbs
|
||||
|
@ -19,6 +19,10 @@ spec:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "blocky.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
@ -36,34 +40,34 @@ spec:
|
||||
- name: logs
|
||||
mountPath: /logs
|
||||
ports:
|
||||
- name: prometheus
|
||||
ports:
|
||||
- name: monitoring
|
||||
containerPort: 4000
|
||||
- name: dns
|
||||
containerPort: 53
|
||||
protocol: TCP
|
||||
- containerPort: 53
|
||||
name: dns
|
||||
protocol: TCP
|
||||
- containerPort: 53
|
||||
name: dns-udp
|
||||
- name: dns-udp
|
||||
containerPort: 53
|
||||
protocol: UDP
|
||||
# livenessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
# failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
|
||||
# periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
|
||||
# readinessProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
# failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
|
||||
# periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
|
||||
# startupProbe:
|
||||
# httpGet:
|
||||
# path: /
|
||||
# port: http
|
||||
# initialDelaySeconds: {{ .Values.probes.startup.initialDelaySeconds }}
|
||||
# failureThreshold: {{ .Values.probes.startup.failureThreshold }}
|
||||
# periodSeconds: {{ .Values.probes.startup.periodSeconds }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: monitoring
|
||||
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
|
||||
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: monitoring
|
||||
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
|
||||
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: monitoring
|
||||
initialDelaySeconds: {{ .Values.probes.startup.initialDelaySeconds }}
|
||||
failureThreshold: {{ .Values.probes.startup.failureThreshold }}
|
||||
periodSeconds: {{ .Values.probes.startup.periodSeconds }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumes:
|
||||
|
@ -1,21 +1,18 @@
|
||||
{{- if .Values.servicePrometheus.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "blocky.fullname" . }}-prometheus
|
||||
name: {{ include "blocky.fullname" . }}-headless
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "blocky.name" . }}
|
||||
helm.sh/chart: {{ include "blocky.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
spec:
|
||||
type: {{ .Values.servicePrometheus.type }}
|
||||
clusterIP: None
|
||||
ports:
|
||||
- port: {{ .Values.servicePrometheus.port }}
|
||||
targetPort: prometheus
|
||||
protocol: TCP
|
||||
name: prometheus
|
||||
- name: monitoring
|
||||
port: 4000
|
||||
targetPort: monitoring
|
||||
selector:
|
||||
app.kubernetes.io/name: {{ include "blocky.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
23
charts/blocky/templates/servicemonitor.yaml
Normal file
23
charts/blocky/templates/servicemonitor.yaml
Normal file
@ -0,0 +1,23 @@
|
||||
{{- if .Values.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ include "blocky.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "blocky.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
helm.sh/chart: {{ include "blocky.chart" . }}
|
||||
{{- with .Values.serviceMonitor.additionalLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "blocky.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
endpoints:
|
||||
- port: monitoring
|
||||
interval: 30s
|
||||
path: /metrics
|
||||
{{- end }}
|
@ -152,14 +152,14 @@ serviceUDP:
|
||||
# metallb.universe.tf/address-pool: network-services
|
||||
# metallb.universe.tf/allow-shared-ip: blocky-svc
|
||||
|
||||
servicePrometheus:
|
||||
serviceMonitor:
|
||||
enabled: false
|
||||
port: 4000
|
||||
type: ClusterIP
|
||||
externalTrafficPolicy: Local
|
||||
loadBalancerIP: ""
|
||||
# a fixed LoadBalancer IP
|
||||
annotations: {}
|
||||
additionalLabels: {}
|
||||
|
||||
## Pod Annotations
|
||||
podAnnotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "monitoring"
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
|
Loading…
Reference in New Issue
Block a user