Skip to content

Commit 3359a13

Browse files
authored
Circuitbreaker Update (#4)
* plugin: remove circuit-breaker from the plugin section * template: add extracontainers for circuitbreaker * pod: update pod for extra containers
1 parent 4e8bcc8 commit 3359a13

File tree

11 files changed

+51
-533
lines changed

11 files changed

+51
-533
lines changed

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

Lines changed: 19 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,23 @@ spec:
1919
{{- end }}
2020
securityContext:
2121
{{- toYaml .Values.podSecurityContext | nindent 4 }}
22+
{{- with .Values.extraContainers }}
2223
initContainers:
23-
- name: prepare-files
24-
image: busybox
25-
command:
26-
- sh
27-
- -c
28-
- |
29-
cp /root/.lnd/tls.cert /root/.lnd/tls_copy.cert
30-
chmod 644 /root/.lnd/tls_copy.cert
31-
volumeMounts:
32-
- name: lnd-data
33-
mountPath: /root/.lnd
34-
- name: config
35-
mountPath: /root/.lnd/tls.cert
36-
subPath: tls.cert
24+
- name: prepare-files
25+
image: busybox
26+
command:
27+
- sh
28+
- -c
29+
- |
30+
cp /root/.lnd/tls.cert /root/.lnd/tls_copy.cert
31+
chmod 644 /root/.lnd/tls_copy.cert
32+
volumeMounts:
33+
- name: lnd-data
34+
mountPath: /root/.lnd
35+
- name: config
36+
mountPath: /root/.lnd/tls.cert
37+
subPath: tls.cert
38+
{{- end }}
3739
containers:
3840
- name: {{ .Chart.Name }}
3941
securityContext:
@@ -73,38 +75,9 @@ spec:
7375
- mountPath: /root/.lnd/tls.cert
7476
name: config
7577
subPath: tls.cert
76-
- name: circuitbreaker
77-
securityContext:
78-
privileged: true
79-
capabilities:
80-
add:
81-
- NET_ADMIN
82-
- NET_RAW
83-
image: camillarhi/circuitbreaker:latest
84-
imagePullPolicy: IfNotPresent
85-
args:
86-
- "--network=regtest"
87-
- "--rpcserver=localhost:10009"
88-
- "--tlscertpath=/root/.lnd/tls_copy.cert"
89-
- "--macaroonpath=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon"
90-
- "--httplisten=0.0.0.0:9235"
91-
92-
volumeMounts:
93-
- name: lnd-data
94-
mountPath: /root/.lnd
95-
readinessProbe:
96-
exec:
97-
command:
98-
- /bin/sh
99-
- -c
100-
- |
101-
# Check if tls.cert exists and is readable
102-
test -f /root/.lnd/tls.cert && echo "tls.cert found" || exit 1
103-
# Check if admin.macaroon exists and is readable
104-
test -f /root/.lnd/data/chain/bitcoin/regtest/admin.macaroon && echo "macaroon found" || exit 1
105-
initialDelaySeconds: 10
106-
periodSeconds: 5
107-
timeoutSeconds: 1
78+
{{- with .Values.extraContainers }}
79+
{{- toYaml . | nindent 4 }}
80+
{{- end }}
10881
volumes:
10982
- name: lnd-data
11083
emptyDir: {}

resources/networks/hello/network.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,38 @@ nodes:
3232
target: tank-0004-ln
3333
capacity: 100000
3434
push_amt: 50000
35+
extraContainers:
36+
- name: circuitbreaker
37+
securityContext:
38+
privileged: true
39+
capabilities:
40+
add:
41+
- NET_ADMIN
42+
- NET_RAW
43+
image: camillarhi/circuitbreaker:latest
44+
imagePullPolicy: IfNotPresent
45+
args:
46+
- "--network=regtest"
47+
- "--rpcserver=localhost:10009"
48+
- "--tlscertpath=/root/.lnd/tls_copy.cert"
49+
- "--macaroonpath=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon"
50+
- "--httplisten=0.0.0.0:9235"
51+
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
3567

3668
- name: tank-0004
3769
addnode:

resources/plugins/circuitbreaker/README.md

Lines changed: 0 additions & 151 deletions
This file was deleted.

resources/plugins/circuitbreaker/charts/circuitbreaker/.helmignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

resources/plugins/circuitbreaker/charts/circuitbreaker/Chart.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

resources/plugins/circuitbreaker/charts/circuitbreaker/templates/_helpers.tpl

Lines changed: 0 additions & 7 deletions
This file was deleted.

resources/plugins/circuitbreaker/charts/circuitbreaker/templates/configmap.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

resources/plugins/circuitbreaker/charts/circuitbreaker/templates/pod.yaml

Lines changed: 0 additions & 46 deletions
This file was deleted.

resources/plugins/circuitbreaker/charts/circuitbreaker/templates/service.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)