Documentation ¶
Index ¶
- Constants
- func AppendIfNotFound[T any](source []T, predicate func(item T) bool, newFn func() T) []T
- func AssignOllamaPullerContainer(name string, image string, serverLocatedNamespace string, ...) func(container corev1.Container, _ int) corev1.Container
- func AssignOllamaServerContainer(readOnly bool, resources corev1.ResourceRequirements, ...) func(container corev1.Container, _ int) corev1.Container
- func AssignOrAppend[T any](source []T, predicate func(item T) bool, modifier func(item T, index int) T, ...) []T
- func ClientFromContext(ctx context.Context, key ...baseClientContextKey) client.Client
- func EnsureDeploymentCreated(ctx context.Context, namespace string, name string, image string, ...) (*appsv1.Deployment, error)
- func EnsureImageStorePVCCreated(ctx context.Context, namespace string, storageClassName *string, ...) (*corev1.PersistentVolumeClaim, error)
- func EnsureImageStoreServiceCreated(ctx context.Context, namespace string, statefulSet *appsv1.StatefulSet) (*corev1.Service, error)
- func EnsureImageStoreStatefulSetCreated(ctx context.Context, namespace string, model *ollamav1.Model) (*appsv1.StatefulSet, error)
- func EnsureServiceCreated(ctx context.Context, namespace string, name string, ...) (*corev1.Service, error)
- func FindOllamaPullerContainer(container corev1.Container) bool
- func FindOllamaServerContainer(container corev1.Container) bool
- func GetImageStorePVByPVC(ctx context.Context, c client.Client, pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolume, error)
- func ImageStoreLabels() map[string]string
- func IsAvailable(ctx context.Context, ollamaModelResource ollamav1.Model) bool
- func IsDeploymentReady(ctx context.Context, namespace string, name string) (bool, error)
- func IsImageStoreServiceReady(ctx context.Context, namespace string) (bool, error)
- func IsImageStoreStatefulSetReady(ctx context.Context, namespace string) (bool, error)
- func IsProgressing(ctx context.Context, ollamaModelResource ollamav1.Model) bool
- func IsServiceReady(ctx context.Context, namespace string, name string) (bool, error)
- func MergePodTemplate(ctx context.Context, namespace string, name string, image string, ...) corev1.PodTemplateSpec
- func ModelAnnotations(name string, imageStore bool) map[string]string
- func ModelAppName(name string) string
- func ModelLabels(name string) map[string]string
- func NewClientContextKey(key string) baseClientContextKey
- func NewOllamaPullerContainer(name string, image string, serverLocatedNamespace string, ...) corev1.Container
- func NewOllamaServerContainer(readOnly bool, resources corev1.ResourceRequirements, ...) corev1.Container
- func NewServiceForModel(namespace, name string, deployment *appsv1.Deployment, ...) *corev1.Service
- func NewWrappedRecorderContextKey(key string) baseWrapperRecorderContextKey
- func SetAvailable(ctx context.Context, ollamaModelResource *ollamav1.Model) (bool, error)
- func SetProgressing(ctx context.Context, c client.Client, ollamaModelResource ollamav1.Model) (bool, error)
- func SetReplicas(ctx context.Context, ollamaModelResource *ollamav1.Model, replicas int32, ...) (bool, error)
- func ShouldSetReplicas(ctx context.Context, ollamaModelResource *ollamav1.Model, replicas int32, ...) bool
- func UniqEnvVar(env []corev1.EnvVar) []corev1.EnvVar
- func UpdateDeployment(ctx context.Context, model *ollamav1.Model) (bool, error)
- func WithClient(ctx context.Context, client client.Client, key ...baseClientContextKey) context.Context
- func WithWrappedRecorder[T runtime.Object](ctx context.Context, recorder *WrappedRecorder[T], ...) context.Context
- type WrappedRecorder
Constants ¶
View Source
const ( ImageStorePVCName = "ollama-models-store-pvc" ImageStoreStatefulSetName = "ollama-models-store" )
View Source
const (
OllamaBaseImage = "ollama/ollama"
)
Variables ¶
This section is empty.
Functions ¶
func AppendIfNotFound ¶ added in v0.10.0
func AssignOllamaPullerContainer ¶ added in v0.10.0
func AssignOllamaServerContainer ¶ added in v0.10.0
func AssignOrAppend ¶ added in v0.10.0
func ClientFromContext ¶ added in v0.10.0
func EnsureDeploymentCreated ¶
func EnsureImageStorePVCCreated ¶
func EnsureImageStorePVCCreated( ctx context.Context, namespace string, storageClassName *string, pvcSource *corev1.PersistentVolumeClaimVolumeSource, pvSpec *ollamav1.ModelPersistentVolumeSpec, ) (*corev1.PersistentVolumeClaim, error)
func EnsureServiceCreated ¶
func FindOllamaPullerContainer ¶ added in v0.10.0
func FindOllamaServerContainer ¶ added in v0.10.0
func GetImageStorePVByPVC ¶
func GetImageStorePVByPVC(ctx context.Context, c client.Client, pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolume, error)
func ImageStoreLabels ¶ added in v0.5.2
func IsAvailable ¶ added in v0.2.0
func IsDeploymentReady ¶
func IsProgressing ¶ added in v0.2.0
func IsServiceReady ¶
func MergePodTemplate ¶ added in v0.10.0
func ModelAnnotations ¶ added in v0.5.0
func ModelAppName ¶
func ModelLabels ¶ added in v0.5.0
func NewClientContextKey ¶ added in v0.10.0
func NewClientContextKey(key string) baseClientContextKey
func NewOllamaServerContainer ¶
func NewOllamaServerContainer(readOnly bool, resources corev1.ResourceRequirements, extraEnvFrom []corev1.EnvFromSource, extraEnv []corev1.EnvVar) corev1.Container
func NewServiceForModel ¶ added in v0.4.0
func NewServiceForModel(namespace, name string, deployment *appsv1.Deployment, serviceType corev1.ServiceType) *corev1.Service
func NewWrappedRecorderContextKey ¶ added in v0.10.0
func NewWrappedRecorderContextKey(key string) baseWrapperRecorderContextKey
func SetAvailable ¶ added in v0.2.0
func SetProgressing ¶ added in v0.2.0
func SetReplicas ¶ added in v0.2.0
func ShouldSetReplicas ¶ added in v0.2.0
func UpdateDeployment ¶
func WithClient ¶ added in v0.10.0
func WithWrappedRecorder ¶ added in v0.10.0
Types ¶
type WrappedRecorder ¶
func NewWrappedRecorder ¶
func NewWrappedRecorder[T runtime.Object](recorder record.EventRecorder, object T) *WrappedRecorder[T]
func WrappedRecorderFromContext ¶ added in v0.10.0
func WrappedRecorderFromContext[T runtime.Object](ctx context.Context, key ...baseWrapperRecorderContextKey) *WrappedRecorder[T]
func (*WrappedRecorder[T]) AnnotatedEventf ¶
func (r *WrappedRecorder[T]) AnnotatedEventf(annotations map[string]string, eventType, reason, messageFmt string, args ...any)
AnnotatedEventf is just like eventf, but with annotations attached
func (*WrappedRecorder[T]) Event ¶
func (r *WrappedRecorder[T]) Event(eventType, reason, message string)
func (*WrappedRecorder[T]) Eventf ¶
func (r *WrappedRecorder[T]) Eventf(eventType, reason, messageFmt string, args ...any)
Eventf is just like Event, but with Sprintf for the message field.
Click to show internal directories.
Click to hide internal directories.