diff --git a/charts/vero/.helmignore b/charts/vero/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/vero/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/vero/Chart.lock b/charts/vero/Chart.lock new file mode 100644 index 00000000..bf23e24c --- /dev/null +++ b/charts/vero/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: https://charts.stakewise.io/ + version: 1.0.0 +digest: sha256:a52d823dcd535c64eafc9df56fe41455c602032e084b8adcaa34e536451d2ab2 +generated: "2023-04-03T10:46:51.136024+03:00" diff --git a/charts/vero/Chart.yaml b/charts/vero/Chart.yaml new file mode 100644 index 00000000..8f141dd9 --- /dev/null +++ b/charts/vero/Chart.yaml @@ -0,0 +1,30 @@ +apiVersion: v2 +name: vero +description: Vero is a multi-node validator client software implementation, targeting Ethereum and Gnosis Chain. +icon: https://storage.googleapis.com/stakewise-charts/stakewise.png + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.8.1 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "v0.8.0" + +dependencies: + - name: common + repository: https://charts.stakewise.io/ + version: 1.x.x diff --git a/charts/vero/templates/prometheusrules.yaml b/charts/vero/templates/prometheusrules.yaml new file mode 100644 index 00000000..e02c3f28 --- /dev/null +++ b/charts/vero/templates/prometheusrules.yaml @@ -0,0 +1,23 @@ +{{- if and (or .Values.global.metrics.enabled .Values.metrics.enabled) + (or .Values.global.metrics.prometheusRule.enabled .Values.metrics.prometheusRule.enabled) }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ include "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: {{ include "common.names.fullname" $ }} + rules: {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/vero/templates/service.yaml b/charts/vero/templates/service.yaml new file mode 100644 index 00000000..33f89a63 --- /dev/null +++ b/charts/vero/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.names.fullname" . }} + labels: + {{- include "common.labels.standard" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.metrics.port }} + targetPort: metrics + protocol: TCP + name: metrics + selector: + {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/charts/vero/templates/serviceaccount.yaml b/charts/vero/templates/serviceaccount.yaml new file mode 100644 index 00000000..cb2edd11 --- /dev/null +++ b/charts/vero/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if or .Values.global.serviceAccount.create .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "common.names.serviceAccountName" . }} + labels: + {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/vero/templates/servicemonitor.yaml b/charts/vero/templates/servicemonitor.yaml new file mode 100644 index 00000000..9ecffc6c --- /dev/null +++ b/charts/vero/templates/servicemonitor.yaml @@ -0,0 +1,42 @@ +{{- if and (or .Values.global.metrics.enabled .Values.metrics.enabled) + (or .Values.global.metrics.serviceMonitor.enabled .Values.metrics.serviceMonitor.enabled) }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "common.names.fullname" . }} + {{- if .Values.metrics.serviceMonitor.namespace }} + namespace: {{ .Values.metrics.serviceMonitor.namespace }} + {{- else }} + namespace: {{ .Release.Namespace | quote }} + {{- end }} + labels: + {{- include "common.labels.standard" . | nindent 4 }} + {{- if .Values.metrics.serviceMonitor.additionalLabels }} + {{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} +spec: + endpoints: + - port: metrics + path: /metrics + {{- if .Values.metrics.serviceMonitor.interval }} + interval: {{ .Values.metrics.serviceMonitor.interval }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.honorLabels }} + honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.relabelings }} + relabelings: {{- toYaml .Values.metrics.serviceMonitor.relabelings | nindent 6 }} + {{- end }} + {{- if .Values.metrics.serviceMonitor.metricRelabelings }} + metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 6 }} + {{- end }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + {{- include "common.labels.matchLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/vero/templates/statefulset.yaml b/charts/vero/templates/statefulset.yaml new file mode 100644 index 00000000..6ac859cd --- /dev/null +++ b/charts/vero/templates/statefulset.yaml @@ -0,0 +1,99 @@ +apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }} +kind: StatefulSet +metadata: + name: {{ include "common.names.fullname" . }} + labels: + {{- include "common.labels.statefulset" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + podManagementPolicy: "Parallel" + serviceName: {{ include "common.names.fullname" . }} + selector: + matchLabels: + {{- include "common.labels.matchLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "common.labels.matchLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "common.names.serviceAccountName" . }} + {{- with .Values.securityContext }} + securityContext: + {{ toYaml . | nindent 8 | trim }} + {{- end }} + {{- if and .Values.persistence.enabled .Values.initChownData }} + initContainers: + - name: init-chown + image: "{{ .Values.initImage.registry }}/{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" + imagePullPolicy: {{ .Values.initImage.pullPolicy }} + securityContext: + runAsNonRoot: false + runAsUser: 0 + command: ["chown", "-R", "{{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.runAsUser }}", "/data"] + volumeMounts: + - name: data + mountPath: /data + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - "--beacon-node-urls={{ .Values.global.beaconNodes }}" + - "--remote-signer-url={{ .Values.global.web3signerEndpoint }}" + - "--fee-recipient={{ .Values.feeRecipientAddress }}" + - "--metrics-address={{ .Values.metrics.address }}" + - "--metrics-port={{ .Values.metrics.port }}" + {{- range .Values.extraFlags }} + {{ . }} + {{- end }} + ports: + - name: metrics + containerPort: {{ .Values.metrics.port }} + protocol: TCP + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: data + mountPath: /data + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + {{- if (not .Values.persistence.enabled) }} + - name: data + emptyDir: {} + {{- else }} + volumeClaimTemplates: + - metadata: + name: data + labels: + {{- include "common.labels.statefulset" . | nindent 10 }} + {{- with .Values.persistence.annotations }} + annotations: + {{ toYaml . | nindent 10 | trim }} + {{- end }} + spec: + accessModes: {{ .Values.persistence.accessModes }} + storageClassName: {{ .Values.persistence.storageClassName }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- end }} \ No newline at end of file diff --git a/charts/vero/values.yaml b/charts/vero/values.yaml new file mode 100644 index 00000000..acb69713 --- /dev/null +++ b/charts/vero/values.yaml @@ -0,0 +1,215 @@ +# Default values for vero. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +global: + ## Network ID + ## + network: mainnet + + ## Beacon nodes REST API provider endpoint + beaconNodes: "" + + ## Web3Signer endpoint + web3signerEndpoint: "" + + ## Fee recipient address + feeRecipientAddress: "" + + ## Credentials to fetch images from private registry + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + imagePullSecrets: [] + + ## Service account + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ + ## Additional settings could be made in non-global section. + ## + serviceAccount: + # Specifies whether a service account should be created + create: true + + ## Monitoring + ## Additional settings could be made in non-global section. + ## + metrics: + ## Whether to enable metrics collection or not + ## + enabled: true + + ## Prometheus Service Monitor + ## ref: https://github.com/coreos/prometheus-operator + ## https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + ## + serviceMonitor: + ## Create ServiceMonitor resource(s) for scraping metrics using PrometheusOperator + ## + enabled: false + + ## Custom PrometheusRule to be defined + ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions + ## + prometheusRule: + ## Create a custom prometheusRule Resource for scraping metrics using PrometheusOperator + ## + enabled: false + + ## Configure liveness and readiness probes + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ + ## NB! readinessProbe and livenessProbe must be disabled before fully synced + ## Additional settings could be made in non-global section. + ## + livenessProbe: + enabled: true + + readinessProbe: + enabled: true + +replicaCount: 1 + +## Extra flags for vero +## +## Example: +## extraFlags: +## --graffiti="StakeWise" +extraFlags: [] + +## Init image is used to chown data volume, initialise genesis, etc. +## +initImage: + registry: "docker.io" + repository: "busybox" + tag: "1.36" + pullPolicy: IfNotPresent + +image: + registry: "ghcr.io" + repository: serenita-org/vero + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # 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: "" + +podAnnotations: {} + +securityContext: + fsGroup: 1001 + runAsUser: 1001 + +service: + type: ClusterIP + +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 + +## Node labels for pod assignment +## ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} + +## Tolerations for pod assignment +## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: {} + +## Affinity for pod assignment +## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +## Example: +## affinity: +## podAntiAffinity: +## requiredDuringSchedulingIgnoredDuringExecution: +## - labelSelector: +## matchExpressions: +## - key: app.kubernetes.io/name +## operator: In +## values: +## - vero +## topologyKey: kubernetes.io/hostname +## +affinity: {} + +## If false, data ownership will not be reset at startup +## This allows the node to be run with an arbitrary user +## +initChownData: true + +## Whether or not to allocate persistent volume disk for the data directory. +## In case of pod failure, the pod data directory will still persist. +## +persistence: + enabled: true + storageClassName: "" + accessModes: + - ReadWriteOnce + size: 5Gi + annotations: {} + +## Monitoring +## +metrics: + address: 0.0.0.0 + allowOrigin: "*" + ## Metrics port to expose metrics for Prometheus + ## + port: 8008 + + ## Prometheus Service Monitor + ## ref: https://github.com/coreos/prometheus-operator + ## https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + ## + serviceMonitor: + ## The namespace in which the ServiceMonitor will be created + ## + namespace: "" + ## The interval at which metrics should be scraped + ## + interval: 30s + ## The timeout after which the scrape is ended + ## + scrapeTimeout: "" + ## Metrics RelabelConfigs to apply to samples before scraping. + ## + relabellings: [] + ## Metrics RelabelConfigs to apply to samples before ingestion. + ## + metricRelabelings: [] + ## Specify honorLabels parameter to add the scrape endpoint + ## + honorLabels: false + ## Additional labels that can be used so ServiceMonitor resource(s) can be discovered by Prometheus + ## + additionalLabels: {} + ## Custom PrometheusRule to be defined + ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions + ## + prometheusRule: + ## The namespace in which the prometheusRule will be created + ## + namespace: "" + ## Additional labels for the prometheusRule + ## + additionalLabels: {} + ## Custom Prometheus rules + ## + rules: []