From a65cf8ddb5f0cc51a123d45ca001728dab0101f0 Mon Sep 17 00:00:00 2001 From: Dmitry K Date: Wed, 26 Jul 2023 14:50:24 -0700 Subject: [PATCH] fix metrics scraping on LocalNet --- build/localnet/Tiltfile | 8 ++++++++ charts/pocket/templates/statefulset.yaml | 11 ++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build/localnet/Tiltfile b/build/localnet/Tiltfile index 9f5a36b4c..a88a3d8d5 100644 --- a/build/localnet/Tiltfile +++ b/build/localnet/Tiltfile @@ -190,6 +190,8 @@ for x in range(localnet_config["validators"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", + "podAnnotations.prometheus\\.io/scrape=true", + "podAnnotations.prometheus\\.io/port=9000", "nodeType=validator", ], values=[chart_dir + "/pocket-validator-overrides.yaml"] if os.path.exists(chart_dir + "/pocket-validator-overrides.yaml") else [],)) @@ -213,6 +215,8 @@ for x in range(localnet_config["servicers"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", + "podAnnotations.prometheus\\.io/scrape=true", + "podAnnotations.prometheus\\.io/port=9000", "config.servicer.enabled=true", "nodeType=servicer", ], @@ -237,6 +241,8 @@ for x in range(localnet_config["fishermen"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", + "podAnnotations.prometheus\\.io/scrape=true", + "podAnnotations.prometheus\\.io/port=9000", "config.fisherman.enabled=true", "nodeType=fisherman", ], @@ -261,6 +267,8 @@ for x in range(localnet_config["full_nodes"]["count"]): "genesis.externalConfigMap.name=v1-localnet-genesis", "genesis.externalConfigMap.key=genesis.json", "postgresql.primary.persistence.enabled=false", + "podAnnotations.prometheus\\.io/scrape=true", + "podAnnotations.prometheus\\.io/port=9000", "nodeType=full", ], values=[chart_dir + "/pocket-full-node-overrides.yaml"] if os.path.exists(chart_dir + "/pocket-full-node-overrides.yaml") else [],)) diff --git a/charts/pocket/templates/statefulset.yaml b/charts/pocket/templates/statefulset.yaml index 4be68b50b..c72fbb667 100644 --- a/charts/pocket/templates/statefulset.yaml +++ b/charts/pocket/templates/statefulset.yaml @@ -2,10 +2,6 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "pocket.fullname" . }} - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} labels: {{- include "pocket.labels" . | nindent 4 }} spec: @@ -17,10 +13,15 @@ spec: metadata: {{- with .Values.podAnnotations }} annotations: - {{- toYaml . | nindent 8 }} + {{- range $key, $value := . }} + {{ $key }}: {{ $value | quote }} + {{- end }} {{- end }} labels: {{- include "pocket.selectorLabels" . | nindent 8 }} + {{- if .Values.podLabels }} + {{- toYaml .Values.podLabels | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: