From 84643bcac4b99d6e87615397a48c1917276c4911 Mon Sep 17 00:00:00 2001 From: Roman Wozniak Date: Tue, 31 Oct 2023 13:41:14 +0800 Subject: [PATCH] feat(caraml-store): Add minReadySeconds & strategy support for caraml-store/serving chart (#367) --- charts/caraml-store/Chart.yaml | 2 +- charts/caraml-store/README.md | 5 ++++- charts/caraml-store/ci/ci-values.yaml | 2 ++ .../templates/serving/deployment.yaml | 7 +++++++ .../caraml-store/templates/serving/pdb.yaml | 19 +++++++++++++++++++ charts/caraml-store/values.yaml | 10 ++++++++++ 6 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 charts/caraml-store/ci/ci-values.yaml create mode 100644 charts/caraml-store/templates/serving/pdb.yaml diff --git a/charts/caraml-store/Chart.yaml b/charts/caraml-store/Chart.yaml index 5298c1fb..7b84b785 100644 --- a/charts/caraml-store/Chart.yaml +++ b/charts/caraml-store/Chart.yaml @@ -20,4 +20,4 @@ maintainers: - email: caraml-dev@caraml.dev name: caraml-dev name: caraml-store -version: 0.1.15 +version: 0.1.16 diff --git a/charts/caraml-store/README.md b/charts/caraml-store/README.md index 8b528c37..972a7f36 100644 --- a/charts/caraml-store/README.md +++ b/charts/caraml-store/README.md @@ -1,6 +1,6 @@ # caraml-store -![Version: 0.1.15](https://img.shields.io/badge/Version-0.1.15-informational?style=flat-square) ![AppVersion: 0.1.3](https://img.shields.io/badge/AppVersion-0.1.3-informational?style=flat-square) +![Version: 0.1.16](https://img.shields.io/badge/Version-0.1.16-informational?style=flat-square) ![AppVersion: 0.1.3](https://img.shields.io/badge/AppVersion-0.1.3-informational?style=flat-square) CaraML store registry: Feature registry for CaraML store. @@ -85,10 +85,12 @@ CaraML store registry: Feature registry for CaraML store. | serving.image.tag | string | `""` | | | serving.imagePullSecrets | list | `[]` | | | serving.javaOpts | string | `nil` | | +| serving.minReadySeconds | int | `0` | The minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available. | | serving.name | string | `"serving"` | | | serving.nameOverride | string | `""` | | | serving.nodeSelector | object | `{}` | | | serving.podAnnotations | object | `{}` | | +| serving.podDisruptionBudget | object | `{}` | This value is used to configure a Kubernetes PodDisruptionBudget for Serving deployment | | serving.podLabels | object | `{}` | | | serving.prometheus.monitor.enabled | bool | `false` | Create a ServiceMonitor resource to expose Prometheus metrics | | serving.readinessProbe.enabled | bool | `true` | Flag to enable the probe | @@ -104,6 +106,7 @@ CaraML store registry: Feature registry for CaraML store. | serving.service.grpc.port | int | `6566` | Service port for GRPC requests | | serving.service.grpc.targetPort | int | `6566` | Container port serving GRPC requests | | serving.service.type | string | `"ClusterIP"` | Kubernetes service type | +| serving.strategy | object | `{}` | Strategy used to replace old Pods by new ones. .spec.strategy.type can be "Recreate" or "RollingUpdate". "RollingUpdate" is the default value. | | serving.tolerations | list | `[]` | | ---------------------------------------------- diff --git a/charts/caraml-store/ci/ci-values.yaml b/charts/caraml-store/ci/ci-values.yaml new file mode 100644 index 00000000..36ac9d01 --- /dev/null +++ b/charts/caraml-store/ci/ci-values.yaml @@ -0,0 +1,2 @@ +environmentConfigs: + - {} diff --git a/charts/caraml-store/templates/serving/deployment.yaml b/charts/caraml-store/templates/serving/deployment.yaml index ec7ec6a1..82a19c5e 100644 --- a/charts/caraml-store/templates/serving/deployment.yaml +++ b/charts/caraml-store/templates/serving/deployment.yaml @@ -8,6 +8,13 @@ metadata: {{- include "caraml-store.serving.labels" . | nindent 4 }} spec: replicas: {{ .Values.serving.replicaCount }} +{{- if .Values.serving.strategy }} + strategy: +{{ toYaml .Values.serving.strategy | indent 4 }} +{{- end }} +{{- if .Values.serving.minReadySeconds }} + minReadySeconds: {{ .Values.serving.minReadySeconds }} +{{- end }} selector: matchLabels: {{- include "caraml-store.serving.selectorLabels" . | nindent 6 }} diff --git a/charts/caraml-store/templates/serving/pdb.yaml b/charts/caraml-store/templates/serving/pdb.yaml new file mode 100644 index 00000000..5591f779 --- /dev/null +++ b/charts/caraml-store/templates/serving/pdb.yaml @@ -0,0 +1,19 @@ +{{- if index .Values "serving" "enabled" }} +{{- $fullname := include "caraml-store.serving.fullname" . }} +{{- if .Values.serving.podDisruptionBudget }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "caraml-store.serving.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "caraml-store.serving.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "caraml-store.serving.selectorLabels" . | nindent 6 }} + {{- with .Values.serving.podDisruptionBudget }} + {{- toYaml . | nindent 2 }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/caraml-store/values.yaml b/charts/caraml-store/values.yaml index 8dbff248..ffa9b60f 100644 --- a/charts/caraml-store/values.yaml +++ b/charts/caraml-store/values.yaml @@ -124,8 +124,18 @@ serving: secrets: [] + # serving.strategy -- Strategy used to replace old Pods by new ones. .spec.strategy.type can be "Recreate" or "RollingUpdate". "RollingUpdate" is the default value. + strategy: {} + + # serving.minReadySeconds -- The minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available. + minReadySeconds: 0 + podLabels: {} podAnnotations: {} + + # serving.podDisruptionBudget -- This value is used to configure a Kubernetes PodDisruptionBudget for Serving deployment + podDisruptionBudget: {} + service: # serving.service.type -- Kubernetes service type type: ClusterIP