From ee82696ffe4bfb184318c89f35cae4a30e7980d7 Mon Sep 17 00:00:00 2001 From: Massaki Archambault Date: Sun, 26 Sep 2021 17:00:29 -0400 Subject: [PATCH] add helium-blockchain-exporter --- .../blackbox-exporter/kustomization.yaml | 2 +- ...helium-blockchain-exporter-deployment.yaml | 49 +++++++++++++++++++ ...um-blockchain-exporter-servicemonitor.yaml | 13 +++++ .../kustomization.yaml | 9 ++++ .../namespaces/monitoring/kustomization.yaml | 1 + .../overlays/dev-cluster/kustomization.yaml | 2 +- kustomize/overlays/dev/kustomization.yaml | 2 +- .../overlays/prod-cluster/kustomization.yaml | 2 +- kustomize/overlays/prod/kustomization.yaml | 8 ++- 9 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-deployment.yaml create mode 100644 kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-servicemonitor.yaml create mode 100644 kustomize/bases/helium-blockchain-exporter/kustomization.yaml diff --git a/kustomize/bases/blackbox-exporter/kustomization.yaml b/kustomize/bases/blackbox-exporter/kustomization.yaml index eb16224..d52599e 100644 --- a/kustomize/bases/blackbox-exporter/kustomization.yaml +++ b/kustomize/bases/blackbox-exporter/kustomization.yaml @@ -1,2 +1,2 @@ resources: - - blackbox-exporter-deployment.yaml + - blackbox-exporter-deployment.yaml \ No newline at end of file diff --git a/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-deployment.yaml b/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-deployment.yaml new file mode 100644 index 0000000..88067d4 --- /dev/null +++ b/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-deployment.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: helium-blockchain-exporter +spec: + selector: + matchLabels: + app.kubernetes.io/name: helium-blockchain-exporter + template: + metadata: + labels: + app.kubernetes.io/name: helium-blockchain-exporter + spec: + containers: + - name: helium-blockchain-exporter + image: badjware/helium-blockchain-exporter + env: + - name: ACCOUNTS + valueFrom: + configMapKeyRef: + name: blackbox-exporter-config + key: ACCOUNTS + args: + - -accounts + - $(ACCOUNTS) + resources: + requests: + memory: 128Mi + cpu: 100m + limits: + memory: 128Mi + cpu: 500m + ports: + - containerPort: 9865 + name: http-metrics +--- +apiVersion: v1 +kind: Service +metadata: + name: helium-blockchain-exporter + labels: + app.kubernetes.io/name: helium-blockchain-exporter +spec: + selector: + app.kubernetes.io/name: helium-blockchain-exporter + ports: + - name: http-metrics + port: 9865 + targetPort: http-metrics diff --git a/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-servicemonitor.yaml b/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-servicemonitor.yaml new file mode 100644 index 0000000..da0b36c --- /dev/null +++ b/kustomize/bases/helium-blockchain-exporter/helium-blockchain-exporter-servicemonitor.yaml @@ -0,0 +1,13 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: helium-blockchain-exporter + labels: + app.kubernetes.io/name: helium-blockchain-exporter + monitor: prometheus +spec: + selector: + matchLabels: + app.kubernetes.io/name: helium-blockchain-exporter + endpoints: + - port: http-metrics \ No newline at end of file diff --git a/kustomize/bases/helium-blockchain-exporter/kustomization.yaml b/kustomize/bases/helium-blockchain-exporter/kustomization.yaml new file mode 100644 index 0000000..4cf9958 --- /dev/null +++ b/kustomize/bases/helium-blockchain-exporter/kustomization.yaml @@ -0,0 +1,9 @@ +resources: + - helium-blockchain-exporter-deployment.yaml + - helium-blockchain-exporter-servicemonitor.yaml + +configMapGenerator: + - name: blackbox-exporter-config + literals: + # set the helium accounts to scrape here + - ACCOUNTS= \ No newline at end of file diff --git a/kustomize/namespaces/monitoring/kustomization.yaml b/kustomize/namespaces/monitoring/kustomization.yaml index bfff7c5..1941a6e 100644 --- a/kustomize/namespaces/monitoring/kustomization.yaml +++ b/kustomize/namespaces/monitoring/kustomization.yaml @@ -2,6 +2,7 @@ bases: - ../../bases/prometheus # - ../../bases/node-exporter - ../../bases/blackbox-exporter + - ../../bases/helium-blockchain-exporter - ../../bases/kube-state-metrics - servicemonitors/any-namespaces-http.yaml - servicemonitors/kubelet.yaml diff --git a/kustomize/overlays/dev-cluster/kustomization.yaml b/kustomize/overlays/dev-cluster/kustomization.yaml index 9028d37..fa2c13a 100644 --- a/kustomize/overlays/dev-cluster/kustomization.yaml +++ b/kustomize/overlays/dev-cluster/kustomization.yaml @@ -3,7 +3,7 @@ bases: - ../../namespaces/operators # allow "kubectl apply -l managed-by=cluster --prune ..." -commonlabels: +commonLabels: managed-by: kustomize-cluster transformers: diff --git a/kustomize/overlays/dev/kustomization.yaml b/kustomize/overlays/dev/kustomization.yaml index 73f36f1..50a07ae 100644 --- a/kustomize/overlays/dev/kustomization.yaml +++ b/kustomize/overlays/dev/kustomization.yaml @@ -53,7 +53,7 @@ secretGenerator: - password=nextcloud # allow "kubectl apply -l managed-by=kustomize --prune ..." -commonlabels: +commonLabels: managed-by: kustomize transformers: diff --git a/kustomize/overlays/prod-cluster/kustomization.yaml b/kustomize/overlays/prod-cluster/kustomization.yaml index 83b61ab..1ac61ac 100644 --- a/kustomize/overlays/prod-cluster/kustomization.yaml +++ b/kustomize/overlays/prod-cluster/kustomization.yaml @@ -4,7 +4,7 @@ bases: - ../../bases/longhorn # allow "kubectl apply -l managed-by=cluster --prune ..." -commonlabels: +commonLabels: managed-by: kustomize-cluster transformers: diff --git a/kustomize/overlays/prod/kustomization.yaml b/kustomize/overlays/prod/kustomization.yaml index 8db71a5..ba45965 100644 --- a/kustomize/overlays/prod/kustomization.yaml +++ b/kustomize/overlays/prod/kustomization.yaml @@ -30,6 +30,12 @@ images: - name: redis newTag: 6.2.5 +configMapGenerator: + - name: blackbox-exporter-config + behavior: replace + literals: + - ACCOUNTS=13ntuT3ZC5A1RKEUciXh7qxvQvZ38azqBPHSdUGTpun8evVVTVy + secretGenerator: - name: drone-secret type: Opaque @@ -62,7 +68,7 @@ secretGenerator: - password=${ssm:/k3s/prod/nextcloud/redis/password} # allow "kubectl apply -l managed-by=kustomize --prune ..." -commonlabels: +commonLabels: managed-by: kustomize transformers: