Skip to content

Commit

Permalink
feat(chart): add health probes to api-rest
Browse files Browse the repository at this point in the history
Signed-off-by: Niladri Halder <[email protected]>
  • Loading branch information
niladrih committed Dec 10, 2024
1 parent ece2e0b commit 1e28ff3
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
11 changes: 11 additions & 0 deletions chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ This removes all the Kubernetes components associated with the chart and deletes
| agents.&ZeroWidthSpace;ha.&ZeroWidthSpace;node.&ZeroWidthSpace;resources.&ZeroWidthSpace;requests.&ZeroWidthSpace;cpu | Cpu requests for ha node agent | `"100m"` |
| agents.&ZeroWidthSpace;ha.&ZeroWidthSpace;node.&ZeroWidthSpace;resources.&ZeroWidthSpace;requests.&ZeroWidthSpace;memory | Memory requests for ha node agent | `"64Mi"` |
| agents.&ZeroWidthSpace;ha.&ZeroWidthSpace;node.&ZeroWidthSpace;tolerations | Set tolerations, overrides global | `[]` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;liveness.&ZeroWidthSpace;enabled | Toggle liveness probe. | `true` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;liveness.&ZeroWidthSpace;failureThreshold | No. of failures the liveness probe will tolerate. | `1` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;liveness.&ZeroWidthSpace;initialDelaySeconds | No. of seconds of delay before checking the liveness status. | `0` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;liveness.&ZeroWidthSpace;periodSeconds | No. of seconds between liveness probe checks. | `30` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;liveness.&ZeroWidthSpace;timeoutSeconds | No. of seconds of timeout tolerance. | `5` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;readiness.&ZeroWidthSpace;agentCoreProbeFreq | Frequency for the agent-core liveness probe. | `"1m"` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;readiness.&ZeroWidthSpace;enabled | Toggle readiness probe. | `true` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;readiness.&ZeroWidthSpace;failureThreshold | No. of failures the readiness probe will tolerate. | `2` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;readiness.&ZeroWidthSpace;initialDelaySeconds | No. of seconds of delay before checking the readiness status. | `0` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;readiness.&ZeroWidthSpace;periodSeconds | No. of seconds between readiness probe checks. | `20` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;healthProbes.&ZeroWidthSpace;readiness.&ZeroWidthSpace;timeoutSeconds | No. of seconds of timeout tolerance. | `5` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;logLevel | Log level for the rest service | `"info"` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;priorityClassName | Set PriorityClass, overrides global. If both local and global are not set, the final deployment manifest has a mayastor custom critical priority class assigned to the pod by default. Refer the `templates/_helpers.tpl` and `templates/mayastor/apis/rest/api-rest-deployment.yaml` for more details. | `""` |
| apis.&ZeroWidthSpace;rest.&ZeroWidthSpace;replicaCount | Number of replicas of rest | `1` |
Expand Down
23 changes: 23 additions & 0 deletions chart/templates/mayastor/apis/api-rest-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ spec:
- "--core-grpc=https://{{ .Release.Name }}-agent-core:50051"
- "--ansi-colors={{ .Values.base.logging.color }}"
- "--fmt-style={{ include "logFormat" . }}"
{{- if .Values.apis.rest.healthProbes.readiness.enabled }}
- "--core-health-freq={{ .Values.apis.rest.healthProbes.readiness.agentCoreProbeFreq }}"
{{- end }}
ports:
- containerPort: 8080
- containerPort: 8081
Expand All @@ -63,3 +66,23 @@ spec:
- name: RUST_LOG_SILENCE
value: {{ default .Values.base.logging.silenceLevel .Values.apis.rest.logSilenceLevel }}
{{- end }}
{{- if .Values.apis.rest.healthProbes.readiness.enabled }}
readinessProbe:
httpGet:
path: /ready
port: 8081
failureThreshold: {{ .Values.apis.rest.healthProbes.readiness.failureThreshold }}
initialDelaySeconds: {{ .Values.apis.rest.healthProbes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.apis.rest.healthProbes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.apis.rest.healthProbes.readiness.timeoutSeconds }}
{{- end }}
{{- if .Values.apis.rest.healthProbes.liveness.enabled }}
livenessProbe:
httpGet:
path: /live
port: 8081
failureThreshold: {{ .Values.apis.rest.healthProbes.liveness.failureThreshold }}
initialDelaySeconds: {{ .Values.apis.rest.healthProbes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.apis.rest.healthProbes.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.apis.rest.healthProbes.liveness.timeoutSeconds }}
{{- end }}
25 changes: 25 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,31 @@ apis:
rest:
# -- Log level for the rest service
logLevel: info
healthProbes:
readiness:
# -- Toggle readiness probe.
enabled: true
# -- Frequency for the agent-core liveness probe.
agentCoreProbeFreq: "20s"
# -- No. of failures the readiness probe will tolerate.
failureThreshold: 2
# -- No. of seconds of delay before checking the readiness status.
initialDelaySeconds: 0
# -- No. of seconds between readiness probe checks.
periodSeconds: 20
# -- No. of seconds of timeout tolerance.
timeoutSeconds: 5
liveness:
# -- Toggle liveness probe.
enabled: true
# -- No. of failures the liveness probe will tolerate.
failureThreshold: 1
# -- No. of seconds of delay before checking the liveness status.
initialDelaySeconds: 0
# -- No. of seconds between liveness probe checks.
periodSeconds: 30
# -- No. of seconds of timeout tolerance.
timeoutSeconds: 5
# -- Number of replicas of rest
replicaCount: 1
resources:
Expand Down

0 comments on commit 1e28ff3

Please sign in to comment.