Skip to content

Commit

Permalink
Make debug API optional; defaults to false (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Svetomir Smiljkovic authored Apr 5, 2020
1 parent 242b468 commit 8193391
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/bee/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
appVersion: latest
name: bee
version: 0.2.1
version: 0.2.2
description: Ethereum Swarm Bee Helm chart for Kubernetes
home: https://swarm.ethereum.org
icon: https://swarm-guide.readthedocs.io/en/latest/_images/swarm.png
Expand Down
2 changes: 1 addition & 1 deletion charts/bee/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ apps:
namespace: bee
description: "Ethereum Swarm Bee"
chart: "ethersphere/bee"
version: "0.2.1"
version: "0.2.2"
enabled: true
set:
replicaCount: 2
Expand Down
4 changes: 2 additions & 2 deletions charts/bee/templates/ingress-debug.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.ingressDebug.enabled -}}
{{- if and .Values.beeConfig.enable_debug_api .Values.ingressDebug.enabled -}}

{{- $root := . -}}
{{- $fullName := include "bee.fullname" $root -}}
Expand Down Expand Up @@ -53,4 +53,4 @@ spec:
{{- end }}
{{- end }}

{{- end }}
{{- end -}}
3 changes: 3 additions & 0 deletions charts/bee/templates/service-debug.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if .Values.beeConfig.enable_debug_api -}}

{{- $root := . -}}

{{- range $i, $e := until (int $root.Values.replicaCount) }}
Expand All @@ -23,3 +25,4 @@ spec:
statefulset.kubernetes.io/pod-name: {{ include "bee.fullname" $root }}-{{ $i }}

{{- end }}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/bee/templates/service-headless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ spec:
port: {{ int (split ":" .Values.beeConfig.p2p_addr )._1 }}
protocol: TCP
targetPort: p2p
{{- if .Values.beeConfig.enable_debug_api }}
- name: debug
port: {{ int (split ":" .Values.beeConfig.debug_api_addr )._1 }}
protocol: TCP
targetPort: debug
{{- end }}
selector:
{{- include "bee.selectorLabels" . | nindent 4 }}
type: {{ .Values.service.type }}
11 changes: 11 additions & 0 deletions charts/bee/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ spec:
- containerPort: {{ int (split ":" .Values.beeConfig.p2p_addr )._1 }}
name: p2p
protocol: TCP
{{- if .Values.beeConfig.enable_debug_api }}
- containerPort: {{ int (split ":" .Values.beeConfig.debug_api_addr )._1 }}
name: debug
protocol: TCP
Expand All @@ -65,6 +66,16 @@ spec:
httpGet:
path: /readiness
port: debug
{{- else }}
livenessProbe:
httpGet:
path: /
port: api
readinessProbe:
httpGet:
path: /
port: api
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
securityContext:
Expand Down
2 changes: 1 addition & 1 deletion charts/bee/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ beeConfig:
## debug HTTP API listen address
debug_api_addr: :6060
## enable debug HTTP API
enable_debug_api: true
enable_debug_api: false
## ID of the Swarm network
network_id: 1
## password for decrypting keys (please change it for production deployments)
Expand Down

0 comments on commit 8193391

Please sign in to comment.