Skip to content

Commit

Permalink
feat(charts/splitoor): init (#353)
Browse files Browse the repository at this point in the history
* feat(charts/splitoor): init
  • Loading branch information
Savid authored Jan 23, 2025
1 parent 8798289 commit a060a8f
Show file tree
Hide file tree
Showing 14 changed files with 624 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/splitoor/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
9 changes: 9 additions & 0 deletions charts/splitoor/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2
name: splitoor
description: Monitor 0xSplits, validators, gnosis safe's and provide notifications on relevant events
home: https://github.com/ethpandaops/splitoor
type: application
version: 0.0.1
maintainers:
- name: savid
email: andrew.davis@ethereum.org
68 changes: 68 additions & 0 deletions charts/splitoor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

# splitoor

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Monitor 0xSplits, validators, gnosis safe's and provide notifications on relevant events

**Homepage:** <https://github.com/ethpandaops/splitoor>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity configuration for pods |
| annotations | object | `{}` | Annotations for the Deployment |
| args | list | `[]` | Command arguments |
| config.healthCheckAddr | string | `":9191"` | |
| config.logging | string | `"info"` | |
| config.metricsAddr | string | `":9090"` | |
| config.name | string | `"splitoor"` | |
| containerSecurityContext | object | See `values.yaml` | The security context for containers |
| customArgs | list | `[]` | Custom args for the splitoor container |
| customCommand | list | `[]` | Command replacement for the splitoor container |
| extraContainers | list | `[]` | Additional containers |
| extraEnv | list | `[]` | Additional env variables |
| extraPodPorts | list | `[]` | Extra Pod ports |
| extraPorts | list | `[]` | Additional ports. Useful when using extraContainers |
| extraVolumeMounts | list | `[]` | Additional volume mounts |
| extraVolumes | list | `[]` | Additional volumes |
| fullnameOverride | string | `""` | Overrides the chart's computed fullname |
| healthCheck.enabled | bool | `true` | |
| healthCheck.port | int | `9191` | |
| image.pullPolicy | string | `"IfNotPresent"` | splitoor container pull policy |
| image.repository | string | `"ethpandaops/splitoor"` | splitoor container image repository |
| image.tag | string | `"latest"` | splitoor container image tag |
| imagePullSecrets | list | `[]` | Image pull secrets for Docker images |
| initContainers | list | `[]` | Additional init containers |
| lifecycle | object | See `values.yaml` | Lifecycle hooks |
| livenessProbe | object | `{"httpGet":{"path":"/healthz","port":"health"},"initialDelaySeconds":60,"periodSeconds":120}` | Liveness probe |
| metrics.enabled | bool | `true` | |
| metrics.port | int | `9090` | |
| nameOverride | string | `""` | Overrides the chart's name |
| nodeSelector | object | `{}` | Node selector for pods |
| podAnnotations | object | `{}` | Pod annotations |
| podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created |
| podLabels | object | `{}` | Pod labels |
| priorityClassName | string | `nil` | Pod priority class |
| readinessProbe | object | `{"httpGet":{"path":"/healthz","port":"health"},"initialDelaySeconds":10,"periodSeconds":10}` | Readiness probe |
| resources | object | `{}` | Resource requests and limits |
| secretEnv | object | `{}` | Secret env variables injected via a created secret |
| securityContext | object | See `values.yaml` | The security context for pods |
| service.type | string | `"ClusterIP"` | Service type |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `false` | 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.annotations | object | `{}` | Additional ServiceMonitor annotations |
| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator https://github.com/coreos/prometheus-operator |
| serviceMonitor.interval | string | `"15s"` | ServiceMonitor scrape interval |
| serviceMonitor.labels | object | `{}` | Additional ServiceMonitor labels |
| serviceMonitor.namespace | string | `nil` | Alternative namespace for ServiceMonitor |
| serviceMonitor.path | string | `"/metrics"` | Path to scrape |
| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabelings |
| serviceMonitor.scheme | string | `"http"` | ServiceMonitor scheme |
| serviceMonitor.scrapeTimeout | string | `"30s"` | ServiceMonitor scrape timeout |
| serviceMonitor.tlsConfig | object | `{}` | ServiceMonitor TLS configuration |
| terminationGracePeriodSeconds | int | `90` | How long to wait until the pod is forcefully terminated |
| tolerations | list | `[]` | Tolerations for pods |
| topologySpreadConstraints | list | `[]` | Topology Spread Constraints for pods |
15 changes: 15 additions & 0 deletions charts/splitoor/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}
Empty file.
76 changes: 76 additions & 0 deletions charts/splitoor/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "splitoor.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
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 "splitoor.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "splitoor.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "splitoor.labels" -}}
helm.sh/chart: {{ include "splitoor.chart" . }}
{{ include "splitoor.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "splitoor.selectorLabels" -}}
app.kubernetes.io/name: {{ include "splitoor.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "splitoor.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "splitoor.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "splitoor.metricsPort" -}}
{{ (split ":" .Values.config.metricsAddr)._1 | default "9090" }}
{{- end -}}

{{- define "splitoor.healthCheckPort" -}}
{{ (split ":" .Values.config.healthCheckAddr)._1 | default "9191" }}
{{- end -}}

{{- define "splitoor.pprofPort" -}}
{{- if .Values.config.pprofAddr -}}
{{ (split ":" .Values.config.pprofAddr)._1 | default "6060" }}
{{- end -}}
{{- end -}}
9 changes: 9 additions & 0 deletions charts/splitoor/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "splitoor.fullname" . }}
labels:
{{- include "splitoor.labels" . | nindent 4 }}
data:
config.yaml: |-
{{ tpl (toYaml .Values.config | nindent 4) $ }}
122 changes: 122 additions & 0 deletions charts/splitoor/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "splitoor.fullname" . }}
labels:
{{- include "splitoor.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.annotations | nindent 4 }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
{{- include "splitoor.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "splitoor.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "splitoor.serviceAccountName" . }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}
initContainers:
{{- if .Values.initContainers }}
{{- toYaml .Values.initContainers | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
{{- if gt (len .Values.customCommand) 0 }}
{{- toYaml .Values.customCommand | nindent 12}}
{{- else }}
- "/splitoor"
- "monitor"
- --config=/config.yaml
{{- if gt (len .Values.args) 0 }}
{{- toYaml .Values.args | nindent 12}}
{{- end }}
{{- end }}
{{- if gt (len .Values.customArgs) 0 }}
args:
{{- toYaml .Values.customArgs | nindent 12}}
{{- end }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
volumeMounts:
- name: config
mountPath: "/config.yaml"
subPath: config.yaml
readOnly: true
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | nindent 10}}
{{- end }}
ports:
- name: metrics
containerPort: {{ include "splitoor.metricsPort" . }}
protocol: TCP
{{- if (include "splitoor.healthCheckPort" .) }}
- name: health
containerPort: {{ include "splitoor.healthCheckPort" . }}
protocol: TCP
{{- end }}
{{- if (include "splitoor.pprofPort" .) }}
- name: pprof
containerPort: {{ include "splitoor.pprofPort" . }}
protocol: TCP
{{- end }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
lifecycle:
{{- toYaml .Values.lifecycle | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
{{- range $key, $value := .Values.secretEnv }}
- name: {{ $key }}
valueFrom:
secretKeyRef:
name: {{ include "splitoor.fullname" $ }}-env
key: {{ $key }}
{{- end }}
{{- if .Values.extraEnv }}
{{- toYaml .Values.extraEnv | nindent 12 }}
{{- end }}
{{- if .Values.extraContainers }}
{{ toYaml .Values.extraContainers | nindent 8}}
{{- end }}
nodeSelector:
{{- toYaml .Values.nodeSelector | nindent 8 }}
affinity:
{{- toYaml .Values.affinity | nindent 8 }}
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.topologySpreadConstraints | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
volumes:
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | nindent 8}}
{{- end }}
- name: config
configMap:
name: {{ include "splitoor.fullname" . }}
18 changes: 18 additions & 0 deletions charts/splitoor/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if or .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "splitoor.fullname" . }}
labels:
{{- include "splitoor.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "splitoor.selectorLabels" . | nindent 6 }}
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
{{- end -}}
10 changes: 10 additions & 0 deletions charts/splitoor/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "splitoor.fullname" . }}-env
labels:
{{- include "splitoor.labels" . | nindent 4 }}
data:
{{- range $key, $value := .Values.secretEnv }}
{{ $key }}: {{ $value | b64enc }}
{{- end }}
30 changes: 30 additions & 0 deletions charts/splitoor/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "splitoor.fullname" . }}
labels:
{{- include "splitoor.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ include "splitoor.metricsPort" . }}
targetPort: metrics
protocol: TCP
name: metrics
{{- if (include "splitoor.healthCheckPort" .) }}
- port: {{ include "splitoor.healthCheckPort" . }}
targetPort: health
protocol: TCP
name: health
{{- end }}
{{- if (include "splitoor.pprofPort" .) }}
- port: {{ include "splitoor.pprofPort" . }}
targetPort: pprof
protocol: TCP
name: pprof
{{- end }}
{{- if .Values.extraPorts }}
{{ toYaml .Values.extraPorts | nindent 4}}
{{- end }}
selector:
{{- include "splitoor.selectorLabels" . | nindent 4 }}
Loading

0 comments on commit a060a8f

Please sign in to comment.