Skip to content

Commit 6c54c7b

Browse files
committed
add cln chart
1 parent 1f44794 commit 6c54c7b

File tree

8 files changed

+365
-0
lines changed

8 files changed

+365
-0
lines changed

Diff for: resources/charts/bitcoincore/charts/cln/.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/

Diff for: resources/charts/bitcoincore/charts/cln/Chart.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: cln
3+
description: A Helm chart for CLN
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "0.1.0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{{/*
2+
Expand the name of the PARENT chart.
3+
*/}}
4+
{{- define "bitcoincore.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified PARENT 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 "bitcoincore.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}
18+
{{- end }}
19+
{{- end }}
20+
21+
22+
{{/*
23+
Expand the name of the chart.
24+
*/}}
25+
{{- define "cln.name" -}}
26+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
27+
{{- end }}
28+
29+
{{/*
30+
Create a default fully qualified app name.
31+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
32+
If release name contains chart name it will be used as a full name.
33+
*/}}
34+
{{- define "cln.fullname" -}}
35+
{{- if .Values.fullnameOverride }}
36+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
37+
{{- else }}
38+
{{- $name := default .Chart.Name .Values.nameOverride }}
39+
{{- if contains $name .Release.Name }}
40+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
41+
{{- else }}
42+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
43+
{{- end }}
44+
{{- end }}
45+
{{- end }}
46+
47+
{{/*
48+
Create chart name and version as used by the chart label.
49+
*/}}
50+
{{- define "cln.chart" -}}
51+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
52+
{{- end }}
53+
54+
{{/*
55+
Common labels
56+
*/}}
57+
{{- define "cln.labels" -}}
58+
helm.sh/chart: {{ include "cln.chart" . }}
59+
{{ include "cln.selectorLabels" . }}
60+
{{- if .Chart.AppVersion }}
61+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
62+
{{- end }}
63+
app.kubernetes.io/managed-by: {{ .Release.Service }}
64+
{{- end }}
65+
66+
{{/*
67+
Selector labels
68+
*/}}
69+
{{- define "cln.selectorLabels" -}}
70+
app.kubernetes.io/name: {{ include "cln.name" . }}
71+
app.kubernetes.io/instance: {{ .Release.Name }}
72+
{{- end }}
73+
74+
{{/*
75+
Create the name of the service account to use
76+
*/}}
77+
{{- define "cln.serviceAccountName" -}}
78+
{{- if .Values.serviceAccount.create }}
79+
{{- default (include "cln.fullname" .) .Values.serviceAccount.name }}
80+
{{- else }}
81+
{{- default "default" .Values.serviceAccount.name }}
82+
{{- end }}
83+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "cln.fullname" . }}
5+
labels:
6+
{{- include "cln.labels" . | nindent 4 }}
7+
data:
8+
cln.conf: |
9+
{{- .Values.baseConfig | nindent 4 }}
10+
{{- .Values.defaultConfig | nindent 4 }}
11+
{{- .Values.config | nindent 4 }}
12+
network={{ .Values.global.chain }}
13+
bitcoin-rpcconnect={{ include "bitcoincore.fullname" . }}
14+
bitcoin-rpcport={{ index .Values.global .Values.global.chain "RPCPort" }}
15+
bitcoin-rpcpassword={{ .Values.global.rpcpassword }}
16+
alias={{ include "cln.fullname" . }}
17+
---
18+
apiVersion: v1
19+
kind: ConfigMap
20+
metadata:
21+
name: {{ include "cln.fullname" . }}-channels
22+
labels:
23+
channels: "true"
24+
{{- include "cln.labels" . | nindent 4 }}
25+
data:
26+
source: {{ include "cln.fullname" . }}
27+
channels: |
28+
{{ .Values.channels | toJson }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: {{ include "cln.fullname" . }}
5+
labels:
6+
{{- include "cln.labels" . | nindent 4 }}
7+
{{- with .Values.podLabels }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
10+
app: {{ include "cln.fullname" . }}
11+
{{- if .Values.collectLogs }}
12+
collect_logs: "true"
13+
{{- end }}
14+
chain: {{ .Values.global.chain }}
15+
annotations:
16+
kubectl.kubernetes.io/default-container: "cln"
17+
spec:
18+
{{- with .Values.imagePullSecrets }}
19+
imagePullSecrets:
20+
{{- toYaml . | nindent 4 }}
21+
{{- end }}
22+
securityContext:
23+
{{- toYaml .Values.podSecurityContext | nindent 4 }}
24+
containers:
25+
- name: {{ .Chart.Name }}
26+
securityContext:
27+
{{- toYaml .Values.securityContext | nindent 8 }}
28+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
29+
imagePullPolicy: {{ .Values.image.pullPolicy }}
30+
ports:
31+
- name: p2p
32+
containerPort: {{ .Values.P2PPort }}
33+
protocol: TCP
34+
livenessProbe:
35+
{{- toYaml .Values.livenessProbe | nindent 8 }}
36+
readinessProbe:
37+
{{- toYaml .Values.readinessProbe | nindent 8 }}
38+
startupProbe:
39+
{{- toYaml .Values.startupProbe | nindent 8 }}
40+
resources:
41+
{{- toYaml .Values.resources | nindent 8 }}
42+
volumeMounts:
43+
{{- with .Values.volumeMounts }}
44+
{{- toYaml . | nindent 8 }}
45+
{{- end }}
46+
- mountPath: /root/.lightning/config
47+
name: config
48+
subPath: config
49+
{{- with .Values.extraContainers }}
50+
{{- toYaml . | nindent 4 }}
51+
{{- end }}
52+
volumes:
53+
{{- with .Values.volumes }}
54+
{{- toYaml . | nindent 4 }}
55+
{{- end }}
56+
- configMap:
57+
name: {{ include "cln.fullname" . }}
58+
name: config
59+
{{- with .Values.nodeSelector }}
60+
nodeSelector:
61+
{{- toYaml . | nindent 4 }}
62+
{{- end }}
63+
{{- with .Values.affinity }}
64+
affinity:
65+
{{- toYaml . | nindent 4 }}
66+
{{- end }}
67+
{{- with .Values.tolerations }}
68+
tolerations:
69+
{{- toYaml . | nindent 4 }}
70+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "cln.fullname" . }}
5+
labels:
6+
{{- include "cln.labels" . | nindent 4 }}
7+
app: {{ include "cln.fullname" . }}
8+
spec:
9+
type: {{ .Values.service.type }}
10+
ports:
11+
- port: {{ .Values.P2PPort }}
12+
targetPort: p2p
13+
protocol: TCP
14+
name: p2p
15+
selector:
16+
{{- include "cln.selectorLabels" . | nindent 4 }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- if .Values.metricsExport }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: {{ include "cln.fullname" . }}
6+
labels:
7+
app.kubernetes.io/name: cln-metrics
8+
release: prometheus
9+
spec:
10+
endpoints:
11+
- port: prometheus-metrics
12+
selector:
13+
matchLabels:
14+
app: {{ include "cln.fullname" . }}
15+
{{- end }}

