Skip to content

Commit 8cecc14

Browse files
committed
update volume mounts
1 parent 00ce51c commit 8cecc14

File tree

3 files changed

+35
-36
lines changed

3 files changed

+35
-36
lines changed

resources/charts/bitcoincore/charts/lnd/templates/configmap.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,18 @@ data:
3838
AwEHoUQDQgAEBVltIvaTlAQI/3FFatTqVflZuZdRJ0SmRMSJrFLPtp0fxE7hmteS
3939
t6gjQriy90fP8j9OJXBNAjt915kLY4zVvg==
4040
-----END EC PRIVATE KEY-----
41-
MACAROON_HEX: 0201036c6e6402f801030a1062beabbf2a614b112128afa0c0b4fdd61201301a160a0761646472657373120472656164120577726974651a130a04696e666f120472656164120577726974651a170a08696e766f69636573120472656164120577726974651a210a086d616361726f6f6e120867656e6572617465120472656164120577726974651a160a076d657373616765120472656164120577726974651a170a086f6666636861696e120472656164120577726974651a160a076f6e636861696e120472656164120577726974651a140a057065657273120472656164120577726974651a180a067369676e6572120867656e657261746512047265616400000620b17be53e367290871681055d0de15587f6d1cd47d1248fe2662ae27f62cfbdc6
41+
42+
MACAROON_HEX: |
43+
0201036c6e6402f801030a1062beabbf2a614b112128afa0c0b4fdd61201301a160a0
44+
761646472657373120472656164120577726974651a130a04696e666f120472656164
45+
120577726974651a170a08696e766f69636573120472656164120577726974651a210
46+
a086d616361726f6f6e120867656e6572617465120472656164120577726974651a16
47+
0a076d657373616765120472656164120577726974651a170a086f6666636861696e1
48+
20472656164120577726974651a160a076f6e636861696e1204726561641205777269
49+
74651a140a057065657273120472656164120577726974651a180a067369676e65721
50+
20867656e657261746512047265616400000620b17be53e367290871681055d0de155
51+
87f6d1cd47d1248fe2662ae27f62cfbdc6
52+
4253
---
4354
apiVersion: v1
4455
kind: ConfigMap

resources/charts/bitcoincore/charts/lnd/templates/pod.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,27 @@ spec:
2121
{{- end }}
2222
securityContext:
2323
{{- toYaml .Values.podSecurityContext | nindent 4 }}
24-
{{- with .Values.extraContainers }}
2524
initContainers:
2625
- name: prepare-files
2726
image: busybox
2827
command:
2928
- sh
3029
- -c
31-
- |
32-
cp /root/.lnd/tls.cert /root/.lnd/tls_copy.cert
33-
chmod 644 /root/.lnd/tls_copy.cert
30+
- |
31+
# Read the hex-encoded macaroon from the ConfigMap
32+
HEX_MACAROON=$(cat /config/MACAROON_HEX)
33+
34+
# Convert the hex-encoded macaroon to binary format
35+
echo "$HEX_MACAROON" | xxd -r -p > /shared-data/admin.macaroon
36+
37+
# Ensure the file has the correct permissions
38+
chmod 644 /shared-data/admin.macaroon
3439
volumeMounts:
35-
- name: lnd-data
36-
mountPath: /root/.lnd
40+
- name: shared-data
41+
mountPath: /shared-data
3742
- name: config
38-
mountPath: /root/.lnd/tls.cert
39-
subPath: tls.cert
40-
{{- end }}
43+
mountPath: /config
44+
4145
containers:
4246
- name: {{ .Chart.Name }}
4347
securityContext:
@@ -63,8 +67,8 @@ spec:
6367
resources:
6468
{{- toYaml .Values.resources | nindent 8 }}
6569
volumeMounts:
66-
- name: lnd-data
67-
mountPath: /root/.lnd
70+
- mountPath: /shared-data
71+
name: shared-data
6872
{{- with .Values.volumeMounts }}
6973
{{- toYaml . | nindent 8 }}
7074
{{- end }}
@@ -81,7 +85,7 @@ spec:
8185
{{- toYaml . | nindent 4 }}
8286
{{- end }}
8387
volumes:
84-
- name: lnd-data
88+
- name: shared-data
8589
emptyDir: {}
8690
{{- with .Values.volumes }}
8791
{{- toYaml . | nindent 4 }}

resources/networks/hello/network.yaml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,36 +34,20 @@ nodes:
3434
push_amt: 50000
3535
extraContainers:
3636
- name: circuitbreaker
37-
securityContext:
38-
privileged: true
39-
capabilities:
40-
add:
41-
- NET_ADMIN
42-
- NET_RAW
4337
image: camillarhi/circuitbreaker:latest
4438
imagePullPolicy: IfNotPresent
4539
args:
4640
- "--network=regtest"
4741
- "--rpcserver=localhost:10009"
48-
- "--tlscertpath=/root/.lnd/tls_copy.cert"
49-
- "--macaroonpath=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon"
42+
- "--tlscertpath=/tls.cert"
43+
- "--macaroonpath=/shared-data/admin.macaroon"
5044
- "--httplisten=0.0.0.0:9235"
5145
volumeMounts:
52-
- name: lnd-data
53-
mountPath: /root/.lnd
54-
readinessProbe:
55-
exec:
56-
command:
57-
- /bin/sh
58-
- -c
59-
- |
60-
# Check if tls.cert exists and is readable
61-
test -f /root/.lnd/tls.cert && echo "tls.cert found" || exit 1
62-
# Check if admin.macaroon exists and is readable
63-
test -f /root/.lnd/data/chain/bitcoin/regtest/admin.macaroon && echo "macaroon found" || exit 1
64-
initialDelaySeconds: 10
65-
periodSeconds: 5
66-
timeoutSeconds: 1
46+
- name: shared-data
47+
mountPath: /shared-data
48+
- name: config
49+
mountPath: /tls.cert
50+
subPath: tls.cert
6751

6852
- name: tank-0004
6953
addnode:

0 commit comments

Comments
 (0)