Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(charts): adds panda-pulse cron #6

Merged
merged 5 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v4
with:
version: v3.7.0
version: v3.16.2

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12

- name: Run pre-commit hooks
uses: pre-commit/[email protected].0
uses: pre-commit/[email protected].1

- name: Set up chart-testing
uses: helm/[email protected]
uses: helm/[email protected]
with:
version: "v3.11.0"

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -38,7 +40,7 @@ jobs:
run: ct lint --config ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.10.0
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -22,9 +22,9 @@ jobs:
git config user.email "[email protected]"

- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v4
with:
version: v3.7.0
version: v3.16.2

- name: Add repo dependencies
run: helm repo add bitnami https://charts.bitnami.com/bitnami
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ helm search repo ethpandaops-general-helm-charts

- [`cloudflare-tunnel`](charts/cloudflare-tunnel)
- [`chproxy`](charts/chproxy)
- [`panda-pulse`](charts/panda-pulse)
- [`raw-configmap`](charts/raw-configmap)

## Development
Expand Down
23 changes: 23 additions & 0 deletions charts/panda-pulse/.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/panda-pulse/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2
name: panda-pulse
description: A Helm chart for Panda Pulse - Ethereum network monitoring and reporting tool
type: application
version: 0.0.1
appVersion: "latest"
maintainers:
- name: matty
email: [email protected]
48 changes: 48 additions & 0 deletions charts/panda-pulse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# panda-pulse

![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) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

A Helm chart for Panda Pulse - Ethereum network monitoring and reporting tool

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| matty | [email protected] | |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| config.discordChannel | string | `"YOUR_DISCORD_CHANNEL_ID"` | |
| config.ethereumCl | string | `""` | |
| config.ethereumEl | string | `""` | |
| config.grafanaBaseUrl | string | `""` | |
| config.network | string | `"YOUR_PREFERRED_NETWORK"` | |
| config.prometheusDatasourceId | string | `""` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ethpandaops/panda-pulse"` | |
| image.tag | string | `"latest"` | |
| imagePullSecrets | list | `[]` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| resources.limits.cpu | string | `"1000m"` | |
| resources.limits.memory | string | `"1Gi"` | |
| resources.requests.cpu | string | `"100m"` | |
| resources.requests.memory | string | `"128Mi"` | |
| schedule | string | `"0 7 * * *"` | |
| secrets.discordBotToken | string | `"YOUR_DISCORD_BOT_TOKEN"` | |
| secrets.grafanaServiceToken | string | `"YOUR_GRAFANA_SERVICE_TOKEN"` | |
| secrets.openrouterApiKey | string | `""` | |
| securityContext | object | `{}` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0)
62 changes: 62 additions & 0 deletions charts/panda-pulse/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "panda-pulse.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 "panda-pulse.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 "panda-pulse.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "panda-pulse.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "panda-pulse.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
81 changes: 81 additions & 0 deletions charts/panda-pulse/templates/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "panda-pulse.fullname" . }}
labels:
{{- include "panda-pulse.labels" . | nindent 4 }}
spec:
schedule: {{ .Values.schedule | quote }}
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 12 }}
{{- end }}
labels:
{{- include "panda-pulse.selectorLabels" . | nindent 12 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
serviceAccountName: {{ include "panda-pulse.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 12 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 16 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- --network={{ required "A valid network is required" .Values.config.network }}
- --discord-channel={{ required "A valid Discord channel ID is required" .Values.config.discordChannel }}
{{- if .Values.config.ethereumCl }}
- --ethereum-cl={{ .Values.config.ethereumCl }}
{{- end }}
{{- if .Values.config.ethereumEl }}
- --ethereum-el={{ .Values.config.ethereumEl }}
{{- end }}
{{- if .Values.config.grafanaBaseUrl }}
- --grafana-base-url={{ .Values.config.grafanaBaseUrl }}
{{- end }}
{{- if .Values.config.prometheusDatasourceId }}
- --prometheus-datasource-id={{ .Values.config.prometheusDatasourceId }}
{{- end }}
env:
- name: GRAFANA_SERVICE_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "panda-pulse.fullname" . }}
key: grafana-service-token
- name: DISCORD_BOT_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "panda-pulse.fullname" . }}
key: discord-bot-token
{{- if .Values.secrets.openrouterApiKey }}
- name: OPENROUTER_API_KEY
valueFrom:
secretKeyRef:
name: {{ include "panda-pulse.fullname" . }}
key: openrouter-api-key
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 16 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 12 }}
{{- end }}
restartPolicy: OnFailure
13 changes: 13 additions & 0 deletions charts/panda-pulse/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "panda-pulse.fullname" . }}
labels:
{{- include "panda-pulse.labels" . | nindent 4 }}
type: Opaque
data:
grafana-service-token: {{ required "A valid Grafana service token is required" .Values.secrets.grafanaServiceToken | b64enc }}
discord-bot-token: {{ required "A valid Discord bot token is required" .Values.secrets.discordBotToken | b64enc }}
{{- if .Values.secrets.openrouterApiKey }}
openrouter-api-key: {{ .Values.secrets.openrouterApiKey | b64enc }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/panda-pulse/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "panda-pulse.serviceAccountName" . }}
labels:
{{- include "panda-pulse.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
44 changes: 44 additions & 0 deletions charts/panda-pulse/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
image:
repository: ethpandaops/panda-pulse
tag: latest
pullPolicy: IfNotPresent

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

schedule: "0 7 * * *" # Run at 7am UTC daily

config:
network: "YOUR_PREFERRED_NETWORK" # required
discordChannel: "YOUR_DISCORD_CHANNEL_ID" # required
ethereumCl: "" # optional
ethereumEl: "" # optional
grafanaBaseUrl: "" # optional
prometheusDatasourceId: "" # optional

secrets:
grafanaServiceToken: "YOUR_GRAFANA_SERVICE_TOKEN" # required
discordBotToken: "YOUR_DISCORD_BOT_TOKEN" # required
openrouterApiKey: "" # optional

resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 100m
memory: 128Mi

serviceAccount:
create: true
annotations: {}
name: ""

podAnnotations: {}
podSecurityContext: {}
securityContext: {}

nodeSelector: {}
tolerations: []
affinity: {}
Loading