diff --git a/charts/blocky/Chart.yaml b/charts/blocky/Chart.yaml index b9d03b8c..af74dc2f 100644 --- a/charts/blocky/Chart.yaml +++ b/charts/blocky/Chart.yaml @@ -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 diff --git a/charts/blocky/templates/deployment.yaml b/charts/blocky/templates/deployment.yaml index 2a1b3a0c..fdacf99d 100644 --- a/charts/blocky/templates/deployment.yaml +++ b/charts/blocky/templates/deployment.yaml @@ -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: diff --git a/charts/blocky/templates/service-prometheus.yaml b/charts/blocky/templates/headless-service.yaml similarity index 59% rename from charts/blocky/templates/service-prometheus.yaml rename to charts/blocky/templates/headless-service.yaml index 04388be9..13070e5a 100644 --- a/charts/blocky/templates/service-prometheus.yaml +++ b/charts/blocky/templates/headless-service.yaml @@ -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 }} diff --git a/charts/blocky/templates/servicemonitor.yaml b/charts/blocky/templates/servicemonitor.yaml new file mode 100644 index 00000000..1e908964 --- /dev/null +++ b/charts/blocky/templates/servicemonitor.yaml @@ -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 }} diff --git a/charts/blocky/values.yaml b/charts/blocky/values.yaml index f26ab48f..fc48ca40 100644 --- a/charts/blocky/values.yaml +++ b/charts/blocky/values.yaml @@ -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