Skip to content

Commit 0ea98f8

Browse files
authored
feat(charts/xatu-mimicry): init (ethpandaops#151)
1 parent 7d20154 commit 0ea98f8

14 files changed

+591
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Tooling
7878
- [`stubbies`](charts/stubbies) - Ethereum execution client stub for consensus layer clients.
7979
- [`web3signer`](charts/web3signer) - An open-source remote signing service.
8080
- [`xatu-discovery`](charts/xatu-discovery) - Ethereum p2p monitoring tool that discovers node records.
81+
- [`xatu-mimicry`](charts/xatu-mimicry) - Ethereum p2p monitoring tool that collects data from the execution layer.
8182
- [`xatu-sentry`](charts/xatu-sentry) - Ethereum p2p monitoring tool that runs along side a [Ethereum consensus client](https://ethereum.org/en/developers/docs/nodes-and-clients/#consensus-clients) and collects data via the consensus client's [Beacon API](https://ethereum.github.io/beacon-APIs/).
8283
- [`xatu-server`](charts/xatu-server) - Ethereum p2p monitoring tool that collects events from and controls various Xatu clients.
8384

charts/xatu-mimicry/.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-mimicry/Chart.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v2
2+
name: xatu-mimicry
3+
description: Ethereum p2p monitoring tool that collects data from the execution layer.
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-mimicry/README.md

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

charts/xatu-mimicry/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" . }}
+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-mimicry.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-mimicry.fullname" . }}'
9+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "xatu-mimicry.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
10+
echo http://$SERVICE_IP:{{ include "xatu-mimicry.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-mimicry.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 }}
+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-mimicry.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-mimicry.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-mimicry.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "xatu-mimicry.labels" -}}
37+
helm.sh/chart: {{ include "xatu-mimicry.chart" . }}
38+
{{ include "xatu-mimicry.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-mimicry.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "xatu-mimicry.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-mimicry.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "xatu-mimicry.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{- define "xatu-mimicry.metricsPort" -}}
65+
{{ (split ":" .Values.config.metricsAddr)._1 | default ":9090" }}
66+
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "xatu-mimicry.fullname" . }}
5+
labels:
6+
{{- include "xatu-mimicry.labels" . | nindent 4 }}
7+
data:
8+
config.yaml: |-
9+
{{ toYaml .Values.config | nindent 4 }}
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-mimicry.fullname" . }}
5+
labels:
6+
{{- include "xatu-mimicry.labels" . | nindent 4 }}
7+
annotations:
8+
{{- toYaml .Values.annotations | nindent 4 }}
9+
spec:
10+
replicas: {{ .Values.replicas }}
11+
selector:
12+
matchLabels:
13+
{{- include "xatu-mimicry.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
labels:
17+
{{- include "xatu-mimicry.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-mimicry.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+
- "mimicry"
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-mimicry.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-mimicry.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-mimicry.fullname" . }}
+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-mimicry.fullname" . }}-env
5+
labels:
6+
{{- include "xatu-mimicry.labels" . | nindent 4 }}
7+
data:
8+
{{- range $key, $value := .Values.secretEnv }}
9+
{{ $key }}: {{ $value | b64enc }}
10+
{{- end }}
+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-mimicry.fullname" . }}
5+
labels:
6+
{{- include "xatu-mimicry.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ include "xatu-mimicry.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-mimicry.selectorLabels" . | nindent 4 }}
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-mimicry.serviceAccountName" . }}
6+
labels:
7+
{{- include "xatu-mimicry.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)