Skip to content

Commit

Permalink
chore(bors): merge pull request #581
Browse files Browse the repository at this point in the history
581: feat(chart): add health probes to api-rest r=niladrih a=niladrih



Co-authored-by: Niladri Halder <[email protected]>
  • Loading branch information
mayastor-bors and niladrih committed Dec 10, 2024
2 parents ece2e0b + 1991d38 commit 915181c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
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. | `"20s"` |
| 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
2 changes: 1 addition & 1 deletion dependencies/control-plane
Submodule control-plane updated 52 files
+4 −1 control-plane/agents/src/bin/core/tests/event/mod.rs
+5 −1 control-plane/agents/src/bin/core/tests/pool/mod.rs
+5 −1 control-plane/agents/src/bin/core/tests/volume/garbage_collection.rs
+29 −11 control-plane/agents/src/bin/core/tests/volume/mod.rs
+1 −1 control-plane/agents/src/bin/core/tests/volume/snapshot.rs
+20 −0 control-plane/agents/src/bin/core/volume/operations.rs
+3 −1 control-plane/csi-driver/src/bin/controller/client.rs
+53 −59 control-plane/csi-driver/src/bin/controller/controller.rs
+7 −72 control-plane/csi-driver/src/bin/controller/server.rs
+3 −3 control-plane/csi-driver/src/bin/node/block_vol.rs
+1 −1 control-plane/csi-driver/src/bin/node/dev.rs
+97 −34 control-plane/csi-driver/src/bin/node/dev/nvmf.rs
+8 −8 control-plane/csi-driver/src/bin/node/filesystem_ops.rs
+14 −12 control-plane/csi-driver/src/bin/node/filesystem_vol.rs
+1 −0 control-plane/csi-driver/src/bin/node/main.rs
+4 −66 control-plane/csi-driver/src/bin/node/main_.rs
+11 −0 control-plane/csi-driver/src/bin/node/match_dev.rs
+162 −116 control-plane/csi-driver/src/bin/node/mount.rs
+46 −35 control-plane/csi-driver/src/bin/node/node.rs
+48 −0 control-plane/csi-driver/src/bin/node/runtime.rs
+2 −0 control-plane/csi-driver/src/lib.rs
+51 −0 control-plane/csi-driver/src/trace.rs
+2 −0 control-plane/grpc/proto/v1/volume/volume.proto
+12 −1 control-plane/grpc/src/operations/volume/traits.rs
+1 −0 control-plane/rest/Cargo.toml
+7 −0 control-plane/rest/openapi-specs/v0_api_spec.yaml
+54 −0 control-plane/rest/service/src/health/core_state.rs
+28 −0 control-plane/rest/service/src/health/handlers.rs
+4 −0 control-plane/rest/service/src/health/mod.rs
+28 −9 control-plane/rest/service/src/main.rs
+6 −2 control-plane/rest/service/src/v0/volumes.rs
+83 −2 control-plane/rest/tests/v0_test.rs
+4 −1 control-plane/stor-port/src/types/v0/transport/volume.rs
+4 −0 deployer/src/infra/rest.rs
+4 −0 deployer/src/lib.rs
+6 −1 scripts/python/test-residue-cleanup.sh
+0 −1 scripts/python/test.sh
+1 −1 scripts/rust/linter.sh
+1 −1 shell.nix
+18 −2 tests/bdd/README.md
+12 −0 tests/bdd/common/deployer.py
+6 −0 tests/bdd/common/docker.py
+18 −4 tests/bdd/common/nvme.py
+7 −1 tests/bdd/features/csi/controller/controller.feature
+38 −0 tests/bdd/features/csi/controller/test_controller.py
+13 −0 tests/bdd/features/csi/node/node.feature
+110 −7 tests/bdd/features/csi/node/test_node.py
+12 −0 tests/bdd/features/health_probes/readiness_probe.feature
+118 −0 tests/bdd/features/health_probes/test_readiness_probe.py
+5 −1 tests/io-engine/tests/rebuild.rs
+1 −1 utils/dependencies
+1 −1 utils/pstor-usage/src/volumes.rs

0 comments on commit 915181c

Please sign in to comment.