Skip to content

Commit

Permalink
Event stream deployment. (#10130)
Browse files Browse the repository at this point in the history
* Event stream deployment.

* Rename eventstream to event-stream for deployment.

* Capitalize 'eventStream'

* Fix missed change.
  • Loading branch information
rkachowski authored Jan 31, 2023
1 parent 50a9deb commit 634d6a8
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-event-stream
labels:
{{- include "celo.blockscout.labels" . | nindent 4 }}
component: blockscout-event-stream
annotations:
{{- include "celo.blockscout.annotations" . | nindent 4 }}
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: {{ .Values.blockscout.eventStream.strategy.rollingUpdate.maxSurge }}
maxUnavailable: {{ .Values.blockscout.eventStream.strategy.rollingUpdate.maxUnavailable }}
replicas: {{ .Values.blockscout.eventStream.replicas }}
selector:
matchLabels:
app: blockscout
release: {{ .Release.Name }}
component: blockscout-event-stream
template:
metadata:
{{- if .Values.blockscout.metrics.enabled }}
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "{{ .Values.blockscout.eventStream.port }}"
prometheus.io/scrape: "true"
{{- end }}
labels:
app: blockscout
release: {{ .Release.Name }}
component: blockscout-event-stream
{{- include "celo.blockscout.elixir.labels" . | nindent 8 }}
spec:
serviceAccountName: {{ .Release.Name }}-rbac
terminationGracePeriodSeconds: {{ .Values.blockscout.eventStream.terminationGracePeriodSeconds }}
initContainers:
{{ include "celo.blockscout.initContainer.secrets-init" . | indent 6 }}
containers:
- name: blockscout-event-stream
image: {{ .Values.blockscout.image.repository }}:{{ .Values.blockscout.image.tag }}
imagePullPolicy: {{ .Values.blockscout.image.pullPolicy }}
command:
- /secrets/secrets-init
args:
- --provider
- google
- /bin/sh
- -c
- |
exec mix cmd --app event_stream "elixir --cookie $ERLANG_COOKIE --name {{ .Values.blockscout.erlangNodeName}}@$(POD_IP) -S mix phx.server --no-compile"
volumeMounts:
- mountPath: /secrets
name: temporary-dir
readOnly: true
ports:
- name: health
containerPort: {{ .Values.blockscout.eventStream.port }}
{{- if .Values.blockscout.eventStream.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /health/readiness
port: health
initialDelaySeconds: {{ .Values.blockscout.eventStream.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.blockscout.eventStream.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.blockscout.eventStream.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.blockscout.eventStream.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.blockscout.eventStream.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.blockscout.eventStream.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /health/liveness
port: health
initialDelaySeconds: {{ .Values.blockscout.eventStream.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.blockscout.eventStream.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.blockscout.eventStream.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.blockscout.eventStream.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.blockscout.eventStream.livenessProbe.failureThreshold }}
{{- end }}
resources:
requests:
memory: {{ .Values.blockscout.eventStream.resources.requests.memory }}
cpu: {{ .Values.blockscout.eventStream.resources.requests.cpu }}
env:
- name: METRICS_ENABLED
value: "{{.Values.blockscout.metrics.enabled}}"
- name: ENABLE_EVENT_STREAM
value: {{ .Values.blockscout.eventStream.enableEventStream | quote }}
- name: BEANSTALKD_PORT
value: {{ .Values.blockscout.eventStream.beanstalkdPort | quote }}
- name: BEANSTALKD_HOST
value: {{ .Values.blockscout.eventStream.beanstalkdHost | quote }}
- name: ERLANG_COOKIE
value: {{ .Values.blockscout.secrets.erlang.cookie }}
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: EPMD_SERVICE_NAME
value: {{ .Release.Name }}-epmd-service
volumes:
{{ include "celo.blockscout.volume.temporary-dir" . | indent 8 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ spec:
value: {{ .Values.blockscout.indexer.rpcRegion | quote }}
- name: PRIMARY_REGION
value: {{ .Values.blockscout.indexer.primaryRpcRegion | quote }}
- name: ENABLE_EVENT_STREAM
value: {{ .Values.blockscout.indexer.enableEventStream | quote }}
- name: BEANSTALKD_PORT
value: {{ .Values.blockscout.indexer.beanstalkdPort | quote }}
- name: BEANSTALKD_HOST
value: {{ .Values.blockscout.indexer.beanstalkdHost | quote }}
- name: INDEXER_DISABLE_BLOCK_REWARD_FETCHER
value: {{ not .Values.blockscout.indexer.fetchers.blockRewards.enabled | quote }}
{{ include "celo.blockscout.env-vars" $data | indent 8 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
blockscout:
eventStream:
replicas: 1
indexer:
db:
connectionName: celo-testnet-production:us-west1:rc1staging
Expand Down
31 changes: 28 additions & 3 deletions packages/helm-charts/blockscout/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
ingressClassName: nginx
blockscout:
eventStream:
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
port: 4000
resources:
requests:
memory: 1000Mi
cpu: 2
enableEventStream: false
beanstalkdPort: ""
beanstalkdHost: ""
replicas: 0
readinessProbe:
enabled: false
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 5
livenessProbe:
enabled: false
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 5
indexer:
terminationGracePeriodSeconds: 60
port: 4001
Expand Down Expand Up @@ -57,9 +85,6 @@ blockscout:
cpu: 2
rpcRegion: "indexer"
primaryRpcRegion: "indexer"
enableEventStream: false
beanstalkdPort: ""
beanstalkdHost: ""
fetchers:
blockRewards:
enabled: false
Expand Down

0 comments on commit 634d6a8

Please sign in to comment.