Skip to content

Commit

Permalink
Merge pull request #106 from Ontotext-AD/GDB-10049-pvc-retention
Browse files Browse the repository at this point in the history
GDB-10049: Added configurations for persistentVolumeClaimRetentionPolicy
  • Loading branch information
mihailradkov committed Jul 5, 2024
2 parents edc1284 + 9df4ec5 commit 48e376a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- Added `job.priorityClassName` for defining the pods scheduling importance
- Added `job.nodeSelector`, `job.affinity`, `job.tolerations` and `job.topologySpreadConstraints` for customizing the
node scheduling
- Added `persistence.volumeClaimRetentionPolicy` and `proxy.persistence.volumeClaimRetentionPolicy` to control the
retention policy of the PVCs when the StatefulSets are scaled and deleted. These configurations are used only for
Kubernetes 1.27 and above.

## Version 11.0.1

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ IMPORTANT: This is generated by helm-docs, do not attempt modifying it on hand a
| nodeSelector | object | `{}` | |
| persistence.emptyDir.sizeLimit | string | `"1Gi"` | |
| persistence.enabled | bool | `true` | |
| persistence.volumeClaimRetentionPolicy | object | `{}` | |
| persistence.volumeClaimTemplate.annotations | object | `{}` | |
| persistence.volumeClaimTemplate.labels | object | `{}` | |
| persistence.volumeClaimTemplate.name | string | `"storage"` | |
Expand Down Expand Up @@ -511,6 +512,7 @@ IMPORTANT: This is generated by helm-docs, do not attempt modifying it on hand a
| proxy.nodeSelector | object | `{}` | |
| proxy.persistence.emptyDir.sizeLimit | string | `"500Mi"` | |
| proxy.persistence.enabled | bool | `true` | |
| proxy.persistence.volumeClaimRetentionPolicy | object | `{}` | |
| proxy.persistence.volumeClaimTemplate.annotations | object | `{}` | |
| proxy.persistence.volumeClaimTemplate.labels | object | `{}` | |
| proxy.persistence.volumeClaimTemplate.name | string | `"storage"` | |
Expand Down
3 changes: 3 additions & 0 deletions templates/graphdb/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spec:
updateStrategy: {{ .Values.updateStrategy | toYaml | nindent 4 }}
podManagementPolicy: {{ .Values.podManagementPolicy }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
{{- if and .Values.persistence.volumeClaimRetentionPolicy (semverCompare ">=1.27-0" .Capabilities.KubeVersion.Version) }}
persistentVolumeClaimRetentionPolicy: {{ .Values.persistence.volumeClaimRetentionPolicy | toYaml | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "graphdb.selectorLabels" . | nindent 6 }}
Expand Down
3 changes: 3 additions & 0 deletions templates/proxy/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
updateStrategy: {{ .Values.proxy.updateStrategy | toYaml | nindent 4 }}
podManagementPolicy: {{ .Values.proxy.podManagementPolicy }}
revisionHistoryLimit: {{ .Values.proxy.revisionHistoryLimit }}
{{- if and .Values.proxy.persistence.volumeClaimRetentionPolicy (semverCompare ">=1.27-0" .Capabilities.KubeVersion.Version) }}
persistentVolumeClaimRetentionPolicy: {{ .Values.proxy.persistence.volumeClaimRetentionPolicy | toYaml | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "graphdb-proxy.selectorLabels" . | nindent 6 }}
Expand Down
28 changes: 24 additions & 4 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,16 @@ persistence:
requests:
storage: 5Gi

# Overrides the retention policy of the StatefulSet's PVC.
# This requires Kubernetes v1.27 or greater.
# Ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
#
# Example:
# volumeClaimRetentionPolicy:
# whenScaled: Retain
# whenDeleted: Delete
volumeClaimRetentionPolicy: {}

# Configurations for an emptyDir volume to be used for data storage by the StatefulSet.
# Used when the persistence is disabled with .Values.persistence.enabled
# Ref: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/
Expand All @@ -515,7 +525,7 @@ persistence:

# Configurations for an emptyDir volume for the /tmp folder in each GraphDB container.
# Because the default security context in .Values.securityContext configures the root filesystem to be in read-only mode, certain GraphDB features
# cannot create and write files in /tmp. If you don't use a read-only root filesystem, you can disable this with .Values.tempPersistence.enabled
# cannot create and write files in /tmp. If you don't use a read-only root filesystem, you can disable this with .Values.tempVolume.enabled
tempVolume:
# Toggles the temp folder emptyDir volume creation.
# - If enabled, the StatefulSet will use an emptyDir volume for /tmp.
Expand Down Expand Up @@ -729,7 +739,7 @@ livenessProbe:
periodSeconds: 10

#########################################
# Additional Statefulset Configurations #
# Additional StatefulSet Configurations #
#########################################

# Additional environment variables to be set for the GraphDB containers.
Expand Down Expand Up @@ -1116,6 +1126,16 @@ proxy:
requests:
storage: 500Mi

# Overrides the retention policy of the StatefulSet's PVC.
# This requires Kubernetes v1.27 or greater.
# Ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention
#
# Example:
# volumeClaimRetentionPolicy:
# whenScaled: Retain
# whenDeleted: Delete
volumeClaimRetentionPolicy: {}

# Configurations for an emptyDir volume to be used for data storage by the StatefulSet.
# Used when the persistence is disabled with .Values.proxy.persistence.enabled
# Ref: https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/
Expand All @@ -1124,7 +1144,7 @@ proxy:
sizeLimit: 500Mi

##############################
# Statefulset Configurations #
# StatefulSet Configurations #
##############################

# Number of cluster proxies used to access the GraphDB cluster.
Expand Down Expand Up @@ -1322,7 +1342,7 @@ proxy:
periodSeconds: 10

#########################################
# Additional Statefulset Configurations #
# Additional StatefulSet Configurations #
#########################################

# Additional environment variables to be set for the GraphDB proxy containers.
Expand Down

0 comments on commit 48e376a

Please sign in to comment.