Skip to content

Commit 7d20154

Browse files
authored
Feat/xatu (ethpandaops#150)
* feat(charts/xatu-discovery): init * feat(charts/xatu-sentry): update config * feat(charts/xatu-server): update config * feat: update readme with xatu references
1 parent 7133c30 commit 7d20154

20 files changed

+700
-47
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Tooling
7777
- [`smart-contract-verifier-http`](charts/smart-contract-verifier-http) - Smart contract verification service.
7878
- [`stubbies`](charts/stubbies) - Ethereum execution client stub for consensus layer clients.
7979
- [`web3signer`](charts/web3signer) - An open-source remote signing service.
80+
- [`xatu-discovery`](charts/xatu-discovery) - Ethereum p2p monitoring tool that discovers node records.
8081
- [`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/).
8182
- [`xatu-server`](charts/xatu-server) - Ethereum p2p monitoring tool that collects events from and controls various Xatu clients.
8283

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

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v2
2+
name: xatu-discovery
3+
description: Ethereum p2p monitoring tool that discovers node records.
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-discovery/README.md

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
2+
# xatu-discovery
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 discovers node records.
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.address | string | `"localhost:8080"` | |
18+
| config.coordinator.batchTimeout | string | `"5s"` | |
19+
| config.coordinator.concurrentExecutionPeers | int | `100` | |
20+
| config.coordinator.exportTimeout | string | `"30s"` | |
21+
| config.coordinator.headers.authorization | string | `"Someb64Value"` | |
22+
| config.coordinator.maxExportBatchSize | int | `512` | |
23+
| config.coordinator.maxQueueSize | int | `51200` | |
24+
| config.coordinator.tls | bool | `false` | |
25+
| config.logging | string | `"info"` | |
26+
| config.metricsAddr | string | `":9090"` | |
27+
| config.p2p.config.bootNodes[0] | string | `"enr:-Jq4QItoFUuug_n_qbYbU0OY04-np2wT8rUCauOOXNi0H3BWbDj-zbfZb7otA7jZ6flbBpx1LNZK2TDebZ9dEKx84LYBhGV0aDKQtTA_KgEAAAD__________4JpZIJ2NIJpcISsaa0ZiXNlY3AyNTZrMaEDHAD2JKYevx89W0CcFJFiskdcEzkH_Wdv9iW42qLK79ODdWRwgiMo"` | |
28+
| config.p2p.config.bootNodes[10] | string | `"enr:-Ku4QHqVeJ8PPICcWk1vSn_XcSkjOkNiTg6Fmii5j6vUQgvzMc9L1goFnLKgXqBJspJjIsB91LTOleFmyWWrFVATGngBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhAMRHkWJc2VjcDI1NmsxoQKLVXFOhp2uX6jeT0DvvDpPcU8FWMjQdR4wMuORMhpX24N1ZHCCIyg"` | |
29+
| config.p2p.config.bootNodes[11] | string | `"enr:-Ku4QG-2_Md3sZIAUebGYT6g0SMskIml77l6yR-M_JXc-UdNHCmHQeOiMLbylPejyJsdAPsTHJyjJB2sYGDLe0dn8uYBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhBLY-NyJc2VjcDI1NmsxoQORcM6e19T1T9gi7jxEZjk_sjVLGFscUNqAY9obgZaxbIN1ZHCCIyg"` | |
30+
| config.p2p.config.bootNodes[12] | string | `"enr:-Ku4QPn5eVhcoF1opaFEvg1b6JNFD2rqVkHQ8HApOKK61OIcIXD127bKWgAtbwI7pnxx6cDyk_nI88TrZKQaGMZj0q0Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDayLMaJc2VjcDI1NmsxoQK2sBOLGcUb4AwuYzFuAVCaNHA-dy24UuEKkeFNgCVCsIN1ZHCCIyg"` | |
31+
| config.p2p.config.bootNodes[13] | string | `"enr:-Ku4QEWzdnVtXc2Q0ZVigfCGggOVB2Vc1ZCPEc6j21NIFLODSJbvNaef1g4PxhPwl_3kax86YPheFUSLXPRs98vvYsoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhDZBrP2Jc2VjcDI1NmsxoQM6jr8Rb1ktLEsVcKAPa08wCsKUmvoQ8khiOl_SLozf9IN1ZHCCIyg"` | |
32+
| config.p2p.config.bootNodes[14] | string | `"enr:-Ku4QFmUkNp0g9bsLX2PfVeIyT-9WO-PZlrqZBNtEyofOOfLMScDjaTzGxIb1Ns9Wo5Pm_8nlq-SZwcQfTH2cgO-s88Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpDkvpOTAAAQIP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQLV_jMOIxKbjHFKgrkFvwDvpexo6Nd58TK5k7ss4Vt0IoN1ZHCCG1g"` | |
33+
| config.p2p.config.bootNodes[15] | string | `"enr:-LK4QLINdtobGquK7jukLDAKmsrH2ZuHM4k0TklY5jDTD4ZgfxR9weZmo5Jwu81hlKu3qPAvk24xHGBDjYs4o8f1gZ0Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpB53wQoAAAQIP__________gmlkgnY0gmlwhDRN_P6Jc2VjcDI1NmsxoQJuNujTgsJUHUgVZML3pzrtgNtYg7rQ4K1tkWERgl0DdoN0Y3CCIyiDdWRwgiMo"` | |
34+
| config.p2p.config.bootNodes[16] | string | `"enr:-LK4QH1xnjotgXwg25IDPjrqRGFnH1ScgNHA3dv1Z8xHCp4uP3N3Jjl_aYv_WIxQRdwZvSukzbwspXZ7JjpldyeVDzMCh2F0dG5ldHOIAAAAAAAAAACEZXRoMpB53wQoAAAQIP__________gmlkgnY0gmlwhIe1te-Jc2VjcDI1NmsxoQOkcGXqbCJYbcClZ3z5f6NWhX_1YPFRYRRWQpJjwSHpVIN0Y3CCIyiDdWRwgiMo"` | |
35+
| config.p2p.config.bootNodes[17] | string | `"enr:-Ly4QFPk-cTMxZ3jWTafiNblEZkQIXGF2aVzCIGW0uHp6KaEAvBMoctE8S7YU0qZtuS7By0AA4YMfKoN9ls_GJRccVpFh2F0dG5ldHOI__________-EZXRoMpCC9KcrAgAQIIS2AQAAAAAAgmlkgnY0gmlwhKh3joWJc2VjcDI1NmsxoQKrxz8M1IHwJqRIpDqdVW_U1PeixMW5SfnBD-8idYIQrIhzeW5jbmV0cw-DdGNwgiMog3VkcIIjKA"` | |
36+
| config.p2p.config.bootNodes[18] | string | `"enr:-L64QJmwSDtaHVgGiqIxJWUtxWg6uLCipsms6j-8BdsOJfTWAs7CLF9HJnVqFE728O-JYUDCxzKvRdeMqBSauHVCMdaCAVWHYXR0bmV0c4j__________4RldGgykIL0pysCABAghLYBAAAAAACCaWSCdjSCaXCEQWxOdolzZWNwMjU2azGhA7Qmod9fK86WidPOzLsn5_8QyzL7ZcJ1Reca7RnD54vuiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo"` | |
37+
| config.p2p.config.bootNodes[19] | string | `"enr:-KG4QCIzJZTY_fs_2vqWEatJL9RrtnPwDCv-jRBuO5FQ2qBrfJubWOWazri6s9HsyZdu-fRUfEzkebhf1nvO42_FVzwDhGV0aDKQed8EKAAAECD__________4JpZIJ2NIJpcISHtbYziXNlY3AyNTZrMaED4m9AqVs6F32rSCGsjtYcsyfQE2K8nDiGmocUY_iq-TSDdGNwgiMog3VkcIIjKA"` | |
38+
| config.p2p.config.bootNodes[1] | string | `"enr:-Jq4QN_YBsUOqQsty1OGvYv48PMaiEt1AzGD1NkYQHaxZoTyVGqMYXg0K9c0LPNWC9pkXmggApp8nygYLsQwScwAgfgBhGV0aDKQtTA_KgEAAAD__________4JpZIJ2NIJpcISLosQxiXNlY3AyNTZrMaEDBJj7_dLFACaxBfaI8KZTh_SSJUjhyAyfshimvSqo22WDdWRwgiMo"` | |
39+
| config.p2p.config.bootNodes[20] | string | `"enr:-Iq4QMCTfIMXnow27baRUb35Q8iiFHSIDBJh6hQM5Axohhf4b6Kr_cOCu0htQ5WvVqKvFgY28893DHAg8gnBAXsAVqmGAX53x8JggmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk"` | |
40+
| config.p2p.config.bootNodes[21] | string | `"enr:-KG4QE5OIg5ThTjkzrlVF32WT_-XT14WeJtIz2zoTqLLjQhYAmJlnk4ItSoH41_2x0RX0wTFIe5GgjRzU2u7Q1fN4vADhGV0aDKQqP7o7pAAAHAyAAAAAAAAAIJpZIJ2NIJpcISlFsStiXNlY3AyNTZrMaEC-Rrd_bBZwhKpXzFCrStKp1q_HmGOewxY3KwM8ofAj_ODdGNwgiMog3VkcIIjKA"` | |
41+
| config.p2p.config.bootNodes[22] | string | `"enr:-Ly4QFoZTWR8ulxGVsWydTNGdwEESueIdj-wB6UmmjUcm-AOPxnQi7wprzwcdo7-1jBW_JxELlUKJdJES8TDsbl1EdNlh2F0dG5ldHOI__78_v2bsV-EZXRoMpA2-lATkAAAcf__________gmlkgnY0gmlwhBLYJjGJc2VjcDI1NmsxoQI0gujXac9rMAb48NtMqtSTyHIeNYlpjkbYpWJw46PmYYhzeW5jbmV0cw-DdGNwgiMog3VkcIIjKA"` | |
42+
| config.p2p.config.bootNodes[2] | string | `"enr:-KG4QOtcP9X1FbIMOe17QNMKqDxCpm14jcX5tiOE4_TyMrFqbmhPZHK_ZPG2Gxb1GE2xdtodOfx9-cgvNtxnRyHEmC0ghGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQDE8KdiXNlY3AyNTZrMaEDhpehBDbZjM_L9ek699Y7vhUJ-eAdMyQW_Fil522Y0fODdGNwgiMog3VkcIIjKA"` | |
43+
| config.p2p.config.bootNodes[3] | string | `"enr:-KG4QDyytgmE4f7AnvW-ZaUOIi9i79qX4JwjRAiXBZCU65wOfBu-3Nb5I7b_Rmg3KCOcZM_C3y5pg7EBU5XGrcLTduQEhGV0aDKQ9aX9QgAAAAD__________4JpZIJ2NIJpcIQ2_DUbiXNlY3AyNTZrMaEDKnz_-ps3UUOfHWVYaskI5kWYO_vtYMGYCQRAR3gHDouDdGNwgiMog3VkcIIjKA"` | |
44+
| config.p2p.config.bootNodes[4] | string | `"enr:-KG4QL-eqFoHy0cI31THvtZjpYUu_Jdw_MO7skQRJxY1g5HTN1A0epPCU6vi0gLGUgrzpU-ygeMSS8ewVxDpKfYmxMMGhGV0aDKQtTA_KgAAAAD__________4JpZIJ2NIJpcIQ2_DUbiXNlY3AyNTZrMaED8GJ2vzUqgL6-KD1xalo1CsmY4X1HaDnyl6Y_WayCo9GDdGNwgiMog3VkcIIjKA"` | |
45+
| config.p2p.config.bootNodes[5] | string | `"enr:-Ku4QImhMc1z8yCiNJ1TyUxdcfNucje3BGwEHzodEZUan8PherEo4sF7pPHPSIB1NNuSg5fZy7qFsjmUKs2ea1Whi0EBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQOVphkDqal4QzPMksc5wnpuC3gvSC8AfbFOnZY_On34wIN1ZHCCIyg"` | |
46+
| config.p2p.config.bootNodes[6] | string | `"enr:-Ku4QP2xDnEtUXIjzJ_DhlCRN9SN99RYQPJL92TMlSv7U5C1YnYLjwOQHgZIUXw6c-BvRg2Yc2QsZxxoS_pPRVe0yK8Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQMeFF5GrS7UZpAH2Ly84aLK-TyvH-dRo0JM1i8yygH50YN1ZHCCJxA"` | |
47+
| config.p2p.config.bootNodes[7] | string | `"enr:-Ku4QPp9z1W4tAO8Ber_NQierYaOStqhDqQdOPY3bB3jDgkjcbk6YrEnVYIiCBbTxuar3CzS528d2iE7TdJsrL-dEKoBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpD1pf1CAAAAAP__________gmlkgnY0gmlwhBLf22SJc2VjcDI1NmsxoQMw5fqqkw2hHC4F5HZZDPsNmPdB1Gi8JPQK7pRc9XHh-oN1ZHCCKvg"` | |
48+
| config.p2p.config.bootNodes[8] | string | `"enr:-LK4QA8FfhaAjlb_BXsXxSfiysR7R52Nhi9JBt4F8SPssu8hdE1BXQQEtVDC3qStCW60LSO7hEsVHv5zm8_6Vnjhcn0Bh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhAN4aBKJc2VjcDI1NmsxoQJerDhsJ-KxZ8sHySMOCmTO6sHM3iCFQ6VMvLTe948MyYN0Y3CCI4yDdWRwgiOM"` | |
49+
| config.p2p.config.bootNodes[9] | string | `"enr:-LK4QKWrXTpV9T78hNG6s8AM6IO4XH9kFT91uZtFg1GcsJ6dKovDOr1jtAAFPnS2lvNltkOGA9k29BUN7lFh_sjuc9QBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhANAdd-Jc2VjcDI1NmsxoQLQa6ai7y9PMN5hpLe5HmiJSlYzMuzP7ZhwRiwHvqNXdoN0Y3CCI4yDdWRwgiOM"` | |
50+
| config.p2p.config.discV4 | bool | `true` | |
51+
| config.p2p.config.discV5 | bool | `true` | |
52+
| config.p2p.config.restart | string | `"120s"` | |
53+
| config.p2p.type | string | `"static"` | |
54+
| containerSecurityContext | object | See `values.yaml` | The security context for containers |
55+
| customArgs | list | `[]` | Custom args for the xatu container |
56+
| customCommand | list | `[]` | Command replacement for the xatu container |
57+
| extraContainers | list | `[]` | Additional containers |
58+
| extraEnv | list | `[]` | Additional env variables |
59+
| extraPorts | list | `[]` | Additional ports. Useful when using extraContainers |
60+
| extraVolumeMounts | list | `[]` | Additional volume mounts |
61+
| extraVolumes | list | `[]` | Additional volumes |
62+
| fullnameOverride | string | `""` | Overrides the chart's computed fullname |
63+
| image.pullPolicy | string | `"IfNotPresent"` | xatu container pull policy |
64+
| image.repository | string | `"ethpandaops/xatu"` | xatu container image repository |
65+
| image.tag | string | `"latest"` | xatu container image tag |
66+
| imagePullSecrets | list | `[]` | Image pull secrets for Docker images |
67+
| initContainers | list | `[]` | Additional init containers |
68+
| livenessProbe | object | See `values.yaml` | Liveness probe |
69+
| nameOverride | string | `""` | Overrides the chart's name |
70+
| nodeSelector | object | `{}` | Node selector for pods |
71+
| podAnnotations | object | `{}` | Pod annotations |
72+
| podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created |
73+
| podLabels | object | `{}` | Pod labels |
74+
| priorityClassName | string | `nil` | Pod priority class |
75+
| readinessProbe | object | See `values.yaml` | Readiness probe |
76+
| replicas | int | `1` | Number of replicas |
77+
| resources | object | `{}` | Resource requests and limits |
78+
| secretEnv | object | `{}` | Secret env variables injected via a created secret |
79+
| securityContext | object | See `values.yaml` | The security context for pods |
80+
| service.type | string | `"ClusterIP"` | Service type |
81+
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
82+
| serviceAccount.create | bool | `false` | Specifies whether a service account should be created |
83+
| 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 |
84+
| serviceMonitor.annotations | object | `{}` | Additional ServiceMonitor annotations |
85+
| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator https://github.com/coreos/prometheus-operator |
86+
| serviceMonitor.interval | string | `"15s"` | ServiceMonitor scrape interval |
87+
| serviceMonitor.labels | object | `{}` | Additional ServiceMonitor labels |
88+
| serviceMonitor.namespace | string | `nil` | Alternative namespace for ServiceMonitor |
89+
| serviceMonitor.path | string | `"/metrics"` | Path to scrape |
90+
| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabelings |
91+
| serviceMonitor.scheme | string | `"http"` | ServiceMonitor scheme |
92+
| serviceMonitor.scrapeTimeout | string | `"30s"` | ServiceMonitor scrape timeout |
93+
| serviceMonitor.tlsConfig | object | `{}` | ServiceMonitor TLS configuration |
94+
| terminationGracePeriodSeconds | int | `30` | How long to wait until the pod is forcefully terminated |
95+
| tolerations | list | `[]` | Tolerations for pods |
+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-discovery.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-discovery.fullname" . }}'
9+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "xatu-discovery.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
10+
echo http://$SERVICE_IP:{{ include "xatu-discovery.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-discovery.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 }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "xatu-discovery.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-discovery.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-discovery.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "xatu-discovery.labels" -}}
37+
helm.sh/chart: {{ include "xatu-discovery.chart" . }}
38+
{{ include "xatu-discovery.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-discovery.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "xatu-discovery.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-discovery.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "xatu-discovery.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{- define "xatu-discovery.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-discovery.fullname" . }}
5+
labels:
6+
{{- include "xatu-discovery.labels" . | nindent 4 }}
7+
data:
8+
config.yaml: |-
9+
{{ toYaml .Values.config | nindent 4 }}

0 commit comments

Comments
 (0)