Diff for: resources/charts/bitcoincore/charts/cln/values.yaml

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Default values for cln.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
namespace: warnet
5+
6+
# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
7+
replicaCount: 1
8+
9+
image:
10+
repository: elementsproject/lightningd
11+
pullPolicy: IfNotPresent
12+
tag: "v25.02"
13+
14+
imagePullSecrets: []
15+
nameOverride: ""
16+
fullnameOverride: ""
17+
18+
podAnnotations: {}
19+
podLabels:
20+
app: "warnet"
21+
mission: "lightning"
22+
23+
podSecurityContext: {}
24+
# fsGroup: 2000
25+
26+
securityContext: {}
27+
# capabilities:
28+
# drop:
29+
# - ALL
30+
# readOnlyRootFilesystem: true
31+
# runAsNonRoot: true
32+
# runAsUser: 1000
33+
34+
service:
35+
type: ClusterIP
36+
37+
P2PPort: 9735
38+
39+
# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
40+
ingress:
41+
enabled: false
42+
className: ""
43+
annotations: {}
44+
# kubernetes.io/ingress.class: nginx
45+
# kubernetes.io/tls-acme: "true"
46+
hosts:
47+
- host: chart-example.local
48+
paths:
49+
- path: /
50+
pathType: ImplementationSpecific
51+
tls: []
52+
# - secretName: chart-example-tls
53+
# hosts:
54+
# - chart-example.local
55+
56+
resources: {}
57+
# We usually recommend not to specify default resources and to leave this as a conscious
58+
# choice for the user. This also increases chances charts run on environments with little
59+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
60+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
61+
# limits:
62+
# cpu: 100m
63+
# memory: 128Mi
64+
# requests:
65+
# cpu: 100m
66+
# memory: 128Mi
67+
68+
livenessProbe:
69+
httpGet:
70+
path: /
71+
port: http
72+
readinessProbe:
73+
httpGet:
74+
path: /
75+
port: http
76+
77+
# Additional volumes on the output Deployment definition.
78+
volumes: []
79+
# - name: foo
80+
# secret:
81+
# secretName: mysecret
82+
# optional: false
83+
84+
# Additional volumeMounts on the output Deployment definition.
85+
volumeMounts: []
86+
# - name: foo
87+
# mountPath: "/etc/foo"
88+
# readOnly: true
89+
90+
nodeSelector: {}
91+
92+
tolerations: []
93+
94+
affinity: {}
95+
96+
baseConfig: |
97+
log-level=debug
98+
bind-addr=0.0.0.0:9735
99+
bitcoin-rpcuser=user
100+
# bitcoind.rpcpass are set in configmap.yaml
101+
102+
config: ""
103+
104+
defaultConfig: ""
105+
106+
channels: []

0 commit comments

Comments
 (0)