Skip to content

Commit 7ae26ea

Browse files
authored
[dlcbtc-attestors] initial chart commit (#153)
* feat: dlcbtc chart initial commit
1 parent a2b7a5d commit 7ae26ea

File tree

14 files changed

+707
-0
lines changed

14 files changed

+707
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/charts/cert-manager/ @gehlotanish @Manjeet-Nethermind
1717
/charts/common/ @aivarasko @matilote
1818
/charts/dirk/ @aivarasko @matilote
19+
/charts/dlcbtc-attestor/ @gehlotanish
1920
/charts/ethereum-node/ @gehlotanish @Manjeet-Nethermind
2021
/charts/execution-beacon/ @aivarasko @AntiD2ta @matilote
2122
/charts/external-dns/ @gehlotanish @Manjeet-Nethermind

charts/dlcbtc-attestor/.helmignore

Lines changed: 23 additions & 0 deletions
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/dlcbtc-attestor/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: dlc-link-attestor
3+
description: A Helm chart for Kubernetes
4+
type: application
5+
version: 0.1.0
6+
appVersion: "1.5.0"

charts/dlcbtc-attestor/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Helm Chart for DLC Attestor
2+
3+
This Helm chart deploys the DLC Attestor application with customizable settings for replica count, image configuration, security, affinity, monitoring, and more. The deployment supports various blockchain networks for attestation purposes.
4+
5+
## Values Configuration
6+
7+
### Global Values
8+
9+
| Parameter | Description | Default |
10+
|-------------------------|------------------------------------------------------|-------------------------------------------------|
11+
| `global.replicaCount` | Number of replicas to deploy | `1` |
12+
| `global.image.repository` | Container image repository | `public.ecr.aws/dlc-link/dlc-attestor` |
13+
| `global.image.tag` | Container image tag | `v1.5.4-testnet` |
14+
| `global.image.imagePullPolicy` | Image pull policy | `IfNotPresent` |
15+
| `global.externalSecrets.enabled` | Enable external secrets integration | `true` |
16+
| `global.externalSecrets.secretStoreRef` | External secret store reference name | `secretStoreRef` |
17+
| `global.serviceAccount.create` | Create a service account | `false` |
18+
| `global.imagePullSecrets` | Secrets to use for pulling images | `artifactory-general-secret` |
19+
| `global.nodeSelector` | Node selector for pod assignment | `{k8s.scaleway.com/pool-name: workloads-pool-nl-ams-2, beta.kubernetes.io/instance-type: PLAY2-MICRO}` |
20+
| `global.tolerations` | Tolerations for pod assignment | `{}` |
21+
| `global.affinity` | Affinity rules for pod assignment | `{}` |
22+
| `global.sessionAffinity.enabled` | Enable session affinity | `false` |
23+
| `global.sessionAffinity.timeoutSeconds` | Session duration (in seconds) | `86400` |
24+
| `global.healthProbe.consensus.livenessProbe` | Liveness probe configuration | `{}` |
25+
| `global.healthProbe.consensus.readinessProbe` | Readiness probe configuration | `{}` |
26+
| `global.service.svcHeadless` | Create headless service | `false` |
27+
| `global.service.type` | Service type | `ClusterIP` |
28+
| `global.service.externalTrafficPolicy` | External traffic policy | `Cluster` |
29+
| `global.service.Ports` | Ports exposed by the service | See [Service Ports](#service-ports) |
30+
31+
### ConfigMap Configuration
32+
33+
The `configMap.config` section specifies key-value pairs for configuring the DLC attestor application. The configuration is templated and includes environment-specific variables like `ATTESTOR_NAME`, `BITCOIN_CORE_RPC_ENDPOINT`, and more.
34+
35+
### Environment Variables
36+
37+
Define container environment variables under the `env` section:
38+
39+
| Name | Description | Example Value |
40+
|--------------------------|---------------------------------------------------|-----------------------------------------------|
41+
| `ATTESTOR_NAME` | Name of the attestor | `nethermind` |
42+
43+
### Monitoring
44+
45+
The `metrics` section allows configuring monitoring with Prometheus through a `ServiceMonitor`.
46+
47+
| Parameter | Description | Default |
48+
|-------------------------|------------------------------------------------------|-------------------------------------------------|
49+
| `metrics.enabled` | Enable metrics scraping | `true` |
50+
| `metrics.serviceMonitor.interval` | Scrape interval | `30s` |
51+
| `metrics.serviceMonitor.honorLabels` | Whether to honor metric labels | `false` |
52+
53+
### Service Ports
54+
55+
The application exposes multiple service ports:
56+
57+
| Port Name | Port Number | Protocol |
58+
|--------------------------------|-------------|---------------|
59+
| `ATTESTOR_BACKEND_PORT` | `8811` | `TCP` |
60+
| `BLOCKCHAIN_INTERFACE_PORT` | `8801` | `TCP` |
61+
62+
### Miscellaneous
63+
64+
Additional Kubernetes objects can be specified using `extraObjects`.
65+
66+
---
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{{/*
2+
====== Return the target Kubernetes version ======
3+
*/}}
4+
{{- define "common.capabilities.kubeVersion" -}}
5+
{{- if .Values.global }}
6+
{{- if .Values.global.kubeVersion }}
7+
{{- .Values.global.kubeVersion -}}
8+
{{- else }}
9+
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
10+
{{- end -}}
11+
{{- else }}
12+
{{- default .Capabilities.KubeVersion.Version .Values.kubeVersion -}}
13+
{{- end -}}
14+
{{- end -}}
15+
16+
{{/*
17+
====== Return the appropriate apiVersion for poddisruptionbudget. ======
18+
*/}}
19+
{{- define "common.capabilities.policy.apiVersion" -}}
20+
{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}}
21+
{{- print "policy/v1beta1" -}}
22+
{{- else -}}
23+
{{- print "policy/v1" -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
====== Return the appropriate apiVersion for networkpolicy. ======
29+
*/}}
30+
{{- define "common.capabilities.networkPolicy.apiVersion" -}}
31+
{{- if semverCompare "<1.7-0" (include "common.capabilities.kubeVersion" .) -}}
32+
{{- print "extensions/v1beta1" -}}
33+
{{- else -}}
34+
{{- print "networking.k8s.io/v1" -}}
35+
{{- end -}}
36+
{{- end -}}
37+
38+
{{/*
39+
====== Return the appropriate apiVersion for cronjob. ======
40+
*/}}
41+
{{- define "common.capabilities.cronjob.apiVersion" -}}
42+
{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}}
43+
{{- print "batch/v1beta1" -}}
44+
{{- else -}}
45+
{{- print "batch/v1" -}}
46+
{{- end -}}
47+
{{- end -}}
48+
49+
{{/*
50+
====== Return the appropriate apiVersion for deployment. ======
51+
*/}}
52+
{{- define "common.capabilities.deployment.apiVersion" -}}
53+
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
54+
{{- print "extensions/v1beta1" -}}
55+
{{- else -}}
56+
{{- print "apps/v1" -}}
57+
{{- end -}}
58+
{{- end -}}
59+
60+
{{/*
61+
====== Return the appropriate apiVersion for statefulset.======
62+
*/}}
63+
{{- define "common.capabilities.statefulset.apiVersion" -}}
64+
{{- if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
65+
{{- print "apps/v1beta1" -}}
66+
{{- else -}}
67+
{{- print "apps/v1" -}}
68+
{{- end -}}
69+
{{- end -}}
70+
71+
{{/*
72+
====== Return the appropriate apiVersion for ingress. ======
73+
*/}}
74+
{{- define "common.capabilities.ingress.apiVersion" -}}
75+
{{- if .Values.ingress -}}
76+
{{- if .Values.ingress.apiVersion -}}
77+
{{- .Values.ingress.apiVersion -}}
78+
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
79+
{{- print "extensions/v1beta1" -}}
80+
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
81+
{{- print "networking.k8s.io/v1beta1" -}}
82+
{{- else -}}
83+
{{- print "networking.k8s.io/v1" -}}
84+
{{- end }}
85+
{{- else if semverCompare "<1.14-0" (include "common.capabilities.kubeVersion" .) -}}
86+
{{- print "extensions/v1beta1" -}}
87+
{{- else if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
88+
{{- print "networking.k8s.io/v1beta1" -}}
89+
{{- else -}}
90+
{{- print "networking.k8s.io/v1" -}}
91+
{{- end -}}
92+
{{- end -}}
93+
94+
{{/*
95+
====== Return the appropriate apiVersion for RBAC resources. ======
96+
*/}}
97+
{{- define "common.capabilities.rbac.apiVersion" -}}
98+
{{- if semverCompare "<1.17-0" (include "common.capabilities.kubeVersion" .) -}}
99+
{{- print "rbac.authorization.k8s.io/v1beta1" -}}
100+
{{- else -}}
101+
{{- print "rbac.authorization.k8s.io/v1" -}}
102+
{{- end -}}
103+
{{- end -}}
104+
105+
{{/*
106+
====== Return the appropriate apiVersion for CRDs. ======
107+
*/}}
108+
{{- define "common.capabilities.crd.apiVersion" -}}
109+
{{- if semverCompare "<1.19-0" (include "common.capabilities.kubeVersion" .) -}}
110+
{{- print "apiextensions.k8s.io/v1beta1" -}}
111+
{{- else -}}
112+
{{- print "apiextensions.k8s.io/v1" -}}
113+
{{- end -}}
114+
{{- end -}}
115+
116+
{{/*
117+
Returns true if the used Helm version is 3.3+.
118+
A way to check the used Helm version was not introduced until version 3.3.0 with .Capabilities.HelmVersion, which contains an additional "{}}" structure.
119+
This check is introduced as a regexMatch instead of {{ if .Capabilities.HelmVersion }} because checking for the key HelmVersion in <3.3 results in a "interface not found" error.
120+
**To be removed when the catalog's minimun Helm version is 3.3**
121+
*/}}
122+
{{- define "common.capabilities.supportsHelmVersion" -}}
123+
{{- if regexMatch "{(v[0-9])*[^}]*}}$" (.Capabilities | toString ) }}
124+
{{- true -}}
125+
{{- end -}}
126+
{{- end -}}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{{/*
2+
====== Basic ======
3+
*/}}
4+
5+
{{- define "dlcbtc.namespace" -}}
6+
{{- default .Release.Namespace -}}
7+
{{- end -}}
8+
9+
{{- define "dlcbtc.release" -}}
10+
{{- default .Release.Name -}}
11+
{{- end -}}
12+
13+
{{- define "dlcbtc.name" -}}
14+
{{- printf "%s-%s" .Chart.Name .Release.Name | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
15+
{{- end -}}
16+
17+
{{- define "dlcbtc.names.chartWithoutVersion" -}}
18+
{{- printf "%s" .Chart.Name | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
19+
{{- end -}}
20+
21+
{{- define "dlcbtc.chart" -}}
22+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
25+
26+
{{/*
27+
====== Labels ======
28+
*/}}
29+
30+
{{- define "dlcbtc.metaLabels" -}}
31+
app.kubernetes.io/name: {{ template "dlcbtc.name" . }}
32+
helm.sh/chart: {{ include "dlcbtc.names.chartWithoutVersion" . }}
33+
app.kubernetes.io/managed-by: "{{ .Release.Service }}"
34+
{{- range $key, $value := .Values.global.extraLabels }}
35+
{{ $key }}: {{ include "dlcbtc.renderTpl" (dict "value" $value "context" $) | quote }}
36+
{{- end }}
37+
{{- end -}}
38+
39+
{{- define "dlcbtc.matchLabels" -}}
40+
app.kubernetes.io/name: {{ template "dlcbtc.name" . }}
41+
helm.sh/chart: {{ include "dlcbtc.names.chartWithoutVersion" . }}
42+
app.kubernetes.io/managed-by: "{{ .Release.Service }}"
43+
{{- range $key, $value := .Values.global.extraMatchLabels }}
44+
{{ $key }}: {{ include "dlcbtc.renderTplMatchLables" (dict "value" $value "context" $) | quote }}
45+
{{- end }}
46+
{{- end -}}
47+
48+
{{- define "dlcbtc.statefulset" -}}
49+
app.kubernetes.io/name: {{ template "dlcbtc.name" . }}
50+
helm.sh/chart: {{ include "dlcbtc.names.chartWithoutVersion" . }}
51+
app.kubernetes.io/managed-by: "{{ .Release.Service }}"
52+
{{- range $key, $value := .Values.global.extraLabels }}
53+
{{ $key }}: {{ include "dlcbtc.renderTplStatefulset" (dict "value" $value "context" $) | quote }}
54+
{{- end }}
55+
{{- end -}}
56+
57+
{{- define "dlcbtc.renderTpl" -}}
58+
{{- if typeIs "string" .value }}
59+
{{- tpl .value .context }}
60+
{{- else }}
61+
{{- tpl (.value | toYaml) .context }}
62+
{{- end }}
63+
{{- end -}}
64+
65+
{{- define "dlcbtc.renderTplMatchLables" -}}
66+
{{- if typeIs "string" .value }}
67+
{{- tpl .value .context }}
68+
{{- else }}
69+
{{- tpl (.value | toYaml) .context }}
70+
{{- end }}
71+
{{- end -}}
72+
73+
{{- define "dlcbtc.renderTplStatefulset" -}}
74+
{{- if typeIs "string" .value }}
75+
{{- tpl .value .context }}
76+
{{- else }}
77+
{{- tpl (.value | toYaml) .context }}
78+
{{- end }}
79+
{{- end -}}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ template "dlcbtc.name" . }}
5+
namespace: {{ template "dlcbtc.namespace" . }}
6+
labels:
7+
{{- include "dlcbtc.metaLabels" . | nindent 4 }}
8+
data:
9+
config.toml: |
10+
{{ .Values.configMap.config | indent 4 }}

0 commit comments

Comments
 (0)