Add elasticsearch-exporter to our elastic-stack

This change introduces a function for deploying the community
prometheus-easticsearch-exporter chart, and adds it to our
elastic-stack composite.

Upon review it was found that the chart version was being
replaced at the incorrect yaml path accross all LMA components,
so these replacements are corrected in this PS as well.

Change-Id: Iad973f4a16d9985a639c3c6927d9f74cd57f4910
This commit is contained in:
Steven Fitzpatrick 2021-05-24 17:25:38 +00:00
parent 4bf27930e9
commit fdcac8d9fb
16 changed files with 109 additions and 8 deletions

View File

@ -36,7 +36,7 @@ replacements:
objref:
kind: HelmRelease
name: elasticsearch-data
fieldrefs: ["{.spec.chart.version}"]
fieldrefs: ["{.spec.chart.spec.version}"]
- source:
objref:
kind: VersionsCatalogue

View File

@ -36,7 +36,7 @@ replacements:
objref:
kind: HelmRelease
name: elasticsearch-ingest
fieldrefs: ["{.spec.chart.version}"]
fieldrefs: ["{.spec.chart.spec.version}"]
- source:
objref:
kind: VersionsCatalogue

View File

@ -2,8 +2,10 @@ resources:
- elasticsearch-ingest
- elasticsearch-data
- ../../function/kibana
- ../../function/prometheus-elasticsearch-exporter
namespace: lma
patches:
- path: patches/kibana.yaml
- path: patches/prometheus-elasticsearch-exporter.yaml

View File

@ -0,0 +1,14 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: prometheus-elasticsearch-exporter
spec:
values:
es:
uri: http://elasticsearch-ingest.lma.svc.cluster.local:9200
serviceMonitor:
enabled: true
prometheusRule:
enabled: false
serviceAccount:
create: true

View File

@ -2,3 +2,4 @@ resources:
- ../elasticsearch-ingest/replacements
- ../elasticsearch-data/replacements
- ../../../function/kibana/replacements
- ../../../function/prometheus-elasticsearch-exporter/replacements

View File

@ -36,7 +36,7 @@ replacements:
objref:
kind: HelmRelease
name: elasticseach
fieldrefs: ["{.spec.chart.version}"]
fieldrefs: ["{.spec.chart.spec.version}"]
- source:
objref:
kind: VersionsCatalogue

View File

@ -36,7 +36,7 @@ replacements:
objref:
kind: HelmRelease
name: grafana
fieldrefs: ["{.spec.chart.version}"]
fieldrefs: ["{.spec.chart.spec.version}"]
- source:
objref:
kind: VersionsCatalogue

View File

@ -39,7 +39,7 @@ replacements:
objref:
kind: HelmRelease
name: kube-prometheus-stack
fieldrefs: ["{.spec.chart.version}"]
fieldrefs: ["{.spec.chart.spec.version}"]
# Images
- source:

View File

@ -39,7 +39,7 @@ replacements:
objref:
kind: HelmRelease
name: logging-operator
fieldrefs: ["{.spec.chart.version}"]
fieldrefs: ["{.spec.chart.spec.version}"]
# Logging-operator-logging Chart
- source:
@ -61,7 +61,7 @@ replacements:
objref:
kind: HelmRelease
name: logging-operator-logging
fieldrefs: ["{.spec.chart.version}"]
fieldrefs: ["{.spec.chart.spec.version}"]
# Logging-operator Chart Image
- source:

View File

@ -0,0 +1,17 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: prometheus-elasticsearch-exporter
spec:
releaseName: prometheus-elasticsearch-exporter
interval: 5m
chart:
spec:
sourceRef:
kind: HelmRepository
name: prometheus-elasticsearch-exporter
interval: 1m
timeout: 5m
# Reference values at
# https://github.com/prometheus-community/helm-charts/blob/main/charts/prometheus-elasticsearch-exporter/values.yaml
values: {}

View File

@ -0,0 +1,6 @@
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: prometheus-elasticsearch-exporter
spec:
interval: 10m

View File

@ -0,0 +1,3 @@
resources:
- helmrepository.yaml
- helmrelease.yaml

View File

@ -0,0 +1,2 @@
resources:
- versions.yaml

View File

@ -0,0 +1,49 @@
apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
name: prometheus-elasticsearch-exporter-versions-replacements
annotations:
config.kubernetes.io/function: |-
container:
image: quay.io/airshipit/replacement-transformer:v2
replacements:
- source:
objref:
kind: VersionsCatalogue
name: versions-treasuremap
fieldref: "{.spec.helm_repositories.prometheus_community.url}"
target:
objref:
kind: HelmRepository
name: prometheus-elasticsearch-exporter
fieldrefs: ["{.spec.url}"]
- source:
objref:
kind: VersionsCatalogue
name: versions-treasuremap
fieldref: "{.spec.charts.prometheus_elasticsearch_exporter.chart}"
target:
objref:
kind: HelmRelease
name: prometheus-elasticsearch-exporter
fieldrefs: ["{.spec.chart.spec.chart}"]
- source:
objref:
kind: VersionsCatalogue
name: versions-treasuremap
fieldref: "{.spec.charts.prometheus_elasticsearch_exporter.version}"
target:
objref:
kind: HelmRelease
name: prometheus-elasticsearch-exporter
fieldrefs: ["{.spec.chart.spec.version}"]
- source:
objref:
kind: VersionsCatalogue
name: versions-treasuremap
fieldref: "{.spec.image_components.prometheus_elasticsearch_exporter.prometheus_elasticsearch_exporter}"
target:
objref:
kind: HelmRelease
name: prometheus-elasticsearch-exporter
fieldrefs: ["{.spec.values.image}"]

View File

@ -37,7 +37,7 @@ replacements:
objref:
kind: HelmRelease
name: thanos-operator
fieldrefs: ["{.spec.chart.version}"]
fieldrefs: ["{.spec.chart.spec.version}"]
- source:
objref:

View File

@ -52,6 +52,9 @@ spec:
minio:
chart: minio
version: 8.0.10
prometheus_elasticsearch_exporter:
chart: prometheus-elasticsearch-exporter
version: 4.4.0
thanos_operator:
chart: thanos-operator
version: 0.2.1
@ -193,6 +196,10 @@ spec:
mc:
repository: minio/mc
tag: RELEASE.2020-10-03T02-54-56Z
prometheus_elasticsearch_exporter:
prometheus_elasticsearch_exporter:
repository: justwatch/elasticsearch_exporter
tag: 1.1.0
thanos:
thanos-operator:
repository: banzaicloud/thanos-operator