-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for deploying as a StatefulSet #116
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @eric-zadara
Thanks you for your PR,
Can you create a statefulset.yaml
template in order to not mix the Deployment with StatefulSet. It's a better approach, each workload type is cleanly separated, making it easier to read and understand the templates.
You can add a root value:
# -- Specify the workload management: "Deployment" or "StatefulSet"
workload:
type: "Deployment"
{{- if not .Values.autoscaling.enabled }} | ||
replicas: {{ .Values.replicaCount }} | ||
{{- end }} | ||
{{- if or .Values.updateStrategy.type .Values.updateStrategy.rollingUpdate }} | ||
{{- if and .Values.persistence.enabled .Values.persistence.podManagementPolicy }} | ||
podManagementPolicy: {{ .Values.persistence.podManagementPolicy }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add it at root values with a comment for StatefulSet only.
persistence: | ||
# -- Enable persistence using a StatefulSet | ||
# This disables the Deployment in favor of a StatefulSet | ||
enabled: false | ||
|
||
# -- Ollama server data Persistent Volume Claim Template size used | ||
size: 30Gi | ||
|
||
# -- Ollama server data Persistent Volume Storage Class | ||
# If defined, storageClassName: <storageClass> | ||
# If set to "-", storageClassName: "", which disables dynamic provisioning | ||
# If undefined (the default) or set to null, no storageClassName spec is | ||
# set, choosing the default provisioner. (gp2 on AWS, standard on | ||
# GKE, AWS & OpenStack) | ||
storageClass: "" | ||
|
||
# -- Subdirectory of Ollama server data Persistent Volume to mount | ||
# Useful if the volume's root directory is not empty | ||
subPath: "" | ||
|
||
# -- Additional volumeClaimTemplates | ||
volumeClaimTemplates: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can reuse the persistentVolume
values to avoid duplicate code and add comment to specify to indicate whether it's for Deployment or Statefulsets.
Summary of changes:
Attempting minimal changes to allow deploying as a StatefulSet instead of a Deployment. This is to enable predictable pod naming for use by litellm bypassing the k8s service and address the pods directly.
Chart defaults as existing behavior, but can now be deployed as:
Enabling PVC configuration will override the use of VolumeClaimTemplates with StatelfulSet, incase the user intends to use a shared volume instead of per-pod volumes.
Missing case is using a StatefulSet with an emptyDir but that feels counterintuitive to the intention of a StatefulSet.
Checklist:
artifacthub.io/changes
annotation in Chart.yml according to the documentation