Skip to content

Commit 3d55588

Browse files
committed
feat: Add feast apply init container to automate registry population on pod start
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
1 parent 94ad0e7 commit 3d55588

13 files changed

+71
-16
lines changed

.secrets.baseline

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@
934934
"filename": "infra/feast-operator/api/v1/featurestore_types.go",
935935
"hashed_secret": "44e17306b837162269a410204daaa5ecee4ec22c",
936936
"is_verified": false,
937-
"line_number": 726
937+
"line_number": 730
938938
}
939939
],
940940
"infra/feast-operator/api/v1/zz_generated.deepcopy.go": [
@@ -943,21 +943,21 @@
943943
"filename": "infra/feast-operator/api/v1/zz_generated.deepcopy.go",
944944
"hashed_secret": "f914fc9324de1bec1ad13dec94a8ea2ddb41fc87",
945945
"is_verified": false,
946-
"line_number": 681
946+
"line_number": 686
947947
},
948948
{
949949
"type": "Secret Keyword",
950950
"filename": "infra/feast-operator/api/v1/zz_generated.deepcopy.go",
951951
"hashed_secret": "44e17306b837162269a410204daaa5ecee4ec22c",
952952
"is_verified": false,
953-
"line_number": 1249
953+
"line_number": 1254
954954
},
955955
{
956956
"type": "Secret Keyword",
957957
"filename": "infra/feast-operator/api/v1/zz_generated.deepcopy.go",
958958
"hashed_secret": "c2028031c154bbe86fd69bef740855c74b927dcf",
959959
"is_verified": false,
960-
"line_number": 1254
960+
"line_number": 1259
961961
}
962962
],
963963
"infra/feast-operator/api/v1alpha1/featurestore_types.go": [
@@ -966,7 +966,7 @@
966966
"filename": "infra/feast-operator/api/v1alpha1/featurestore_types.go",
967967
"hashed_secret": "44e17306b837162269a410204daaa5ecee4ec22c",
968968
"is_verified": false,
969-
"line_number": 647
969+
"line_number": 651
970970
}
971971
],
972972
"infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go": [
@@ -975,21 +975,21 @@
975975
"filename": "infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go",
976976
"hashed_secret": "f914fc9324de1bec1ad13dec94a8ea2ddb41fc87",
977977
"is_verified": false,
978-
"line_number": 590
978+
"line_number": 595
979979
},
980980
{
981981
"type": "Secret Keyword",
982982
"filename": "infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go",
983983
"hashed_secret": "44e17306b837162269a410204daaa5ecee4ec22c",
984984
"is_verified": false,
985-
"line_number": 1098
985+
"line_number": 1103
986986
},
987987
{
988988
"type": "Secret Keyword",
989989
"filename": "infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go",
990990
"hashed_secret": "c2028031c154bbe86fd69bef740855c74b927dcf",
991991
"is_verified": false,
992-
"line_number": 1103
992+
"line_number": 1108
993993
}
994994
],
995995
"infra/feast-operator/config/samples/v1_featurestore_db_persistence.yaml": [
@@ -1539,5 +1539,5 @@
15391539
}
15401540
]
15411541
},
1542-
"generated_at": "2026-03-05T15:25:10Z"
1542+
"generated_at": "2026-03-14T10:02:47Z"
15431543
}

infra/feast-operator/api/v1/featurestore_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ type FeatureStoreServices struct {
310310
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
311311
// Disable the 'feast repo initialization' initContainer
312312
DisableInitContainers bool `json:"disableInitContainers,omitempty"`
313+
// When enabled, a "feast apply" init container is added to the deployment so that
314+
// the feature store registry is populated on every pod start. Defaults to true.
315+
// Has no effect when DisableInitContainers is true.
316+
RunFeastApplyOnInit *bool `json:"runFeastApplyOnInit,omitempty"`
313317
// 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).
314318
Volumes []corev1.Volume `json:"volumes,omitempty"`
315319
// Scaling configures horizontal scaling for the FeatureStore deployment (e.g. HPA autoscaling).

infra/feast-operator/api/v1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra/feast-operator/api/v1alpha1/featurestore_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ type FeatureStoreServices struct {
289289
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
290290
// Disable the 'feast repo initialization' initContainer
291291
DisableInitContainers bool `json:"disableInitContainers,omitempty"`
292+
// When enabled, a "feast apply" init container is added to the deployment so that
293+
// the feature store registry is populated on every pod start. Defaults to true.
294+
// Has no effect when DisableInitContainers is true.
295+
RunFeastApplyOnInit *bool `json:"runFeastApplyOnInit,omitempty"`
292296
// 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).
293297
Volumes []corev1.Volume `json:"volumes,omitempty"`
294298
}

infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3128,6 +3128,11 @@ spec:
31283128
x-kubernetes-validations:
31293129
- message: One selection required.
31303130
rule: '[has(self.local), has(self.remote)].exists_one(c, c)'
3131+
runFeastApplyOnInit:
3132+
description: "When enabled, a \"feast apply\" init container is
3133+
added to the deployment so that\nthe feature store registry
3134+
is populated "
3135+
type: boolean
31313136
scaling:
31323137
description: Scaling configures horizontal scaling for the FeatureStore
31333138
deployment (e.g. HPA autoscaling).
@@ -8869,6 +8874,11 @@ spec:
88698874
- message: One selection required.
88708875
rule: '[has(self.local), has(self.remote)].exists_one(c,
88718876
c)'
8877+
runFeastApplyOnInit:
8878+
description: "When enabled, a \"feast apply\" init container
8879+
is added to the deployment so that\nthe feature store registry
8880+
is populated "
8881+
type: boolean
88728882
scaling:
88738883
description: Scaling configures horizontal scaling for the
88748884
FeatureStore deployment (e.g. HPA autoscaling).
@@ -13918,6 +13928,11 @@ spec:
1391813928
x-kubernetes-validations:
1391913929
- message: One selection required.
1392013930
rule: '[has(self.local), has(self.remote)].exists_one(c, c)'
13931+
runFeastApplyOnInit:
13932+
description: "When enabled, a \"feast apply\" init container is
13933+
added to the deployment so that\nthe feature store registry
13934+
is populated "
13935+
type: boolean
1392113936
securityContext:
1392213937
description: PodSecurityContext holds pod-level security attributes
1392313938
and common container settings.
@@ -18161,6 +18176,11 @@ spec:
1816118176
- message: One selection required.
1816218177
rule: '[has(self.local), has(self.remote)].exists_one(c,
1816318178
c)'
18179+
runFeastApplyOnInit:
18180+
description: "When enabled, a \"feast apply\" init container
18181+
is added to the deployment so that\nthe feature store registry
18182+
is populated "
18183+
type: boolean
1816418184
securityContext:
1816518185
description: PodSecurityContext holds pod-level security attributes
1816618186
and common container settings.

