Skip to content

Commit

Permalink
Merge pull request #279 from MinaFoundation/PM-2004-enable-lifecyle-o…
Browse files Browse the repository at this point in the history
…n-deployments

PM-2004 - Enable Lifecyle for on-chain-voting
  • Loading branch information
kaozenn authored Sep 24, 2024
2 parents df2d7d0 + bc95315 commit 0e95797
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions on-chain-voting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ helmfile status
| server.image.repository | string | `"673156464838.dkr.ecr.us-west-2.amazonaws.com/on-chain-voting-server"` | The image repository |
| server.image.tag | string | `"0.1.0"` | Overrides the image tag whose default is the chart appVersion. |
| server.ledgersBucket | string | `"673156464838-mina-staking-ledgers"` | Stacking ledgers S3 bucket |
| server.lifecycle | object | `{"preStop":{"exec":{"command":["sh","-c","sleep 15 && kill -SIGQUIT 1"]}}}` | Lifecycle hooks |
| server.network | string | `"mainnet"` | Mina Network |
| server.nodeSelector | object | `{}` | Node Selector |
| server.podAnnotations | object | `{}` | Annotations to add to the pods |
Expand Down Expand Up @@ -97,6 +98,7 @@ helmfile status
| web.ingress.enabled | bool | `false` | Whether to create an Ingress |
| web.ingress.hosts | list | `[]` | The Ingress Hosts |
| web.ingress.tls | list | `[]` | The TLS configuration |
| web.lifecycle | object | `{"preStop":{"exec":{"command":["sh","-c","sleep 15 && kill -SIGQUIT 1"]}}}` | Lifecycle hooks |
| web.nextPublicApiBaseURL | string | `""` | Next Public API base URL |
| web.nextPublicReleaseStage | string | `"production"` | Next Public Release Stage |
| web.nodeSelector | object | `{}` | Node Selector |
Expand Down
4 changes: 4 additions & 0 deletions on-chain-voting/templates/deployment-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ spec:
{{- toYaml .Values.server.securityContext | nindent 12 }}
image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.server.image.pullPolicy }}
{{- with .Values.server.lifecycle }}
lifecycle:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- if .Values.server.postgresConnectionString }}
- name: DATABASE_URL
Expand Down
4 changes: 4 additions & 0 deletions on-chain-voting/templates/deployment-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ spec:
{{- toYaml .Values.web.securityContext | nindent 12 }}
image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.web.image.pullPolicy }}
{{- with .Values.web.lifecycle }}
lifecycle:
{{- toYaml . | nindent 12 }}
{{- end }}
env:
- name: API_BASE_URL
value: {{ .Values.web.apiBaseURL | default (printf "http://%s-server:8080" .Release.Name) | quote }}
Expand Down
18 changes: 18 additions & 0 deletions on-chain-voting/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ web:
# -- Affinity
affinity: {}

# -- Lifecycle hooks
lifecycle:
preStop:
exec:
command:
- sh
- -c
- sleep 15 && kill -SIGQUIT 1

server:
# -- The number of replicas
replicaCount: 1
Expand Down Expand Up @@ -210,6 +219,15 @@ server:
# -- Affinity
affinity: {}

# -- Lifecycle hooks
lifecycle:
preStop:
exec:
command:
- sh
- -c
- sleep 15 && kill -SIGQUIT 1

postgresql:
# -- Whether to deploy a PostgreSQL server to satisfy the application database requirements
create: true
Expand Down

0 comments on commit 0e95797

Please sign in to comment.