Skip to content

Commit

Permalink
feat(v3-operator): Add option to set remote signer url in configmap a… (
Browse files Browse the repository at this point in the history
#457)

* feat(v3-operator): Add option to set remote signer url in configmap as well as enabling metrics and writing custom prometheusrules

* chore(v3-operator): Update Chart version
  • Loading branch information
timpel301 authored Oct 6, 2023
1 parent df057c6 commit 79ed927
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/v3-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: v3-operator
version: 3.1.2
version: 3.2.2
appVersion: master
kubeVersion: "^1.20.0-0"
description: Operator hosted service for Stakewise V3 protocol.
Expand Down
5 changes: 5 additions & 0 deletions charts/v3-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ data:
HARVEST_VAULT: {{ .Values.settings.harvestVault | quote }}
EXECUTION_ENDPOINTS: {{ .Values.settings.executionEndpoints | quote }}
CONSENSUS_ENDPOINTS: {{ .Values.settings.consensusEndpoints | quote }}
ENABLE_METRICS: {{ .Values.metrics.enabled | quote }}
METRICS_HOST: {{ .Values.serviceMonitor.host | quote }}
METRICS_PORT: {{ .Values.metrics.port | quote }}
MAX_FEE_PER_GAS_GWEI: {{ .Values.settings.maxFeePerGasGwei | quote }}
{{- if .Values.settings.remoteSigner.enabled }}
REMOTE_SIGNER_URL: {{ .Values.settings.remoteSigner.url | quote }}
{{- end }}
22 changes: 22 additions & 0 deletions charts/v3-operator/templates/prometheusrules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ template "common.names.fullname" . }}
{{- if .Values.metrics.prometheusRule.namespace }}
namespace: {{ .Values.metrics.prometheusRule.namespace }}
{{- else }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.metrics.prometheusRule.additionalLabels }}
{{- toYaml .Values.metrics.prometheusRule.additionalLabels | nindent 4 }}
{{- end }}
spec:
groups:
{{- with .Values.metrics.prometheusRule.rules }}
- name: {{ template "vommon.fullname" $ }}
rules: {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/v3-operator/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if .Values.metrics.enabled }}
- port: {{ .Values.metrics.port }}
targetPort: metrics
protocol: TCP
name: metrics
{{- end }}
selector:
{{- include "common.labels.matchLabels" . | nindent 4 }}
5 changes: 5 additions & 0 deletions charts/v3-operator/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ spec:
- name: http
containerPort: {{ .Values.service.ports.http }}
protocol: TCP
{{- if .Values.metrics.enabled }}
- name: metrics
containerPort: {{ .Values.metrics.port }}
protocol: TCP
{{- end }}
volumeMounts:
- name: deposit-data
mountPath: /data/{{ .Values.settings.vault }}/deposit
Expand Down
48 changes: 48 additions & 0 deletions charts/v3-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ settings:
executionEndpoints: ""
# Comma separated list of endpoints for the consensus node
consensusEndpoints: ""
# endpoint of the remote signer
remoteSigner:
enabled: false
url: ""

depositDataSecretName: ""
keystoresSecretName: ""
Expand All @@ -116,6 +120,50 @@ persistence:
- ReadWriteOnce
size: 1Gi

## Monitoring
##
metrics:
# Whether to enable metrics collection or not
enabled: false
# Prometheus exporter port
port: 9090
## Custom PrometheusRule to be defined
## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions
##
prometheusRule:
## @param metrics.prometheusRule.enabled Create a custom prometheusRule Resource for scraping metrics using PrometheusOperator
##
enabled: false
## @param metrics.prometheusRule.default Create a default set of Alerts
##
default: false
## @param metrics.prometheusRule.namespace The namespace in which the prometheusRule will be created
##
namespace: ""
## @param metrics.prometheusRule.additionalLabels Additional labels for the prometheusRule
##
additionalLabels: {}
## @param metrics.prometheusRule.rules Custom Prometheus rules
## e.g:
## rules:
## - alert: PrysmValidatorHourlyEarningLessOrEqual0
## expr: sum(validator_balance) - sum(validator_balance offset 1h) - count(validator_balance > 16)*32 + count(validator_balance offset 1h > 0)*32
## for: 5m
## labels:
## severity: critical
## annotations:
## summary: Prysm validator hourly earning <= 0
## description: Check validators immediately. Pod - {{ printf "{{ $labels.pod }}" }}. Namespace - {{ printf "{{ $labels.namespace }}" }}
## - alert: PrysmValidatorAlotOfErrorsLastHour
## expr: sum(delta(log_entries_total{job='{{ include "operator.fullname" . }}-validator', level="error"}[1h]) > 0)
## for: 5m
## labels:
## severity: warning
## annotations:
## summary: Many validator errors or warnings last hour
## description: Check validator {{ printf "{{ $labels.pod }}" }}. Namespace - {{ printf "{{ $labels.namespace }}" }}
##
rules: {}
## Prometheus Service Monitor
## ref: https://github.com/coreos/prometheus-operator
## https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
Expand Down

0 comments on commit 79ed927

Please sign in to comment.