Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements for dshackle chart #1

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/dshackle/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ icon: https://avatars.githubusercontent.com/u/49622339?s=200&v=4
sources:
- https://github.com/emeraldpay/dshackle
type: application
version: 0.1.7
version: 0.1.8
maintainers:
- name: skylenet
email: [email protected]
Expand Down
7 changes: 7 additions & 0 deletions charts/dshackle/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
HTTP port
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTTPS?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also change to HTTPS, but throughout this chart http is used to label that specific traffic

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http here represents internal port which is not HTTPS, internally they communicate over HTTP on port 8545

*/}}
{{- define "dshackle.httpPort" -}}
{{- default 443 .Values.externalHttpPort }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/dshackle/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "dshackle.fullname" . -}}
{{- $svcPort := .Values.httpPort -}}
{{- $svcPort := .Values.externalHttpPort -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
Expand Down
4 changes: 2 additions & 2 deletions charts/dshackle/templates/service-headless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ metadata:
spec:
clusterIP: None
ports:
- port: {{ .Values.httpPort }}
targetPort: http
- port: {{ .Values.externalHttpPort }}
targetPort: {{ .Values.internalHttpPort }}
protocol: TCP
name: http
- port: {{ .Values.gRPCPort }}
Expand Down
6 changes: 4 additions & 2 deletions charts/dshackle/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ metadata:
name: {{ include "dshackle.fullname" . }}
labels:
{{- include "dshackle.labels" . | nindent 4 }}
annotations:
{{ toYaml .Values.service.annotations | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.httpPort }}
targetPort: http
- port: {{ .Values.externalHttpPort }}
targetPort: {{ .Values.internalHttpPort }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cristidas I think if we plan to open PR to back-merge it we should make as less changes as possible. I would suggest to introduce externalHttpPort but keep using httpPort as internal one

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OleksandrUA it wouldn't be all these changes in a PR, and I've already opened one only for the changes related to service.type: LoadBalancer. We'll see after that if we'll need to refactor the changes for the ports and create a PR to upstream

protocol: TCP
name: http
- port: {{ .Values.gRPCPort }}
Expand Down
2 changes: 1 addition & 1 deletion charts/dshackle/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ spec:
readOnly: true
ports:
- name: http
containerPort: {{ .Values.httpPort }}
containerPort: {{ .Values.internalHttpPort }}
protocol: TCP
- name: grpc
containerPort: {{ .Values.gRPCPort }}
Expand Down
10 changes: 7 additions & 3 deletions charts/dshackle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ config: |

proxy:
host: 0.0.0.0
port: {{ .Values.httpPort }}
port: {{ .Values.internalHttpPort }}
routes:
- id: eth
blockchain: ethereum
Expand Down Expand Up @@ -109,9 +109,13 @@ annotations: {}
# @default -- See `values.yaml`
gRPCPort: 2449

# -- HTTP Port
# -- External HTTP Port, where the service is exposed
# @default -- See `values.yaml`
httpPort: 8545
externalHttpPort: 443

# -- Internal HTTP Port, where pod and application running in the container are listening
# @default -- See `values.yaml`
internalHttpPort: 8545

# -- Metrics Port
# @default -- See `values.yaml`
Expand Down
Loading