From a36a9d3e7add4fcc8782170c2a57ff32a2a57b90 Mon Sep 17 00:00:00 2001 From: Romain Guichard Date: Thu, 21 Sep 2023 10:59:07 +0200 Subject: [PATCH] feat: rework helm-chart (#69) * feat: rework helm-chart * fixes as per comments Signed-off-by: Mehdi Bechiri * fixing missing addresses in helper Signed-off-by: Mehdi Bechiri * remove top-level value watcher Signed-off-by: Mehdi Bechiri * rename sa and freeze appVersion Signed-off-by: Mehdi Bechiri --------- Signed-off-by: Mehdi Bechiri Co-authored-by: Mehdi Bechiri --- .github/workflows/helm-chart.yaml | 83 ++++++++++ README.md | 4 +- charts/eth-validator-watcher/Chart.yaml | 3 +- charts/eth-validator-watcher/README.md | 63 ++++---- .../templates/_helpers.tpl | 46 +++--- .../templates/configmap.yaml | 9 +- .../templates/deployment.yaml | 148 ++++++++---------- .../templates/podmonitor.yaml | 33 ++++ .../templates/service.yaml | 15 -- .../templates/serviceaccount.yaml | 10 +- .../templates/servicemonitor.yaml | 40 ----- charts/eth-validator-watcher/values.yaml | 114 +++++--------- grafana_dashboard.json | 2 +- tests/beacon/assets/rewards.json | 2 +- 14 files changed, 299 insertions(+), 273 deletions(-) create mode 100644 .github/workflows/helm-chart.yaml create mode 100644 charts/eth-validator-watcher/templates/podmonitor.yaml delete mode 100644 charts/eth-validator-watcher/templates/service.yaml delete mode 100644 charts/eth-validator-watcher/templates/servicemonitor.yaml diff --git a/.github/workflows/helm-chart.yaml b/.github/workflows/helm-chart.yaml new file mode 100644 index 0000000..0fe1798 --- /dev/null +++ b/.github/workflows/helm-chart.yaml @@ -0,0 +1,83 @@ +name: charts::ghcr-oci + +on: + push: + branches: + - main + paths: + - "charts/**" + - ".github/workflows/helm-chart.yaml" + pull_request: + branches: + - main + paths: + - "charts/**" + - ".github/workflows/helm-chart.yaml" + +permissions: + id-token: write + actions: write + pull-requests: write + issues: write + contents: write + packages: write + +jobs: + helm-lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.1.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch main --chart-dirs charts) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + run: ct lint --target-branch main --chart-dirs charts + + helm-release: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + needs: + - helm-lint-test + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install Helm + uses: azure/setup-helm@v3 + with: + version: v3.8.0 + + - name: 'helm:package:create' + run: | + helm package charts/ + + - name: 'helm:package:get_artifcat_name' + run: | + find . -name "*.tgz" + echo "ARTIFACT_NAME=$(find . -name "*.tgz" -maxdepth 1)" >> $GITHUB_ENV + + - name: 'helm:package:upload' + run: | + echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username kilnfi --password-stdin + helm push ${{ env.ARTIFACT_NAME }} oci://${{ env.REGISTRY }}/kilnfi/helm-charts/ + env: + REGISTRY: ghcr.io diff --git a/README.md b/README.md index 698acc7..8b872a2 100644 --- a/README.md +++ b/README.md @@ -49,12 +49,12 @@ Finally, this program exports the following sets of data from: - Prometheus (you can use this Grafana dashboard to monitor your validators) - Slack - logs - + Prometheus server is automatically exposed on port 8000. Command line options -------------------- - + ``` ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ * --beacon-url TEXT URL of beacon node [required] │ diff --git a/charts/eth-validator-watcher/Chart.yaml b/charts/eth-validator-watcher/Chart.yaml index cb3fee8..853db5d 100644 --- a/charts/eth-validator-watcher/Chart.yaml +++ b/charts/eth-validator-watcher/Chart.yaml @@ -2,7 +2,8 @@ apiVersion: v2 description: A Helm chart for running eth-validator-watcher name: eth-validator-watcher type: application -version: 1.0.0 +version: 1.1.0 +appVersion: v0.4.2 maintainers: - name: Alluvial email: contact@alluvial.finance diff --git a/charts/eth-validator-watcher/README.md b/charts/eth-validator-watcher/README.md index ba4d5d0..fdc3e16 100644 --- a/charts/eth-validator-watcher/README.md +++ b/charts/eth-validator-watcher/README.md @@ -1,6 +1,6 @@ # eth-validator-watcher -![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.4.2](https://img.shields.io/badge/AppVersion-v0.4.2-informational?style=flat-square) A Helm chart for running eth-validator-watcher @@ -15,48 +15,51 @@ A Helm chart for running eth-validator-watcher | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | | -| args | list | `[]` | Specifies the arguments to the command line Please refer to https://github.com/kilnfi/eth-validator-watcher/blob/main/README.md#description | -| env | object | `{}` | | -| envFrom | object | `{}` | | +| config.beaconType | string | `"other"` | | +| config.beaconUrl | string | `"http://localhost:5052"` | | +| config.watchedKeys | list | `[]` | List of public keys to watch. See https://github.com/kilnfi/eth-validator-watcher/blob/main/README.md#command-lines-examples | +| extraArgs | list | `[]` | | +| extraInitContainers | list | `[]` | | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | | image.repository | string | `"ghcr.io/kilnfi/eth-validator-watcher"` | | -| image.tag | string | `"latest"` | | +| image.tag | string | `""` | | | imagePullSecrets | list | `[]` | | -| livenessProbe.exec.command[0] | string | `"/usr/bin/python3.9"` | | -| livenessProbe.exec.command[1] | string | `"/usr/local/bin/liveness_check.py"` | | -| livenessProbe.exec.command[2] | string | `"/tmp/liveness"` | | -| livenessProbe.failureThreshold | int | `10` | | -| livenessProbe.initialDelaySeconds | int | `120` | | +| livenessProbe.failureThreshold | int | `1` | | +| livenessProbe.initialDelaySeconds | int | `60` | | | livenessProbe.periodSeconds | int | `60` | | +| livenessProbe.successThreshold | int | `1` | | +| livenessProbe.timeoutSeconds | int | `1` | | | nameOverride | string | `""` | | | nodeSelector | object | `{}` | | | podAnnotations | object | `{}` | | +| podLabels | object | `{}` | | +| podMonitor.additionalLabels | object | `{}` | | +| podMonitor.enabled | bool | `false` | | +| podMonitor.interval | string | `"12s"` | | +| podMonitor.relabelings | list | `[]` | | +| podMonitor.scheme | string | `"http"` | | +| podMonitor.tlsConfig | object | `{}` | | | podSecurityContext | object | `{}` | | -| readinessProbe.exec.command[0] | string | `"/usr/bin/python3.9"` | | -| readinessProbe.exec.command[1] | string | `"/usr/local/bin/liveness_check.py"` | | -| readinessProbe.exec.command[2] | string | `"/tmp/liveness"` | | -| readinessProbe.failureThreshold | int | `10` | | -| readinessProbe.initialDelaySeconds | int | `30` | | +| readinessProbe.failureThreshold | int | `1` | | +| readinessProbe.initialDelaySeconds | int | `60` | | | readinessProbe.periodSeconds | int | `60` | | +| readinessProbe.successThreshold | int | `1` | | +| readinessProbe.timeoutSeconds | int | `1` | | | replicaCount | int | `1` | | -| resources | object | `{}` | | +| resources.limits.memory | string | `"2400Mi"` | | +| resources.requests.cpu | string | `"100m"` | | +| resources.requests.memory | string | `"1200Mi"` | | | securityContext | object | `{}` | | -| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | -| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | -| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | -| serviceMonitor.additionalLabels | object | `{}` | | -| serviceMonitor.enabled | bool | `false` | | -| serviceMonitor.metricRelabelings | list | `[]` | | -| serviceMonitor.namespace | string | `""` | | -| serviceMonitor.namespaceSelector | object | `{}` | | -| serviceMonitor.scrapeInterval | string | `"60s"` | | -| serviceMonitor.targetLabels | list | `[]` | | -| startupProbe | object | `{}` | | +| service.port | int | `80` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.labels | object | `{}` | | +| serviceAccount.name | string | `""` | | | tolerations | list | `[]` | | -| volumeMounts | list | `[]` | | -| volumes | list | `[]` | | -| watchedKeys | list | `[]` | List of public keys to watch. See https://github.com/kilnfi/eth-validator-watcher/blob/main/README.md#command-lines-examples | +| volumeMounts | object | `{}` | | +| volumes | object | `{}` | | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/eth-validator-watcher/templates/_helpers.tpl b/charts/eth-validator-watcher/templates/_helpers.tpl index b6d897a..b390d6b 100644 --- a/charts/eth-validator-watcher/templates/_helpers.tpl +++ b/charts/eth-validator-watcher/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "eth-validator-watcher.name" -}} +{{- define "ethereum-validator-watcher.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "eth-validator-watcher.fullname" -}} +{{- define "ethereum-validator-watcher.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,37 +26,39 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "eth-validator-watcher.chart" -}} +{{- define "ethereum-validator-watcher.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* -Common labels +Create the name of the service account to use */}} -{{- define "eth-validator-watcher.labels" -}} -helm.sh/chart: {{ include "eth-validator-watcher.chart" . }} -{{ include "eth-validator-watcher.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- define "ethereum-validator-watcher.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "ethereum-validator-watcher.fullname" .) .Values.serviceAccount.name }} +{{- else }} + +{{- default "default" .Values.serviceAccount.name }} {{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* -Selector labels +Common labels */}} -{{- define "eth-validator-watcher.selectorLabels" -}} -app.kubernetes.io/name: {{ include "eth-validator-watcher.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} +{{- define "ethereum-validator-watcher.labels" -}} +app.kubernetes.io/name: {{ include "ethereum-validator-watcher.name" . }} +helm.sh/chart: {{ include "ethereum-validator-watcher.chart" . }} +app.kubernetes.io/instance: ethereum-validator-watcher +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} +{{- end -}} {{/* -Create the name of the service account to use +Selector labels */}} -{{- define "eth-validator-watcher.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "eth-validator-watcher.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} +{{- define "ethereum-validator-watcher.matchLabels" -}} +app.kubernetes.io/name: {{ include "ethereum-validator-watcher.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} diff --git a/charts/eth-validator-watcher/templates/configmap.yaml b/charts/eth-validator-watcher/templates/configmap.yaml index ff2f616..fd82689 100644 --- a/charts/eth-validator-watcher/templates/configmap.yaml +++ b/charts/eth-validator-watcher/templates/configmap.yaml @@ -1,14 +1,13 @@ -{{- if .Values.watchedKeys }} ---- +{{- if .Values.config.watchedKeys }} apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "eth-validator-watcher.fullname" . }} + name: {{ include "ethereum-validator-watcher.fullname" . }} labels: - {{- include "eth-validator-watcher.labels" . | nindent 4 }} + {{- include "ethereum-validator-watcher.labels" . | nindent 4 }} data: watched-keys.txt: | - {{- range .Values.watchedKeys }} + {{- range .Values.config.watchedKeys }} {{- . | nindent 4 }} {{- end }} {{- end }} diff --git a/charts/eth-validator-watcher/templates/deployment.yaml b/charts/eth-validator-watcher/templates/deployment.yaml index c19c970..7424324 100644 --- a/charts/eth-validator-watcher/templates/deployment.yaml +++ b/charts/eth-validator-watcher/templates/deployment.yaml @@ -1,103 +1,93 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "eth-validator-watcher.fullname" . }} + name: {{ include "ethereum-validator-watcher.fullname" . }} + namespace: {{ .Release.Namespace }} labels: - {{- include "eth-validator-watcher.labels" . | nindent 4 }} + {{- include "ethereum-validator-watcher.labels" . | nindent 4 }} + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - {{- include "eth-validator-watcher.selectorLabels" . | nindent 6 }} + {{- include "ethereum-validator-watcher.matchLabels" . | nindent 6 }} template: metadata: - annotations: + labels: + {{- include "ethereum-validator-watcher.matchLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} {{- with .Values.podAnnotations }} - {{- toYaml . | nindent 8 }} + annotations: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} - labels: - {{- include "eth-validator-watcher.selectorLabels" . | nindent 8 }} spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "eth-validator-watcher.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: eth-validator-watcher - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - args: - {{- if .Values.watchedKeys }} - - --pubkeys-file-path=/data/keys/watched-keys.txt - {{- end }} - {{- with .Values.args }} - {{- toYaml . | nindent 12 }} - {{- end }} - ports: - - name: metrics - containerPort: 8000 - protocol: TCP - {{- with .Values.readinessProbe }} - readinessProbe: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.livenessProbe }} - livenessProbe: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.startupProbe }} - startupProbe: - {{- toYaml . | nindent 12 }} - {{- end }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- if or .Values.env .Values.envFrom }} - env: - {{- with .Values.envFrom }} - {{- range $key, $value := . }} - - name: {{ $key }} - {{- toYaml $value | nindent 12 }} - {{- end }} + - name: validator-watcher + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{- end }} + ports: + - name: metrics + containerPort: 8000 + args: + {{- if .Values.config.watchedKeys }} + - --pubkeys-file-path=/data/keys/watched-keys.txt {{- end }} - {{- with .Values.env }} - {{- range $key, $value := . }} - - name: {{ $key }} - value: {{ $value | quote }} + - --beacon-url={{ .Values.config.beaconUrl }} + - --beacon-type={{ .Values.config.beaconType }} + - --liveness-file=/tmp/liveness + {{- with .Values.extraArgs }} + {{- toYaml . | nindent 10 }} {{- end }} - {{- end }} - {{- end }} - {{- if .Values.watchedKeys }} - volumeMounts: - - name: "watched-keys" - mountPath: "/data/keys" - readOnly: true - {{- end }} - {{- with .Values.volumeMounts }} + {{- with .Values.livenessProbe }} + livenessProbe: + exec: + command: + - /usr/bin/python3.9 + - /usr/local/bin/liveness_check.py + - /tmp/liveness + initialDelaySeconds: {{ .initialDelaySeconds }} + periodSeconds: {{ .periodSeconds }} + timeoutSeconds: {{ .timeoutSeconds }} + successThreshold: {{ .successThreshold }} + failureThreshold: {{ .failureThreshold }} + {{- end }} + {{- with .Values.readinessProbe }} + readinessProbe: + exec: + command: + - /usr/bin/python3.9 + - /usr/local/bin/liveness_check.py + - /tmp/liveness + initialDelaySeconds: {{ .initialDelaySeconds }} + periodSeconds: {{ .periodSeconds }} + timeoutSeconds: {{ .timeoutSeconds }} + successThreshold: {{ .successThreshold }} + failureThreshold: {{ .failureThreshold }} + {{- end }} + volumeMounts: + {{- if .Values.config.watchedKeys }} + - name: "watched-keys" + mountPath: "/data/keys" + readOnly: true + {{- end }} + {{- with .Values.volumeMounts }} {{- toYaml . | nindent 12 }} - {{- end }} - {{- if .Values.watchedKeys }} + {{- end }} + serviceAccountName: {{ include "ethereum-validator-watcher.serviceAccountName" . }} volumes: + {{- if .Values.config.watchedKeys }} - name: "watched-keys" configMap: - name: {{ include "eth-validator-watcher.fullname" . }} + name: {{ include "ethereum-validator-watcher.fullname" . }} {{- end }} {{- with .Values.volumes }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/eth-validator-watcher/templates/podmonitor.yaml b/charts/eth-validator-watcher/templates/podmonitor.yaml new file mode 100644 index 0000000..723bf14 --- /dev/null +++ b/charts/eth-validator-watcher/templates/podmonitor.yaml @@ -0,0 +1,33 @@ +{{- if .Values.podMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ include "ethereum-validator-watcher.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "ethereum-validator-watcher.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "ethereum-validator-watcher.matchLabels" . | nindent 8 }} + podMetricsEndpoints: + - port: metrics + {{- if .Values.podMonitor.interval }} + interval: {{ .Values.podMonitor.interval }} + {{- end }} + {{- if .Values.podMonitor.additionalLabels }} + additionalLabels: + {{- toYaml .Values.podMonitor.additionalLabels | nindent 6 }} + {{- end }} + {{- if .Values.podMonitor.scheme }} + scheme: {{ .Values.podMonitor.scheme }} + {{- end }} + {{- if .Values.podMonitor.tlsConfig }} + tlsConfig: + {{- toYaml .Values.podMonitor.tlsConfig | nindent 6 }} + {{- end }} + {{- if .Values.podMonitor.relabelings }} + relabelings: + {{ toYaml .Values.podMonitor.relabelings | nindent 6 }} + {{- end }} +{{- end }} diff --git a/charts/eth-validator-watcher/templates/service.yaml b/charts/eth-validator-watcher/templates/service.yaml deleted file mode 100644 index 370653a..0000000 --- a/charts/eth-validator-watcher/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "eth-validator-watcher.fullname" . }} - labels: - {{- include "eth-validator-watcher.labels" . | nindent 4 }} -spec: - type: ClusterIP - ports: - - name: metrics - port: 8000 - targetPort: metrics - protocol: TCP - selector: - {{- include "eth-validator-watcher.selectorLabels" . | nindent 4 }} diff --git a/charts/eth-validator-watcher/templates/serviceaccount.yaml b/charts/eth-validator-watcher/templates/serviceaccount.yaml index 1070f43..d1958a0 100644 --- a/charts/eth-validator-watcher/templates/serviceaccount.yaml +++ b/charts/eth-validator-watcher/templates/serviceaccount.yaml @@ -1,12 +1,16 @@ -{{- if .Values.serviceAccount.create -}} +{{- if .Values.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "eth-validator-watcher.serviceAccountName" . }} labels: - {{- include "eth-validator-watcher.labels" . | nindent 4 }} + {{- include "ethereum-validator-watcher.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} + name: {{ include "ethereum-validator-watcher.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} {{- end }} diff --git a/charts/eth-validator-watcher/templates/servicemonitor.yaml b/charts/eth-validator-watcher/templates/servicemonitor.yaml deleted file mode 100644 index a37b354..0000000 --- a/charts/eth-validator-watcher/templates/servicemonitor.yaml +++ /dev/null @@ -1,40 +0,0 @@ -{{- if .Values.serviceMonitor.enabled -}} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: {{ include "eth-validator-watcher.fullname" . }} -{{- if .Values.serviceMonitor.namespace }} - namespace: {{ .Values.serviceMonitor.namespace | quote }} -{{- end }} - labels: - {{- include "eth-validator-watcher.labels" . | nindent 4 }} - {{- if .Values.serviceMonitor.additionalLabels }} - {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} - {{- end }} -spec: - endpoints: - - port: metrics - interval: {{ .Values.serviceMonitor.scrapeInterval }} - {{- if .Values.serviceMonitor.honorLabels }} - honorLabels: true - {{- end }} - {{- if .Values.serviceMonitor.metricRelabelings }} - metricRelabelings: {{ toYaml .Values.serviceMonitor.metricRelabelings | nindent 8 }} - {{- end }} -{{- if .Values.serviceMonitor.namespaceSelector }} - namespaceSelector: {{ toYaml .Values.serviceMonitor.namespaceSelector | nindent 4 }} -{{ else }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace }} -{{- end }} -{{- if .Values.serviceMonitor.targetLabels }} - targetLabels: - {{- range .Values.serviceMonitor.targetLabels }} - - {{ . }} - {{- end }} -{{- end }} - selector: - matchLabels: - {{- include "eth-validator-watcher.selectorLabels" . | nindent 6 }} -{{- end }} diff --git a/charts/eth-validator-watcher/values.yaml b/charts/eth-validator-watcher/values.yaml index 5140344..04179cb 100644 --- a/charts/eth-validator-watcher/values.yaml +++ b/charts/eth-validator-watcher/values.yaml @@ -1,98 +1,64 @@ replicaCount: 1 - image: repository: ghcr.io/kilnfi/eth-validator-watcher pullPolicy: IfNotPresent - tag: "latest" - -# -- Specifies the arguments to the command line -# Please refer to https://github.com/kilnfi/eth-validator-watcher/blob/main/README.md#description -args: [] - -env: {} -envFrom: {} + tag: "" imagePullSecrets: [] nameOverride: "" fullnameOverride: "" -serviceAccount: - # -- Specifies whether a service account should be created - create: true - # -- Annotations to add to the service account - annotations: {} - # -- The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" +config: + beaconUrl: "http://localhost:5052" + beaconType: "other" + # -- List of public keys to watch. See https://github.com/kilnfi/eth-validator-watcher/blob/main/README.md#command-lines-examples + watchedKeys: [] +extraArgs: [] podAnnotations: {} - +podLabels: {} podSecurityContext: {} - # fsGroup: 2000 - securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 + +resources: + requests: + cpu: 100m + memory: 1200Mi + limits: + memory: 2400Mi livenessProbe: periodSeconds: 60 - initialDelaySeconds: 120 - failureThreshold: 10 - exec: - command: - - /usr/bin/python3.9 - - /usr/local/bin/liveness_check.py - - /tmp/liveness + initialDelaySeconds: 60 + timeoutSeconds: 1 + failureThreshold: 1 + successThreshold: 1 readinessProbe: periodSeconds: 60 - initialDelaySeconds: 30 - failureThreshold: 10 - exec: - command: - - /usr/bin/python3.9 - - /usr/local/bin/liveness_check.py - - /tmp/liveness -startupProbe: {} - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - + initialDelaySeconds: 60 + timeoutSeconds: 1 + failureThreshold: 1 + successThreshold: 1 + +extraInitContainers: [] +volumeMounts: {} +volumes: {} nodeSelector: {} - tolerations: [] - affinity: {} +serviceAccount: + create: true + annotations: {} + name: "" + labels: {} +service: + type: ClusterIP + port: 80 -volumes: [] - -volumeMounts: [] - -serviceMonitor: +podMonitor: enabled: false + interval: 12s additionalLabels: {} - namespace: "" - namespaceSelector: {} - # Default: scrape .Release.Namespace only - # To scrape all, use the following: - # namespaceSelector: - # any: true - scrapeInterval: 60s - # honorLabels: true - targetLabels: [] - metricRelabelings: [] - -# -- List of public keys to watch. See https://github.com/kilnfi/eth-validator-watcher/blob/main/README.md#command-lines-examples -watchedKeys: [] + scheme: http + tlsConfig: {} + relabelings: [] diff --git a/grafana_dashboard.json b/grafana_dashboard.json index 9c125ed..c03b1c5 100644 --- a/grafana_dashboard.json +++ b/grafana_dashboard.json @@ -2031,4 +2031,4 @@ "uid": "K_icw4y4k", "version": 53, "weekStart": "" -} \ No newline at end of file +} diff --git a/tests/beacon/assets/rewards.json b/tests/beacon/assets/rewards.json index cd5a3dc..b98b50b 100644 --- a/tests/beacon/assets/rewards.json +++ b/tests/beacon/assets/rewards.json @@ -30,4 +30,4 @@ } ] } -} \ No newline at end of file +}