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

add ether-proxy side container to geth-swap #196

Merged
merged 4 commits into from
Aug 1, 2023
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/geth-swap/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.3.9
version: 0.4.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
12 changes: 12 additions & 0 deletions charts/geth-swap/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,15 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Create image name combining repository and tag or digest.
Digest takes presedance over tag.
*/}}
{{- define "etherProxy.image" -}}
{{- if .Values.etherProxy.image.digest -}}
{{- printf "%s@%s" .Values.etherProxy.image.repository .Values.etherProxy.image.digest -}}
{{- else -}}
{{- printf "%s:%s" .Values.etherProxy.image.repository .Values.etherProxy.image.tag -}}
{{- end -}}
{{- end -}}
17 changes: 17 additions & 0 deletions charts/geth-swap/templates/service-ether-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.etherProxy.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: ether-proxy-{{ include "geth-swap.fullname" . }}
labels:
{{- include "geth-swap.labels" . | nindent 4 }}
spec:
type: {{ .Values.etherProxy.service.type }}
ports:
- port: {{ .Values.etherProxy.service.port }}
targetPort: ether-proxy
protocol: TCP
name: ether-proxy
selector:
{{- include "geth-swap.selectorLabels" . | nindent 4 }}
{{- end -}}
29 changes: 29 additions & 0 deletions charts/geth-swap/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,35 @@ spec:
mountPath: /etc/config
- name: data
mountPath: /root/.ethereum
{{- if .Values.etherProxy.enabled }}
- name: ether-proxy
image: "{{ include "etherProxy.image" . }}"
imagePullPolicy: {{ .Values.etherProxy.image.pullPolicy }}
env:
- name: TARGET
value: {{ .Values.etherProxy.target | quote }}
- name: PORT
value: {{ .Values.etherProxy.service.port | quote }}
- name: EXPIRY
value: {{ .Values.etherProxy.expiry | quote }}
{{- with .Values.etherProxy.envs }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.etherProxy.service.port }}
name: ether-proxy
protocol: TCP
resources:
{{- toYaml .Values.etherProxy.resources | nindent 12 }}
livenessProbe:
httpGet:
path: /health
port: ether-proxy
readinessProbe:
httpGet:
path: /readiness
port: ether-proxy
{{- end }}
volumes:
- name: geth-config
configMap:
Expand Down
40 changes: 29 additions & 11 deletions charts/geth-swap/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,23 @@ ingress:
# hosts:
# - chart-example.local

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
etherProxy:
enabled: false

image:
repository: ethersphere/etherproxy
tag: "1.3.0"
pullPolicy: IfNotPresent
# digest:

service:
type: ClusterIP
port: 9000

target: "http://localhost:8545"
expiry: "2000"

resources: {}

persistence:
## This enables PVC templates that will create one per pod
Expand All @@ -109,6 +115,18 @@ persistence:
## i.e. choosing the default provisioner: gp2 on AWS, standard on GKE, AWS & OpenStack, etc.
# storageClass: "-"

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

tolerations: []
Expand Down
Loading