Skip to content

Commit 45724cf

Browse files
committed
added replica support to online/offline store services
Signed-off-by: dandawg <12484302+dandawg@users.noreply.github.com>
1 parent 732865f commit 45724cf

13 files changed

+221
-27
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ type FeatureStoreServices struct {
7474

7575
// OfflineStore configures the deployed offline store service
7676
type OfflineStore struct {
77-
ServiceConfigs `json:",inline"`
78-
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
79-
TLS *OfflineTlsConfigs `json:"tls,omitempty"`
77+
StoreServiceConfigs `json:",inline"`
78+
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
79+
TLS *OfflineTlsConfigs `json:"tls,omitempty"`
8080
// LogLevel sets the logging level for the offline store service
8181
// Allowed values: "debug", "info", "warning", "error", "critical".
8282
// +kubebuilder:validation:Enum=debug;info;warning;error;critical
@@ -131,9 +131,9 @@ var ValidOfflineStoreDBStorePersistenceTypes = []string{
131131

132132
// OnlineStore configures the deployed online store service
133133
type OnlineStore struct {
134-
ServiceConfigs `json:",inline"`
135-
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
136-
TLS *TlsConfigs `json:"tls,omitempty"`
134+
StoreServiceConfigs `json:",inline"`
135+
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
136+
TLS *TlsConfigs `json:"tls,omitempty"`
137137
// LogLevel sets the logging level for the online store service
138138
// Allowed values: "debug", "info", "warning", "error", "critical".
139139
// +kubebuilder:validation:Enum=debug;info;warning;error;critical
@@ -290,6 +290,11 @@ type DefaultConfigs struct {
290290
Image *string `json:"image,omitempty"`
291291
}
292292

293+
type StoreServiceConfigs struct {
294+
Replicas *int32 `json:"replicas,omitempty"`
295+
ServiceConfigs `json:",inline"`
296+
}
297+
293298
// OptionalConfigs k8s container settings that are optional
294299
type OptionalConfigs struct {
295300
Env *[]corev1.EnvVar `json:"env,omitempty"`

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

Lines changed: 23 additions & 2 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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ spec:
366366
x-kubernetes-validations:
367367
- message: One selection required between file or store.
368368
rule: '[has(self.file), has(self.store)].exists_one(c, c)'
369+
replicas:
370+
format: int32
371+
type: integer
369372
resources:
370373
description: ResourceRequirements describes the compute resource
371374
requirements.
@@ -738,6 +741,9 @@ spec:
738741
x-kubernetes-validations:
739742
- message: One selection required between file or store.
740743
rule: '[has(self.file), has(self.store)].exists_one(c, c)'
744+
replicas:
745+
format: int32
746+
type: integer
741747
resources:
742748
description: ResourceRequirements describes the compute resource
743749
requirements.
@@ -1604,6 +1610,9 @@ spec:
16041610
- message: One selection required between file or store.
16051611
rule: '[has(self.file), has(self.store)].exists_one(c,
16061612
c)'
1613+
replicas:
1614+
format: int32
1615+
type: integer
16071616
resources:
16081617
description: ResourceRequirements describes the compute
16091618
resource requirements.
@@ -1983,6 +1992,9 @@ spec:
19831992
- message: One selection required between file or store.
19841993
rule: '[has(self.file), has(self.store)].exists_one(c,
19851994
c)'
1995+
replicas:
1996+
format: int32
1997+
type: integer
19861998
resources:
19871999
description: ResourceRequirements describes the compute
19882000
resource requirements.

infra/feast-operator/dist/install.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@ spec:
374374
x-kubernetes-validations:
375375
- message: One selection required between file or store.
376376
rule: '[has(self.file), has(self.store)].exists_one(c, c)'
377+
replicas:
378+
format: int32
379+
type: integer
377380
resources:
378381
description: ResourceRequirements describes the compute resource
379382
requirements.
@@ -746,6 +749,9 @@ spec:
746749
x-kubernetes-validations:
747750
- message: One selection required between file or store.
748751
rule: '[has(self.file), has(self.store)].exists_one(c, c)'
752+
replicas:
753+
format: int32
754+
type: integer
749755
resources:
750756
description: ResourceRequirements describes the compute resource
751757
requirements.
@@ -1612,6 +1618,9 @@ spec:
16121618
- message: One selection required between file or store.
16131619
rule: '[has(self.file), has(self.store)].exists_one(c,
16141620
c)'
1621+
replicas:
1622+
format: int32
1623+
type: integer
16151624
resources:
16161625
description: ResourceRequirements describes the compute
16171626
resource requirements.
@@ -1991,6 +2000,9 @@ spec:
19912000
- message: One selection required between file or store.
19922001
rule: '[has(self.file), has(self.store)].exists_one(c,
19932002
c)'
2003+
replicas:
2004+
format: int32
2005+
type: integer
19942006
resources:
19952007
description: ResourceRequirements describes the compute
19962008
resource requirements.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {
127127
Context("When deploying a resource with all db storage services", func() {
128128
const resourceName = "cr-name"
129129
var pullPolicy = corev1.PullAlways
130+
var replicas = int32(1)
130131

131132
ctx := context.Background()
132133

@@ -205,7 +206,7 @@ var _ = Describe("FeatureStore Controller - db storage services", func() {
205206
By("creating the custom resource for the Kind FeatureStore")
206207
err = k8sClient.Get(ctx, typeNamespacedName, featurestore)
207208
if err != nil && errors.IsNotFound(err) {
208-
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{})
209+
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{})
209210
resource.Spec.Services.OfflineStore.Persistence = &feastdevv1alpha1.OfflineStorePersistence{
210211
DBPersistence: &feastdevv1alpha1.OfflineStoreDBStorePersistence{
211212
Type: string(offlineType),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
4848
const resourceName = "services-ephemeral"
4949
const offlineType = "duckdb"
5050
var pullPolicy = corev1.PullAlways
51+
var replicas = int32(1)
5152
var testEnvVarName = "testEnvVarName"
5253
var testEnvVarValue = "testEnvVarValue"
5354

@@ -65,7 +66,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
6566
By("creating the custom resource for the Kind FeatureStore")
6667
err := k8sClient.Get(ctx, typeNamespacedName, featurestore)
6768
if err != nil && errors.IsNotFound(err) {
68-
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
69+
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
6970
{Name: "fieldRefName", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.namespace"}}}})
7071
resource.Spec.Services.OfflineStore.Persistence = &feastdevv1alpha1.OfflineStorePersistence{
7172
FilePersistence: &feastdevv1alpha1.OfflineStoreFilePersistence{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ var _ = Describe("FeatureStore Controller-Kubernetes authorization", func() {
4848
Context("When deploying a resource with all ephemeral services and Kubernetes authorization", func() {
4949
const resourceName = "kubernetes-authorization"
5050
var pullPolicy = corev1.PullAlways
51+
var replicas = int32(1)
5152

5253
ctx := context.Background()
5354

@@ -62,7 +63,7 @@ var _ = Describe("FeatureStore Controller-Kubernetes authorization", func() {
6263
By("creating the custom resource for the Kind FeatureStore")
6364
err := k8sClient.Get(ctx, typeNamespacedName, featurestore)
6465
if err != nil && errors.IsNotFound(err) {
65-
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{})
66+
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{})
6667
resource.Spec.AuthzConfig = &feastdevv1alpha1.AuthzConfig{KubernetesAuthz: &feastdevv1alpha1.KubernetesAuthz{
6768
Roles: roles,
6869
}}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
4646
Context("When deploying a resource with all ephemeral services", func() {
4747
const resourceName = "services-object-store"
4848
var pullPolicy = corev1.PullAlways
49+
var replicas = int32(1)
4950
var testEnvVarName = "testEnvVarName"
5051
var testEnvVarValue = "testEnvVarValue"
5152

@@ -67,7 +68,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
6768
By("creating the custom resource for the Kind FeatureStore")
6869
err := k8sClient.Get(ctx, typeNamespacedName, featurestore)
6970
if err != nil && errors.IsNotFound(err) {
70-
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
71+
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
7172
{Name: "fieldRefName", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.namespace"}}}})
7273
resource.Spec.Services.OnlineStore = nil
7374
resource.Spec.Services.OfflineStore = nil

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ var _ = Describe("FeatureStore Controller-OIDC authorization", func() {
4949
const resourceName = "oidc-authorization"
5050
const oidcSecretName = "oidc-secret"
5151
var pullPolicy = corev1.PullAlways
52+
var replicas = int32(1)
5253

5354
ctx := context.Background()
5455

@@ -73,7 +74,7 @@ var _ = Describe("FeatureStore Controller-OIDC authorization", func() {
7374
By("creating the custom resource for the Kind FeatureStore")
7475
err = k8sClient.Get(ctx, typeNamespacedName, featurestore)
7576
if err != nil && errors.IsNotFound(err) {
76-
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{})
77+
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{})
7778
resource.Spec.AuthzConfig = &feastdevv1alpha1.AuthzConfig{OidcAuthz: &feastdevv1alpha1.OidcAuthz{
7879
SecretRef: corev1.LocalObjectReference{
7980
Name: oidcSecretName,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
5050
Context("When deploying a resource with all ephemeral services", func() {
5151
const resourceName = "services-pvc"
5252
var pullPolicy = corev1.PullAlways
53+
var replicas = int32(1)
5354
var testEnvVarName = "testEnvVarName"
5455
var testEnvVarValue = "testEnvVarValue"
5556

@@ -77,7 +78,7 @@ var _ = Describe("FeatureStore Controller-Ephemeral services", func() {
7778
By("creating the custom resource for the Kind FeatureStore")
7879
err := k8sClient.Get(ctx, typeNamespacedName, featurestore)
7980
if err != nil && errors.IsNotFound(err) {
80-
resource := createFeatureStoreResource(resourceName, image, pullPolicy, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
81+
resource := createFeatureStoreResource(resourceName, image, pullPolicy, replicas, &[]corev1.EnvVar{{Name: testEnvVarName, Value: testEnvVarValue},
8182
{Name: "fieldRefName", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "v1", FieldPath: "metadata.namespace"}}}})
8283
resource.Spec.Services.OfflineStore.Persistence = &feastdevv1alpha1.OfflineStorePersistence{
8384
FilePersistence: &feastdevv1alpha1.OfflineStoreFilePersistence{

0 commit comments

Comments
 (0)