Skip to content

Commit

Permalink
Merge pull request #75 from amq/sqlproxy-add-probes
Browse files Browse the repository at this point in the history
Add liveness and readiness probe for sqlproxy
  • Loading branch information
rimusz authored Jan 22, 2020
2 parents f5e3663 + 0295836 commit b3aef3b
Show file tree
Hide file tree
Showing 4 changed files with 53 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 @@ -17,4 +17,4 @@ maintainers:
name: gcloud-sqlproxy
sources:
- https://github.com/rimusz/charts
version: 0.19.6
version: 0.19.7
14 changes: 14 additions & 0 deletions stable/gcloud-sqlproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ The following table lists the configurable parameters of the `gcloud-sqlproxy` c
| `networkPolicy.enabled` | Enable NetworkPolicy | `false` |
| `networkPolicy.ingress.from` | List of sources which should be able to access the pods selected for this rule. If empty, allows all sources. | `[]` |
| `extraArgs` | Additional container arguments | `{}` |
| `livenessProbe.enabled` | Would you like a livenessProbe to be enabled | `false` |
| `livenessProbe.port` | The port which will be checked by the probe | 5432 |
| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 30 |
| `livenessProbe.periodSeconds` | How often to perform the probe | 10 |
| `livenessProbe.timeoutSeconds` | When the probe times out | 5 |
| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 |
| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 |
| `readinessProbe.enabled` | would you like a readinessProbe to be enabled | `false` |
| `readinessProbe.port` | The port which will be checked by the probe | 5432 |
| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | 5 |
| `readinessProbe.periodSeconds` | How often to perform the probe | 10 |
| `readinessProbe.timeoutSeconds` | When the probe times out | 5 |
| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 |
| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Expand Down
20 changes: 20 additions & 0 deletions stable/gcloud-sqlproxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,26 @@ spec:
- name: {{ .instanceShortName | default (.instance | trunc 15) }}
containerPort: {{ .port }}
{{- end }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
tcpSocket:
port: {{ .Values.livenessProbe.port }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
tcpSocket:
port: {{ .Values.readinessProbe.port }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }}
volumeMounts:
{{ if $hasCredentials -}}
- name: cloudsql-oauth-credentials
Expand Down
18 changes: 18 additions & 0 deletions stable/gcloud-sqlproxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,24 @@ resources: {}
# memory: 256Mi
# cpu: 256m

livenessProbe:
enabled: false
port: 5432
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1

readinessProbe:
enabled: false
port: 5432
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1

## Configure a HorizontalPodAutoscaler for pod autoscaling.
## Requires that resources requests are set above.
autoscaling:
Expand Down

0 comments on commit b3aef3b

Please sign in to comment.