From aee8a0811fd358dfa07f926c9436176b568b0f17 Mon Sep 17 00:00:00 2001 From: Abhimanyu Sharma Date: Thu, 21 Nov 2024 19:13:38 +0530 Subject: [PATCH] feat: Expose pvc retention policy via helm (#6056) * feat: Expose pvc retention policy via helm * fix: typo fix for mlserver --- .../templates/seldon-v2-servers.yaml | 10 ++++++++++ k8s/helm-charts/seldon-core-v2-servers/values.yaml | 6 ++++++ k8s/kustomize/helm-servers/patch_mlserver.yaml | 3 +++ k8s/kustomize/helm-servers/patch_triton.yaml | 3 +++ k8s/yaml/servers.yaml | 6 ++++++ 5 files changed, 28 insertions(+) diff --git a/k8s/helm-charts/seldon-core-v2-servers/templates/seldon-v2-servers.yaml b/k8s/helm-charts/seldon-core-v2-servers/templates/seldon-v2-servers.yaml index 66441c058d..e91c87eaa2 100644 --- a/k8s/helm-charts/seldon-core-v2-servers/templates/seldon-v2-servers.yaml +++ b/k8s/helm-charts/seldon-core-v2-servers/templates/seldon-v2-servers.yaml @@ -11,6 +11,11 @@ spec: podSpec: {{ toJson .Values.mlserver.podSpec }} replicas: {{ .Values.mlserver.replicas }} serverConfig: mlserver + statefulSetPersistentVolumeClaimRetentionPolicy: + whenDeleted: {{ .Values.mlserver.statefulSetPersistentVolumeClaimRetentionPolicy.whenDeleted + }} + whenScaled: {{ .Values.mlserver.statefulSetPersistentVolumeClaimRetentionPolicy.whenScaled + }} --- apiVersion: mlops.seldon.io/v1alpha1 kind: Server @@ -25,3 +30,8 @@ spec: podSpec: {{ toJson .Values.triton.podSpec }} replicas: {{ .Values.triton.replicas }} serverConfig: triton + statefulSetPersistentVolumeClaimRetentionPolicy: + whenDeleted: {{ .Values.triton.statefulSetPersistentVolumeClaimRetentionPolicy.whenDeleted + }} + whenScaled: {{ .Values.triton.statefulSetPersistentVolumeClaimRetentionPolicy.whenScaled + }} diff --git a/k8s/helm-charts/seldon-core-v2-servers/values.yaml b/k8s/helm-charts/seldon-core-v2-servers/values.yaml index f4134b19a2..78fa250c66 100644 --- a/k8s/helm-charts/seldon-core-v2-servers/values.yaml +++ b/k8s/helm-charts/seldon-core-v2-servers/values.yaml @@ -1,5 +1,11 @@ mlserver: replicas: 1 + statefulSetPersistentVolumeClaimRetentionPolicy: + whenDeleted: Retain + whenScaled: Retain triton: replicas: 1 + statefulSetPersistentVolumeClaimRetentionPolicy: + whenDeleted: Retain + whenScaled: Retain diff --git a/k8s/kustomize/helm-servers/patch_mlserver.yaml b/k8s/kustomize/helm-servers/patch_mlserver.yaml index 7729695312..317f876dc3 100644 --- a/k8s/kustomize/helm-servers/patch_mlserver.yaml +++ b/k8s/kustomize/helm-servers/patch_mlserver.yaml @@ -7,3 +7,6 @@ metadata: spec: replicas: HACK_REMOVE_ME{{ .Values.mlserver.replicas }} podSpec: HACK_REMOVE_ME{{ toJson .Values.mlserver.podSpec }} + statefulSetPersistentVolumeClaimRetentionPolicy: + whenDeleted: HACK_REMOVE_ME{{ .Values.mlserver.statefulSetPersistentVolumeClaimRetentionPolicy.whenDeleted }} + whenScaled: HACK_REMOVE_ME{{ .Values.mlserver.statefulSetPersistentVolumeClaimRetentionPolicy.whenScaled }} diff --git a/k8s/kustomize/helm-servers/patch_triton.yaml b/k8s/kustomize/helm-servers/patch_triton.yaml index f121adc785..f717441f66 100644 --- a/k8s/kustomize/helm-servers/patch_triton.yaml +++ b/k8s/kustomize/helm-servers/patch_triton.yaml @@ -7,3 +7,6 @@ metadata: spec: replicas: HACK_REMOVE_ME{{ .Values.triton.replicas }} podSpec: HACK_REMOVE_ME{{ toJson .Values.triton.podSpec }} + statefulSetPersistentVolumeClaimRetentionPolicy: + whenDeleted: HACK_REMOVE_ME{{ .Values.triton.statefulSetPersistentVolumeClaimRetentionPolicy.whenDeleted }} + whenScaled: HACK_REMOVE_ME{{ .Values.triton.statefulSetPersistentVolumeClaimRetentionPolicy.whenScaled }} diff --git a/k8s/yaml/servers.yaml b/k8s/yaml/servers.yaml index 6ca39bd0f5..e679268bb4 100644 --- a/k8s/yaml/servers.yaml +++ b/k8s/yaml/servers.yaml @@ -12,6 +12,9 @@ spec: podSpec: null replicas: 1 serverConfig: mlserver + statefulSetPersistentVolumeClaimRetentionPolicy: + whenDeleted: Retain + whenScaled: Retain --- # Source: seldon-core-v2-servers/templates/seldon-v2-servers.yaml apiVersion: mlops.seldon.io/v1alpha1 @@ -26,3 +29,6 @@ spec: podSpec: null replicas: 1 serverConfig: triton + statefulSetPersistentVolumeClaimRetentionPolicy: + whenDeleted: Retain + whenScaled: Retain