Skip to content

Commit 75c56aa

Browse files
authored
feat: add xatu chart (ethpandaops#135)
1 parent f29bffe commit 75c56aa

13 files changed

+586
-0
lines changed

charts/xatu/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/xatu/Chart.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v2
2+
name: xatu
3+
description: Ethereum p2p monitoring tool
4+
home: https://github.com/ethpandaops/xatu
5+
type: application
6+
version: 0.0.1
7+
maintainers:
8+
- name: samcm
9+
10+
- name: savid
11+

charts/xatu/README.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
2+
# xatu
3+
4+
![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)
5+
6+
Ethereum p2p monitoring tool
7+
8+
**Homepage:** <https://github.com/ethpandaops/xatu>
9+
10+
## Values
11+
12+
| Key | Type | Default | Description |
13+
|-----|------|---------|-------------|
14+
| affinity | object | `{}` | Affinity configuration for pods |
15+
| annotations | object | `{}` | Annotations for the Deployment |
16+
| args | list | `[]` | Command arguments |
17+
| config.ethereum.beacon_node_address | string | `"http://localhost:5052"` | |
18+
| config.logging | string | `"info"` | |
19+
| config.metricsAddr | string | `":9090"` | |
20+
| config.name | string | `"example-instance"` | |
21+
| config.outputs[0].config.address | string | `"http://localhost:8080"` | |
22+
| config.outputs[0].config.batch_timeout | string | `"5s"` | |
23+
| config.outputs[0].config.export_timeout | string | `"30s"` | |
24+
| config.outputs[0].config.headers.Authorization | string | `"Someb64Value"` | |
25+
| config.outputs[0].config.max_export_batch_size | int | `512` | |
26+
| config.outputs[0].config.max_queue_size | int | `51200` | |
27+
| config.outputs[0].config.ntp_server | string | `"pool.ntp.org"` | |
28+
| config.outputs[0].config.type | string | `"http"` | |
29+
| config.outputs[0].name | string | `"basic"` | |
30+
| config.outputs[0].type | string | `"http"` | |
31+
| containerSecurityContext | object | See `values.yaml` | The security context for containers |
32+
| customArgs | list | `[]` | Custom args for the xatu container |
33+
| customCommand | list | `[]` | Command replacement for the xatu container |
34+
| extraContainers | list | `[]` | Additional containers |
35+
| extraEnv | list | `[]` | Additional env variables |
36+
| extraPorts | list | `[]` | Additional ports. Useful when using extraContainers |
37+
| extraVolumeMounts | list | `[]` | Additional volume mounts |
38+
| extraVolumes | list | `[]` | Additional volumes |
39+
| fullnameOverride | string | `""` | Overrides the chart's computed fullname |
40+
| image.pullPolicy | string | `"IfNotPresent"` | xatu container pull policy |
41+
| image.repository | string | `"ethpandaops/xatu"` | xatu container image repository |
42+
| image.tag | string | `"latest"` | xatu container image tag |
43+
| imagePullSecrets | list | `[]` | Image pull secrets for Docker images |
44+
| initContainers | list | `[]` | Additional init containers |
45+
| livenessProbe | object | See `values.yaml` | Liveness probe |
46+
| nameOverride | string | `""` | Overrides the chart's name |
47+
| nodeSelector | object | `{}` | Node selector for pods |
48+
| podAnnotations | object | `{}` | Pod annotations |
49+
| podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created |
50+
| podLabels | object | `{}` | Pod labels |
51+
| priorityClassName | string | `nil` | Pod priority class |
52+
| readinessProbe | object | See `values.yaml` | Readiness probe |
53+
| replicas | int | `1` | Number of replicas |
54+
| resources | object | `{}` | Resource requests and limits |
55+
| secretEnv | object | `{}` | Secret env variables injected via a created secret |
56+
| securityContext | object | See `values.yaml` | The security context for pods |
57+
| service.type | string | `"ClusterIP"` | Service type |
58+
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
59+
| serviceAccount.create | bool | `false` | Specifies whether a service account should be created |
60+
| 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 |
61+
| serviceMonitor.annotations | object | `{}` | Additional ServiceMonitor annotations |
62+
| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator https://github.com/coreos/prometheus-operator |
63+
| serviceMonitor.interval | string | `"15s"` | ServiceMonitor scrape interval |
64+
| serviceMonitor.labels | object | `{}` | Additional ServiceMonitor labels |
65+
| serviceMonitor.namespace | string | `nil` | Alternative namespace for ServiceMonitor |
66+
| serviceMonitor.path | string | `"/metrics"` | Path to scrape |
67+
| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabelings |
68+
| serviceMonitor.scheme | string | `"http"` | ServiceMonitor scheme |
69+
| serviceMonitor.scrapeTimeout | string | `"30s"` | ServiceMonitor scrape timeout |
70+
| serviceMonitor.tlsConfig | object | `{}` | ServiceMonitor TLS configuration |
71+
| terminationGracePeriodSeconds | int | `30` | How long to wait until the pod is forcefully terminated |
72+
| tolerations | list | `[]` | Tolerations for pods |

charts/xatu/README.md.gotmpl

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
{{ template "chart.header" . }}
3+
{{ template "chart.deprecationWarning" . }}
4+
5+
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}
6+
7+
{{ template "chart.description" . }}
8+
9+
{{ template "chart.homepageLine" . }}
10+
11+
{{ template "chart.sourcesSection" . }}
12+
13+
{{ template "chart.requirementsSection" . }}
14+
15+
{{ template "chart.valuesSection" . }}

charts/xatu/templates/NOTES.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
1. Get the application URL by running these commands:
2+
{{- if contains "NodePort" .Values.service.type }}
3+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "xatu.fullname" . }})
4+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
5+
echo http://$NODE_IP:$NODE_PORT
6+
{{- else if contains "LoadBalancer" .Values.service.type }}
7+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
8+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "xatu.fullname" . }}'
9+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "xatu.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
10+
echo http://$SERVICE_IP:{{ include "xatu.httpPort" . }}
11+
{{- else if contains "ClusterIP" .Values.service.type }}
12+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "xatu.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
13+
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
14+
echo "Visit http://127.0.0.1:8080 to use your application"
15+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
16+
{{- end }}

charts/xatu/templates/_helpers.tpl

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "xatu.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "xatu.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "xatu.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "xatu.labels" -}}
37+
helm.sh/chart: {{ include "xatu.chart" . }}
38+
{{ include "xatu.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "xatu.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "xatu.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "xatu.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "xatu.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{- define "xatu.metricsPort" -}}
65+
{{ (split ":" .Values.config.metricsAddr)._1 | default ":9090" }}
66+
{{- end -}}

charts/xatu/templates/configmap.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "xatu.fullname" . }}
5+
labels:
6+
{{- include "xatu.labels" . | nindent 4 }}
7+
data:
8+
config.yaml: |-
9+
{{ toYaml .Values.config | nindent 4 }}

charts/xatu/templates/deployment.yaml

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "xatu.fullname" . }}
5+
labels:
6+
{{- include "xatu.labels" . | nindent 4 }}
7+
annotations:
8+
{{- toYaml .Values.annotations | nindent 4 }}
9+
spec:
10+
replicas: {{ .Values.replicas }}
11+
selector:
12+
matchLabels:
13+
{{- include "xatu.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
labels:
17+
{{- include "xatu.selectorLabels" . | nindent 8 }}
18+
{{- with .Values.podLabels }}
19+
{{- toYaml . | nindent 8 }}
20+
{{- end }}
21+
annotations:
22+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
23+
checksum/secrets: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
24+
{{- with .Values.podAnnotations }}
25+
{{- toYaml . | nindent 8 }}
26+
{{- end }}
27+
spec:
28+
serviceAccountName: {{ include "xatu.serviceAccountName" . }}
29+
{{- if .Values.priorityClassName }}
30+
priorityClassName: {{ .Values.priorityClassName }}
31+
{{- end }}
32+
securityContext:
33+
{{- toYaml .Values.securityContext | nindent 8 }}
34+
initContainers:
35+
{{- if .Values.initContainers }}
36+
{{- toYaml .Values.initContainers | nindent 8 }}
37+
{{- end }}
38+
{{- with .Values.imagePullSecrets }}
39+
imagePullSecrets:
40+
{{- toYaml . | nindent 8 }}
41+
{{- end }}
42+
containers:
43+
- name: {{ .Chart.Name }}
44+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
45+
imagePullPolicy: {{ .Values.image.pullPolicy }}
46+
command:
47+
{{- if gt (len .Values.customCommand) 0 }}
48+
{{- toYaml .Values.customCommand | nindent 12}}
49+
{{- else }}
50+
- "/xatu"
51+
- "sentry"
52+
- --config=/config.yaml
53+
{{- if gt (len .Values.args) 0 }}
54+
{{- toYaml .Values.args | nindent 12}}
55+
{{- end }}
56+
{{- end }}
57+
{{- if gt (len .Values.customArgs) 0 }}
58+
args:
59+
{{- toYaml .Values.customArgs | nindent 12}}
60+
{{- end }}
61+
securityContext:
62+
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
63+
volumeMounts:
64+
- name: config
65+
mountPath: "/config.yaml"
66+
subPath: config.yaml
67+
readOnly: true
68+
{{- if .Values.extraVolumeMounts }}
69+
{{ toYaml .Values.extraVolumeMounts | nindent 12}}
70+
{{- end }}
71+
ports:
72+
- name: metrics
73+
containerPort: {{ include "xatu.metricsPort" . }}
74+
protocol: TCP
75+
livenessProbe:
76+
{{- toYaml .Values.livenessProbe | nindent 12 }}
77+
readinessProbe:
78+
{{- toYaml .Values.readinessProbe | nindent 12 }}
79+
resources:
80+
{{- toYaml .Values.resources | nindent 12 }}
81+
env:
82+
{{- range $key, $value := .Values.secretEnv }}
83+
- name: {{ $key }}
84+
valueFrom:
85+
secretKeyRef:
86+
name: {{ include "xatu.fullname" $ }}-env
87+
key: {{ $key }}
88+
{{- end }}
89+
{{- if .Values.extraEnv }}
90+
{{- toYaml .Values.extraEnv | nindent 12 }}
91+
{{- end }}
92+
{{- if .Values.extraContainers }}
93+
{{ toYaml .Values.extraContainers | nindent 8}}
94+
{{- end }}
95+
nodeSelector:
96+
{{- toYaml .Values.nodeSelector | nindent 8 }}
97+
affinity:
98+
{{- toYaml .Values.affinity | nindent 8 }}
99+
tolerations:
100+
{{- toYaml .Values.tolerations | nindent 8 }}
101+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
102+
volumes:
103+
{{- if .Values.extraVolumes }}
104+
{{ toYaml .Values.extraVolumes | nindent 8}}
105+
{{- end }}
106+
- name: config
107+
configMap:
108+
name: {{ include "xatu.fullname" . }}

charts/xatu/templates/secret.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ include "xatu.fullname" . }}-env
5+
labels:
6+
{{- include "xatu.labels" . | nindent 4 }}
7+
data:
8+
{{- range $key, $value := .Values.secretEnv }}
9+
{{ $key }}: {{ $value | b64enc }}
10+
{{- end }}

charts/xatu/templates/service.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "xatu.fullname" . }}
5+
labels:
6+
{{- include "xatu.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ include "xatu.metricsPort" . }}
11+
targetPort: metrics
12+
protocol: TCP
13+
name: metrics
14+
{{- if .Values.extraPorts }}
15+
{{ toYaml .Values.extraPorts | nindent 4}}
16+
{{- end }}
17+
selector:
18+
{{- include "xatu.selectorLabels" . | nindent 4 }}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "xatu.serviceAccountName" . }}
6+
labels:
7+
{{- include "xatu.labels" . | nindent 4 }}
8+
{{- with .Values.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
namespace: {{ .Release.Namespace }}
13+
{{- end }}

0 commit comments

Comments
 (0)