Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: core service ready/liveness probes to be configurable #1855

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,20 @@ app: "{{ template "harbor.name" . }}"
{{- end -}}
{{- end -}}

{{- define "harbor.core.probe.httpGet" -}}
httpGet:
path: /api/v2.0/ping
port: {{ template "harbor.core.containerPort" . }}
scheme: {{ include "harbor.component.scheme" . | upper }}
{{- end -}}

{{- define "harbor.core.probe" -}}
failureThreshold: {{ .probe.failureThreshold }}
periodSeconds: {{ .probe.periodSeconds }}
timeoutSeconds: {{ .probe.timeoutSeconds }}
{{ include "harbor.core.probe.httpGet" .Values }}
{{- end -}}

{{/* core component container port */}}
{{- define "harbor.core.containerPort" -}}
{{- if .Values.internalTLS.enabled -}}
Expand Down
19 changes: 3 additions & 16 deletions templates/core/core-dpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,15 @@ spec:
imagePullPolicy: {{ .Values.imagePullPolicy }}
{{- if .Values.core.startupProbe.enabled }}
startupProbe:
httpGet:
path: /api/v2.0/ping
scheme: {{ include "harbor.component.scheme" . | upper }}
port: {{ template "harbor.core.containerPort" . }}
failureThreshold: 360
initialDelaySeconds: {{ .Values.core.startupProbe.initialDelaySeconds }}
periodSeconds: 10
{{- include "harbor.core.probe.httpGet" . | nindent 10 }}
{{- end }}
livenessProbe:
httpGet:
path: /api/v2.0/ping
scheme: {{ include "harbor.component.scheme" . | upper }}
port: {{ template "harbor.core.containerPort" . }}
failureThreshold: 2
periodSeconds: 10
{{- include "harbor.core.probe" (dict "probe" .Values.core.livenessProbe) | nindent 10 }}
readinessProbe:
httpGet:
path: /api/v2.0/ping
scheme: {{ include "harbor.component.scheme" . | upper }}
port: {{ template "harbor.core.containerPort" . }}
failureThreshold: 2
periodSeconds: 10
{{- include "harbor.core.probe" (dict "probe" .Values.core.readinessProbe) | nindent 10 }}
envFrom:
- configMapRef:
name: "{{ template "harbor.core" . }}"
Expand Down
10 changes: 10 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,16 @@ core:
startupProbe:
enabled: true
initialDelaySeconds: 10
## Readiness probe values
readinessProbe:
failureThreshold: 2
periodSeconds: 10
timeoutSeconds: 1
## Liveness probe values
livenessProbe:
failureThreshold: 2
periodSeconds: 10
timeoutSeconds: 1
# resources:
# requests:
# memory: 256Mi
Expand Down