UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit 4a7f3ff6 authored by Michael Martin's avatar Michael Martin
Browse files

Merge branch 'alloy-servicemonitor' into 'master'

Add service monitor to Alloy/values.yaml

Closes big-bang/product/packages/alloy#83

See merge request !5941
parents 427ed3ee 9269f4bb
No related branches found
No related tags found
1 merge request!5941Add service monitor to Alloy/values.yaml
Pipeline #4051776 passed
{{- define "alloy.istioPostRenderers" }}
- kustomize:
patches:
- patch: |
- op: replace
path: /spec/endpoints/0/scheme
value: https
target:
kind: ServiceMonitor
name: ".*alloy-alloy.*"
{{- end }}
\ No newline at end of file
{{- $fluxSettingsMonitoring := merge .Values.addons.alloy.flux .Values.flux -}}
{{- $fluxSettingsAlloy := merge .Values.addons.alloy.flux .Values.flux -}}
{{- $isStrictIstio := and (eq (include "istioEnabled" .) "true") (eq (dig "istio" "mtls" "mode" "STRICT" .Values.addons.alloy.values) "STRICT") -}}
{{- if .Values.addons.alloy.enabled }}
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
......@@ -37,12 +38,15 @@ spec:
{{- end }}
{{- end }}
interval: 5m
{{- toYaml $fluxSettingsMonitoring | nindent 2 }}
{{- if .Values.addons.alloy.postRenderers }}
{{- toYaml $fluxSettingsAlloy | nindent 2 }}
{{- if or .Values.addons.alloy.postRenderers (and .Values.monitoring.enabled $isStrictIstio ) }}
postRenderers:
{{ toYaml .Values.addons.alloy.postRenderers | nindent 4 }}
{{- if and .Values.monitoring.enabled $isStrictIstio }}
{{- include "alloy.istioPostRenderers" . | nindent 4 }}
{{- end }}
{{- with .Values.addons.alloy.postRenderers }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
valuesFrom:
- name: {{ .Release.Name }}-alloy-values
......@@ -70,6 +74,10 @@ spec:
- name: kyverno-policies
namespace: {{ .Release.Namespace }}
{{- end }}
{{- if .Values.monitoring.enabled }}
- name: monitoring
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
{{- end }}
......@@ -26,4 +26,18 @@ istio:
(dig "istio" "hardened" "enabled" false .Values.addons.alloy.values)
}}
k8s-monitoring:
{{- range $service := list "alloy-metrics" "alloy-log" }} # Add/Remove Alloy Micro-Services as Alloy Configurations Change
{{ $service }}:
serviceMonitor:
enabled: {{ $.Values.monitoring.enabled }}
{{- if and (include "istioEnabled" $) (eq (dig "istio" "mtls" "mode" "STRICT" $.Values.addons.alloy.values) "STRICT") }}
tlsConfig:
caFile: /etc/prom-certs/root-cert.pem
certFile: /etc/prom-certs/cert-chain.pem
keyFile: /etc/prom-certs/key.pem
insecureSkipVerify: true # Prometheus does not support Istio security naming, thus skip verifying target pod certificate
{{- end }}
{{- end }}
{{- end }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment