Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions infra/feast-operator/api/v1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,10 @@ type FeatureStoreServices struct {
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
// Disable the 'feast repo initialization' initContainer
DisableInitContainers bool `json:"disableInitContainers,omitempty"`
// InitImage overrides the image for init containers (feast-init, feast-apply).
// Resolution order: InitImage → RELATED_IMAGE_FEATURE_SERVER → DefaultImage.
// +optional
InitImage *string `json:"initImage,omitempty"`
// Runs feast apply on pod start to populate the registry. Defaults to true. Ignored when DisableInitContainers is true.
RunFeastApplyOnInit *bool `json:"runFeastApplyOnInit,omitempty"`
// Volumes specifies the volumes to mount in the FeatureStore deployment. A corresponding `VolumeMount` should be added to whichever feast service(s) require access to said volume(s).
Expand Down
5 changes: 5 additions & 0 deletions infra/feast-operator/api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ metadata:
}
]
capabilities: Basic Install
createdAt: "2026-06-13T11:22:06Z"
createdAt: "2026-07-09T21:22:32Z"
operators.operatorframework.io/builder: operator-sdk-v1.41.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
name: feast-operator.v0.64.0
Expand Down Expand Up @@ -246,6 +246,14 @@ spec:
- patch
- update
- watch
- apiGroups:
- config.openshift.io
resources:
- apiservers
verbs:
- get
- list
- watch
- apiGroups:
- feast.dev
resources:
Expand Down
1,216 changes: 1,118 additions & 98 deletions infra/feast-operator/bundle/manifests/feast.dev_featurestores.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: Secret
metadata:
name: openlineage-secret
stringData:
api_key: your-marquez-api-key # pragma: allowlist secret
api_key: your-marquez-api-key
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,10 @@ spec:
disableInitContainers:
description: Disable the 'feast repo initialization' initContainer
type: boolean
initImage:
description: InitImage overrides the image for init containers
(feast-init, feast-apply).
type: string
offlineStore:
description: OfflineStore configures the offline store service
properties:
Expand Down Expand Up @@ -8019,6 +8023,10 @@ spec:
disableInitContainers:
description: Disable the 'feast repo initialization' initContainer
type: boolean
initImage:
description: InitImage overrides the image for init containers
(feast-init, feast-apply).
type: string
offlineStore:
description: OfflineStore configures the offline store service
properties:
Expand Down
8 changes: 8 additions & 0 deletions infra/feast-operator/dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,10 @@ spec:
disableInitContainers:
description: Disable the 'feast repo initialization' initContainer
type: boolean
initImage:
description: InitImage overrides the image for init containers
(feast-init, feast-apply).
type: string
offlineStore:
description: OfflineStore configures the offline store service
properties:
Expand Down Expand Up @@ -8027,6 +8031,10 @@ spec:
disableInitContainers:
description: Disable the 'feast repo initialization' initContainer
type: boolean
initImage:
description: InitImage overrides the image for init containers
(feast-init, feast-apply).
type: string
offlineStore:
description: OfflineStore configures the offline store service
properties:
Expand Down
2 changes: 2 additions & 0 deletions infra/feast-operator/docs/api/markdown/ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ _Appears in:_
This enables annotation-driven integrations like OpenTelemetry auto-instrumentation,
Istio sidecar injection, Vault agent injection, etc. |
| `disableInitContainers` _boolean_ | Disable the 'feast repo initialization' initContainer |
| `initImage` _string_ | InitImage overrides the image for init containers (feast-init, feast-apply).
Resolution order: InitImage → RELATED_IMAGE_FEATURE_SERVER → DefaultImage. |
| `runFeastApplyOnInit` _boolean_ | Runs feast apply on pod start to populate the registry. Defaults to true. Ignored when DisableInitContainers is true. |
| `volumes` _[Volume](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#volume-v1-core) array_ | Volumes specifies the volumes to mount in the FeatureStore deployment. A corresponding `VolumeMount` should be added to whichever feast service(s) require access to said volume(s). |
| `scaling` _[ScalingConfig](#scalingconfig)_ | Scaling configures horizontal scaling for the FeatureStore deployment (e.g. HPA autoscaling).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,41 @@ var _ = Describe("FeatureStore Controller", func() {
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring("feast init -t spark"))

// initImage is independent of server images: init containers use initImage,
// main containers keep their own server.image.
initImage := "quay.io/org/feast-init:custom"
serverImage := "quay.io/org/feast-online:server"
if resource.Spec.Services == nil {
resource.Spec.Services = &feastdevv1.FeatureStoreServices{}
}
resource.Spec.Services.InitImage = &initImage
if resource.Spec.Services.OnlineStore == nil {
resource.Spec.Services.OnlineStore = &feastdevv1.OnlineStore{}
}
if resource.Spec.Services.OnlineStore.Server == nil {
resource.Spec.Services.OnlineStore.Server = &feastdevv1.ServerConfigs{}
}
resource.Spec.Services.OnlineStore.Server.Image = &serverImage
err = k8sClient.Update(ctx, resource)
Expect(err).NotTo(HaveOccurred())
_, err = controllerReconciler.Reconcile(ctx, reconcile.Request{
NamespacedName: typeNamespacedName,
})
Expect(err).NotTo(HaveOccurred())

err = k8sClient.Get(ctx, types.NamespacedName{
Name: objMeta.Name,
Namespace: objMeta.Namespace,
}, deploy)
Expect(err).NotTo(HaveOccurred())
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
Expect(deploy.Spec.Template.Spec.InitContainers[0].Image).To(Equal(initImage))
Expect(deploy.Spec.Template.Spec.InitContainers[1].Image).To(Equal(initImage))
online = services.GetOnlineContainer(*deploy)
Expect(online).NotTo(BeNil())
Expect(online.Image).To(Equal(serverImage))
Expect(online.Image).NotTo(Equal(initImage))
})

It("should properly encode a feature_store.yaml config", func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,9 +687,10 @@ func (feast *FeastServices) setInitContainer(podSpec *corev1.PodSpec, fsYamlB64
feastProjectDir := applied.FeastProjectDir
workingDir := getOfflineMountPath(feast.Handler.FeatureStore)
projectPath := workingDir + "/" + applied.FeastProject
initImage := getInitContainerImage(applied.Services)
container := corev1.Container{
Name: feastInitContainerName,
Image: getFeatureServerImage(),
Image: initImage,
Env: []corev1.EnvVar{
{
Name: TmpFeatureStoreYamlEnvVar,
Expand Down Expand Up @@ -742,7 +743,7 @@ func (feast *FeastServices) setInitContainer(podSpec *corev1.PodSpec, fsYamlB64
if applied.Services.RunFeastApplyOnInit != nil && *applied.Services.RunFeastApplyOnInit {
applyContainer := corev1.Container{
Name: feastApplyContainerName,
Image: getFeatureServerImage(),
Image: initImage,
Command: []string{feastCommand, "apply"},
WorkingDir: featureRepoDir,
}
Expand Down
9 changes: 9 additions & 0 deletions infra/feast-operator/internal/controller/services/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ func getFeatureServerImage() string {
return DefaultImage
}

// getInitContainerImage resolves the image for feast-init / feast-apply.
// Order: spec.services.initImage → RELATED_IMAGE_FEATURE_SERVER → DefaultImage.
func getInitContainerImage(services *feastdevv1.FeatureStoreServices) string {
if services != nil && services.InitImage != nil && len(*services.InitImage) > 0 {
return *services.InitImage
}
return getFeatureServerImage()
}

func checkOfflineStoreFilePersistenceType(value string) error {
if slices.Contains(feastdevv1.ValidOfflineStoreFilePersistenceTypes, value) {
return nil
Expand Down
84 changes: 84 additions & 0 deletions infra/feast-operator/internal/controller/services/util_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
Copyright 2024 Feast Community.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package services

import (
"os"
"testing"

feastdevv1 "github.com/feast-dev/feast/infra/feast-operator/api/v1"
"k8s.io/utils/ptr"
)

func TestGetInitContainerImage(t *testing.T) {
customInit := "quay.io/org/feast-init:custom"
envImage := "quay.io/org/feast-env:test"

t.Run("uses initImage and ignores differing server images", func(t *testing.T) {
t.Setenv(feastServerImageVar, envImage)
got := getInitContainerImage(&feastdevv1.FeatureStoreServices{
InitImage: ptr.To(customInit),
OfflineStore: &feastdevv1.OfflineStore{
Server: &feastdevv1.ServerConfigs{
ContainerConfigs: feastdevv1.ContainerConfigs{
DefaultCtrConfigs: feastdevv1.DefaultCtrConfigs{
Image: ptr.To("quay.io/org/offline:v1"),
},
},
},
},
OnlineStore: &feastdevv1.OnlineStore{
Server: &feastdevv1.ServerConfigs{
ContainerConfigs: feastdevv1.ContainerConfigs{
DefaultCtrConfigs: feastdevv1.DefaultCtrConfigs{
Image: ptr.To("quay.io/org/online:v1"),
},
},
},
},
})
if got != customInit {
t.Fatalf("got %q, want %q (must not inherit server images)", got, customInit)
}
})

t.Run("falls back to RELATED_IMAGE_FEATURE_SERVER", func(t *testing.T) {
t.Setenv(feastServerImageVar, envImage)
got := getInitContainerImage(&feastdevv1.FeatureStoreServices{})
if got != envImage {
t.Fatalf("got %q, want %q", got, envImage)
}
})

t.Run("falls back to DefaultImage", func(t *testing.T) {
os.Unsetenv(feastServerImageVar)
got := getInitContainerImage(nil)
if got != DefaultImage {
t.Fatalf("got %q, want %q", got, DefaultImage)
}
})

t.Run("ignores empty initImage", func(t *testing.T) {
t.Setenv(feastServerImageVar, envImage)
got := getInitContainerImage(&feastdevv1.FeatureStoreServices{
InitImage: ptr.To(""),
})
if got != envImage {
t.Fatalf("got %q, want %q", got, envImage)
}
})
}
Loading