infra/feast-operator/internal/controller/featurestore_controller_cronjob_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ var _ = Describe("FeatureStore Controller - Feast CronJob", func() {
9898
Expect(resource.Status).NotTo(BeNil())
9999
Expect(resource.Status.CronJob).To(Equal(objMeta.Name))
100100
Expect(resource.Status.Applied.CronJob.Schedule).NotTo(BeEmpty())
101+
Expect(resource.Status.Applied.Services.RunFeastApplyOnInit).NotTo(BeNil())
102+
Expect(*resource.Status.Applied.Services.RunFeastApplyOnInit).To(BeTrue())
101103

102104
Expect(resource.Status.Conditions).NotTo(BeEmpty())
103105
cond := apimeta.FindStatusCondition(resource.Status.Conditions, feastdevv1.CronJobReadyType)

infra/feast-operator/internal/controller/featurestore_controller_objectstore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
185185
Expect(err).NotTo(HaveOccurred())
186186
Expect(deploy.Spec.Replicas).To(Equal(int32Ptr(1)))
187187
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
188-
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
188+
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
189189
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(2))
190190
Expect(services.GetRegistryContainer(*deploy)).NotTo(BeNil())
191191
Expect(services.GetOnlineContainer(*deploy)).NotTo(BeNil())

infra/feast-operator/internal/controller/featurestore_controller_oidc_auth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ var _ = Describe("FeatureStore Controller-OIDC authorization", func() {
221221
Expect(err).NotTo(HaveOccurred())
222222
Expect(deploy.Spec.Replicas).To(Equal(int32Ptr(1)))
223223
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
224-
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
224+
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
225225
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(4))
226226
Expect(deploy.Spec.Template.Spec.Volumes).To(HaveLen(1))
227227
Expect(services.GetOfflineContainer(*deploy).VolumeMounts).To(HaveLen(1))

infra/feast-operator/internal/controller/featurestore_controller_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,10 @@ var _ = Describe("FeatureStore Controller", func() {
210210
Expect(deploy.Spec.Replicas).To(Equal(int32Ptr(1)))
211211
Expect(controllerutil.HasControllerReference(deploy)).To(BeTrue())
212212
Expect(deploy.Spec.Template.Spec.ServiceAccountName).To(Equal(deploy.Name))
213-
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
213+
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
214214
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring("feast init"))
215+
Expect(deploy.Spec.Template.Spec.InitContainers[1].Name).To(Equal("feast-apply"))
216+
Expect(deploy.Spec.Template.Spec.InitContainers[1].Command).To(Equal([]string{"feast", "apply"}))
215217
Expect(deploy.Spec.Template.Spec.Containers).To(HaveLen(1))
216218

217219
deploy.Spec.Replicas = int32Ptr(3)
@@ -264,7 +266,7 @@ var _ = Describe("FeatureStore Controller", func() {
264266
}, deploy)
265267
Expect(err).NotTo(HaveOccurred())
266268
Expect(deploy.Spec.Replicas).To(Equal(int32Ptr(1)))
267-
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
269+
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
268270
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring("git -c http.sslVerify=false clone"))
269271
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring("git checkout " + ref))
270272
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring(featureRepoPath))
@@ -294,7 +296,7 @@ var _ = Describe("FeatureStore Controller", func() {
294296
Namespace: objMeta.Namespace,
295297
}, deploy)
296298
Expect(err).NotTo(HaveOccurred())
297-
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
299+
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
298300
Expect(deploy.Spec.Template.Spec.InitContainers[0].Args[0]).To(ContainSubstring("feast init -t spark"))
299301
})
300302

@@ -1145,7 +1147,7 @@ var _ = Describe("FeatureStore Controller", func() {
11451147
Namespace: objMeta.Namespace,
11461148
}, deploy)
11471149
Expect(err).NotTo(HaveOccurred())
1148-
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
1150+
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
11491151

11501152
// check client config
11511153
cm := &corev1.ConfigMap{}

0 commit comments

Comments
 (0)