Skip to content

Commit

Permalink
Merge pull request #58 from 1Password/mcmarkj-add-connect-liveness
Browse files Browse the repository at this point in the history
Add connect liveness
  • Loading branch information
jpcoenen authored Jun 22, 2021
2 parents 5f2240a + a9a650e commit c292a06
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ $ helm install --set connect.applicationName=connect connect ./connect
| connect.dataVolume.values | object | `{}` | Desribes the fields and values for configuration of shared volume for 1Password Connect |
| connect.imagePullPolicy | string | `"IfNotPresent` | The 1Password Connect API image pull policy |
| connect.nodeSelector | object | `{}` | [Node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) stanza for the Connect pod |
| connect.probes.readiness | boolean | `true` | Denotes whether the 1Password Connect API readiness probe will operate and ensure the pod is ready before serving traffic |
| connect.probes.liveness | boolean | `true` | Denotes whether the 1Password Connect API will be continually checked by Kubernetes for liveness and restarted if the pod becomes unresponsive |
| connect.annotations | object | `{}` | Additional annotations to be added to the Connect API deployment resource. |
| connect.labels | object | `{}` | Additional labels to be added to the Connect API deployment resource. |
| connect.podAnnotations | object | `{}` | Additional annotations to be added to the Connect API pods. |
Expand Down
8 changes: 8 additions & 0 deletions charts/connect/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- range $k, $v := . -}}{{- if not $local.first -}},{{- end -}}{{- $v -}}{{- $_ := set $local "first" false -}}{{- end -}}
{{- end -}}

{{- define "onepassword-connect.apiPort" -}}
{{- if .Values.connect.tls.enabled -}}
{{ .Values.connect.api.httpsPort }}
{{- else -}}
{{ .Values.connect.api.httpPort }}
{{- end }}
{{- end }}

{{- define "onepassword-connect.url" -}}
{{- if .Values.connect.tls.enabled -}}
https://{{ .Values.connect.applicationName }}:{{ .Values.connect.api.httpsPort }}
Expand Down
35 changes: 35 additions & 0 deletions charts/connect/templates/connect-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,24 @@ spec:
- name: OP_HTTP_PORT
value: "{{ .Values.connect.api.httpPort }}"
{{- end }}
{{- if .Values.connect.probes.readiness }}
readinessProbe:
httpGet:
path: /health
scheme: {{ if .Values.connect.tls.enabled }}HTTPS{{ else }}HTTP{{end}}
port: {{ include "onepassword-connect.apiPort" . }}
initialDelaySeconds: 15
{{ end }}
{{- if .Values.connect.probes.liveness }}
livenessProbe:
httpGet:
path: /heartbeat
scheme: {{ if .Values.connect.tls.enabled }}HTTPS{{ else }}HTTP{{end}}
port: {{ include "onepassword-connect.apiPort" . }}
failureThreshold: 3
periodSeconds: 30
initialDelaySeconds: 15
{{ end }}
volumeMounts:
- mountPath: /home/opuser/.op/data
name: {{ .Values.connect.dataVolume.name }}
Expand Down Expand Up @@ -116,6 +134,23 @@ spec:
secretKeyRef:
name: {{ .Values.connect.credentialsName }}
key: {{ .Values.connect.credentialsKey }}
{{- if .Values.connect.probes.readiness }}
readinessProbe:
httpGet:
path: /health
port: {{ .Values.connect.sync.httpPort }}
initialDelaySeconds: 15
{{ end }}
{{- if .Values.connect.probes.liveness }}
livenessProbe:
httpGet:
path: /heartbeat
port: {{ .Values.connect.sync.httpPort }}
scheme: HTTP
failureThreshold: 3
periodSeconds: 30
initialDelaySeconds: 15
{{ end }}
volumeMounts:
- mountPath: /home/opuser/.op/data
name: {{ .Values.connect.dataVolume.name }}
3 changes: 3 additions & 0 deletions charts/connect/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ connect:
imagePullPolicy: IfNotPresent
version: "{{ .Chart.AppVersion }}"
nodeSelector: {}
probes:
liveness: true
readiness: true
annotations: {}
labels: {}
podAnnotations: {}
Expand Down

0 comments on commit c292a06

Please sign in to comment.