Skip to content

Commit 4ba91d4

Browse files
authored
bee: add wss and autotls support (#227)
1 parent 38833e8 commit 4ba91d4

3 files changed

Lines changed: 25 additions & 5 deletions

File tree

‎charts/bee/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
appVersion: 2.5.0
33
name: bee
4-
version: 0.16.9
4+
version: 0.16.10
55
kubeVersion: ">=1.19.0-0"
66
description: Ethereum Swarm Bee Helm chart for Kubernetes
77
home: https://www.ethswarm.org

‎charts/bee/templates/statefulset.yaml‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ spec:
9797
- name: bee-swarm
9898
mountPath: /tmp/bee
9999
{{- end }}
100-
{{- if .Values.p2pFixedPort.enabled }}
100+
{{- if or .Values.p2pFixedPort.enabled .Values.p2pWssFixedPort.enabled }}
101101
- name: init-natport
102102
image: ethersphere/busybox:1.36
103103
securityContext:
@@ -107,11 +107,18 @@ spec:
107107
- sh
108108
- -c
109109
- >
110-
PUBLIC_IP=$(wget -T 2 {{ .Values.p2pFixedPort.publicIpUrl }} -q -O -);
110+
if ! [ -f /home/bee/.bee.yaml ]; then cp -p /tmp/.bee.yaml /home/bee/.bee.yaml; fi;
111111
export INDEX=$(echo $(hostname) | rev | cut -d'-' -f 1 | rev);
112+
{{- if .Values.p2pFixedPort.enabled }}
113+
PUBLIC_IP=$(wget -T 10 {{ .Values.p2pFixedPort.publicIpUrl }} -q -O -);
112114
NAT_PORT=$(( {{ .Values.p2pFixedPort.nodePortStart }} + INDEX ));
113-
cp -p /tmp/.bee.yaml /home/bee/.bee.yaml;
114115
printf 'nat-addr: %s:%s\n' "${PUBLIC_IP}" "${NAT_PORT}" >> /home/bee/.bee.yaml;
116+
{{- end }}
117+
{{- if .Values.p2pWssFixedPort.enabled }}
118+
PUBLIC_IP=$(wget -T 10 {{ .Values.p2pWssFixedPort.publicIpUrl }} -q -O -);
119+
NAT_PORT=$(( {{ .Values.p2pWssFixedPort.nodePortStart }} + INDEX ));
120+
printf 'nat-wss-addr: %s:%s\n' "${PUBLIC_IP}" "${NAT_PORT}" >> /home/bee/.bee.yaml;
121+
{{- end }}
115122
echo 'node initialization done';
116123
volumeMounts:
117124
- name: config-file
@@ -207,7 +214,7 @@ spec:
207214
securityContext:
208215
{{- toYaml .Values.securityContext | nindent 12 }}
209216
volumeMounts:
210-
{{- if or .Values.p2pFixedPort.enabled .Values.autoNeighborhood.enabled }}
217+
{{- if or .Values.p2pFixedPort.enabled .Values.p2pWssFixedPort.enabled .Values.autoNeighborhood.enabled }}
211218
- name: config-file
212219
mountPath: /home/bee
213220
{{- else }}

‎charts/bee/values.yaml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,19 @@ beeConfig:
197197
full-node: true
198198
## ID of the Swarm network - 10 by default
199199
network-id: 1
200+
autotls-enabled: true
201+
p2p-wss-port: "1635"
202+
203+
## If enabled, for NodePort (p2p-wss service)
204+
## the Kubernetes control plane will allocate a port from a range (default: 30000-32767)
205+
## You can enable and specify start value and NodePort will be $nodePortStart + $ordinal
206+
## If wanted port if used by some other service deploy will fail
207+
## By default AWS internal endpoint will be used to discover public IP
208+
## You can specify public services as icanhazip.com etc.
209+
p2pWssFixedPort:
210+
enabled: false
211+
nodePortStart: 31001
212+
publicIpUrl: http://ifconfig.me/ip
200213

201214
## Password for decrypting bee keys (please set it for production deployments)
202215
## If not set, it will be automatically generated

0 commit comments

Comments
 (0)