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 9, 2024
1 parent ece2e0b commit f4325c6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
9 changes: 9 additions & 0 deletions chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ 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;failureThreshold | No. of failures the liveness probe will tolerate. | `2` |
| 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. | `20` |
| 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;failureThreshold | No. of failures the readiness probe will tolerate. | `1` |
| 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. | `30` |
| 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
17 changes: 17 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,7 @@ spec:
- "--core-grpc=https://{{ .Release.Name }}-agent-core:50051"
- "--ansi-colors={{ .Values.base.logging.color }}"
- "--fmt-style={{ include "logFormat" . }}"
- "--core-health-freq={{ .Values.apis.rest.healthProbes.readiness.agentCoreProbeFreq }}"
ports:
- containerPort: 8080
- containerPort: 8081
Expand All @@ -63,3 +64,19 @@ spec:
- name: RUST_LOG_SILENCE
value: {{ default .Values.base.logging.silenceLevel .Values.apis.rest.logSilenceLevel }}
{{- end }}
readinessProbe:
httpGet:
path: /ready
port: 8081
initialDelaySeconds: {{ .Values.apis.rest.healthProbes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.apis.rest.healthProbes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.apis.rest.healthProbes.readiness.timeoutSeconds }}
failureThreshold: {{ .Values.apis.rest.healthProbes.readiness.failureThreshold }}
livenessProbe:
httpGet:
path: /live
port: 8081
initialDelaySeconds: {{ .Values.apis.rest.healthProbes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.apis.rest.healthProbes.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.apis.rest.healthProbes.liveness.timeoutSeconds }}
failureThreshold: {{ .Values.apis.rest.healthProbes.liveness.failureThreshold }}
21 changes: 21 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,27 @@ apis:
rest:
# -- Log level for the rest service
logLevel: info
healthProbes:
readiness:
# -- Frequency for the agent-core liveness probe.
agentCoreProbeFreq: "1m"
# -- No. of failures the readiness probe will tolerate.
failureThreshold: 1
# -- No. of seconds of delay before checking the readiness status.
initialDelaySeconds: 0
# -- No. of seconds between readiness probe checks.
periodSeconds: 30
# -- No. of seconds of timeout tolerance.
timeoutSeconds: 5
liveness:
# -- No. of seconds of delay before checking the liveness status.
initialDelaySeconds: 0
# -- No. of failures the liveness probe will tolerate.
failureThreshold: 2
# -- No. of seconds between liveness probe checks.
periodSeconds: 20
# -- No. of seconds of timeout tolerance.
timeoutSeconds: 5
# -- Number of replicas of rest
replicaCount: 1
resources:
Expand Down

0 comments on commit f4325c6

Please sign in to comment.