Skip to content

Commit

Permalink
Merge pull request #62 from EricTendian/lifecycle-hooks
Browse files Browse the repository at this point in the history
Allowing setting of lifecycle hooks on gcloud-sqlproxy to improve reliability with autoscaling
  • Loading branch information
rimusz authored Oct 24, 2019
2 parents c0c7f62 + 32792f2 commit 303bf3a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/gcloud-sqlproxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ maintainers:
name: gcloud-sqlproxy
sources:
- https://github.com/rimusz/charts
version: 0.17.0
version: 0.18.0
1 change: 1 addition & 0 deletions stable/gcloud-sqlproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The following table lists the configurable parameters of the `gcloud-sqlproxy` c
| `serviceAccountName` | specify a service account name to use | `""` |
| `cloudsql.instances` | List of PostgreSQL/MySQL instances | [{instance: `instance`, project: `project`, region: `region`, port: 5432}] must be provided |
| `resources` | CPU/Memory resource requests/limits | Memory: `100/150Mi`, CPU: `100/150m` |
| `lifecycleHooks` | Container lifecycle hooks | `{}` |
| `autoscaling.enabled` | Enable CPU/Memory horizontal pod autoscaler | `false` |
| `autoscaling.minReplicas` | Autoscaler minimum pod replica count | `1` |
| `autoscaling.maxReplicas` | Autoscaler maximum pod replica count | `3` |
Expand Down
4 changes: 4 additions & 0 deletions stable/gcloud-sqlproxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ spec:
{{ end -}}
{{- range $key, $value := .Values.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- if .Values.lifecycleHooks }}
lifecycle:
{{ toYaml .Values.lifecycleHooks | indent 10 }}
{{- end }}
ports:
{{- range .Values.cloudsql.instances }}
Expand Down
8 changes: 8 additions & 0 deletions stable/gcloud-sqlproxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ tolerations: []
## Affinity
affinity: {}

## Lifecycle hooks
## This can be helpful for gracefully terminating the proxy, when used in combination with the -term_timeout=10s extra arg
## NOTE: Your Docker image must have a shell for the preStop command to work, the default Docker image does not have one
lifecycleHooks: {}
# preStop:
# exec:
# command: ['sleep', '10']

## Configure the PodDisruptionBudget
podDisruptionBudget: |
maxUnavailable: 1
Expand Down

0 comments on commit 303bf3a

Please sign in to comment.