Skip to content

Commit

Permalink
feat: volume protection from space exhaustion (#3988)
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-inf authored and ldming committed Nov 21, 2023
1 parent 18e2ab9 commit 488436a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
33 changes: 33 additions & 0 deletions helm/crds/apps.kubeblocks.io_clusterdefinitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9176,6 +9176,39 @@ spec:
- cmdExecutorConfig
- passwordConfig
type: object
volumeProtectionSpec:
properties:
highWatermark:
default: 90
description: The high watermark threshold for volume space
usage. If there is any specified volumes who's space usage
is over the threshold, the pre-defined "LOCK" action will
be triggered to degrade the service to protect volume
from space exhaustion, such as to set the instance as
read-only. And after that, if all volumes' space usage
drops under the threshold later, the pre-defined "UNLOCK"
action will be performed to recover the service normally.
maximum: 100
minimum: 0
type: integer
volumes:
description: Volumes to protect.
items:
properties:
highWatermark:
description: Volume specified high watermark threshold,
it will override the component level threshold.
If the value is invalid, it will be ignored and
the component level threshold will be used.
maximum: 100
minimum: 0
type: integer
name:
description: Name of volume to protect.
type: string
type: object
type: array
type: object
volumeTypes:
description: "volumeTypes is used to describe the purpose of
the volumes mapping the name of the VolumeMounts in the PodSpec.Container
Expand Down
8 changes: 8 additions & 0 deletions helm/templates/rbac/cluster_pod_required_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ rules:
- patch
- update
- delete
- apiGroups:
- ""
resources:
- nodes
- nodes/stats
verbs:
- get
- list
- apiGroups:
- apps.kubeblocks.io
resources:
Expand Down

0 comments on commit 488436a

Please sign in to comment.