Skip to content

Commit 953b79e

Browse files
committed
single deployment refactor
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
1 parent a73514c commit 953b79e

23 files changed

+1191
-1780
lines changed

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

+10-18
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type FeatureStoreSpec struct {
6565
AuthzConfig *AuthzConfig `json:"authz,omitempty"`
6666
}
6767

68-
// FeatureStoreServices defines the desired feast service deployments. ephemeral registry is deployed by default.
68+
// FeatureStoreServices defines the desired feast services. An ephemeral registry is deployed by default.
6969
type FeatureStoreServices struct {
7070
OfflineStore *OfflineStore `json:"offlineStore,omitempty"`
7171
OnlineStore *OnlineStore `json:"onlineStore,omitempty"`
@@ -74,9 +74,9 @@ type FeatureStoreServices struct {
7474

7575
// OfflineStore configures the deployed offline store service
7676
type OfflineStore struct {
77-
StoreServiceConfigs `json:",inline"`
78-
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
79-
TLS *TlsConfigs `json:"tls,omitempty"`
77+
ServiceConfigs `json:",inline"`
78+
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
79+
TLS *TlsConfigs `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
@@ -127,9 +127,9 @@ var ValidOfflineStoreDBStorePersistenceTypes = []string{
127127

128128
// OnlineStore configures the deployed online store service
129129
type OnlineStore struct {
130-
StoreServiceConfigs `json:",inline"`
131-
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
132-
TLS *TlsConfigs `json:"tls,omitempty"`
130+
ServiceConfigs `json:",inline"`
131+
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
132+
TLS *TlsConfigs `json:"tls,omitempty"`
133133
// LogLevel sets the logging level for the online store service
134134
// Allowed values: "debug", "info", "warning", "error", "critical".
135135
// +kubebuilder:validation:Enum=debug;info;warning;error;critical
@@ -146,7 +146,7 @@ type OnlineStorePersistence struct {
146146
// OnlineStoreFilePersistence configures the file-based persistence for the offline store service
147147
// +kubebuilder:validation:XValidation:rule="(!has(self.pvc) && has(self.path)) ? self.path.startsWith('/') : true",message="Ephemeral stores must have absolute paths."
148148
// +kubebuilder:validation:XValidation:rule="(has(self.pvc) && has(self.path)) ? !self.path.startsWith('/') : true",message="PVC path must be a file name only, with no slashes."
149-
// +kubebuilder:validation:XValidation:rule="has(self.path) && !self.path.startsWith('s3://') && !self.path.startsWith('gs://')",message="Online store does not support S3 or GS buckets."
149+
// +kubebuilder:validation:XValidation:rule="has(self.path) ? !(self.path.startsWith('s3://') || self.path.startsWith('gs://')) : true",message="Online store does not support S3 or GS buckets."
150150
type OnlineStoreFilePersistence struct {
151151
Path string `json:"path,omitempty"`
152152
PvcConfig *PvcConfig `json:"pvc,omitempty"`
@@ -235,11 +235,11 @@ type PvcConfig struct {
235235
Create *PvcCreate `json:"create,omitempty"`
236236
// MountPath within the container at which the volume should be mounted.
237237
// Must start by "/" and cannot contain ':'.
238-
MountPath string `json:"mountPath,omitempty"`
238+
MountPath string `json:"mountPath"`
239239
}
240240

241241
// PvcCreate defines the immutable settings to create a new PVC mounted at the given path.
242-
// The PVC name is the same as the associated deployment name.
242+
// The PVC name is the same as the associated deployment & feast service name.
243243
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="PvcCreate is immutable"
244244
type PvcCreate struct {
245245
// AccessModes k8s persistent volume access modes. Defaults to ["ReadWriteOnce"].
@@ -292,14 +292,6 @@ type DefaultConfigs struct {
292292
Image *string `json:"image,omitempty"`
293293
}
294294

295-
// StoreServiceConfigs k8s deployment settings
296-
type StoreServiceConfigs struct {
297-
// Replicas determines the number of pods for the feast service.
298-
// When Replicas > 1, persistence is recommended.
299-
Replicas *int32 `json:"replicas,omitempty"`
300-
ServiceConfigs `json:",inline"`
301-
}
302-
303295
// OptionalConfigs k8s container settings that are optional
304296
type OptionalConfigs struct {
305297
Env *[]corev1.EnvVar `json:"env,omitempty"`

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

+2-23
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

+20-32
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ spec:
101101
pattern: ^[A-Za-z0-9][A-Za-z0-9_]*$
102102
type: string
103103
services:
104-
description: FeatureStoreServices defines the desired feast service
105-
deployments. ephemeral registry is deployed by default.
104+
description: FeatureStoreServices defines the desired feast services.
105+
An ephemeral registry is deployed by default.
106106
properties:
107107
offlineStore:
108108
description: OfflineStore configures the deployed offline store
@@ -318,6 +318,8 @@ spec:
318318
type: string
319319
type: object
320320
x-kubernetes-map-type: atomic
321+
required:
322+
- mountPath
321323
type: object
322324
x-kubernetes-validations:
323325
- message: One selection is required between ref and
@@ -375,12 +377,6 @@ spec:
375377
x-kubernetes-validations:
376378
- message: One selection required between file or store.
377379
rule: '[has(self.file), has(self.store)].exists_one(c, c)'
378-
replicas:
379-
description: |-
380-
Replicas determines the number of pods for the feast service.
381-
When Replicas > 1, persistence is recommended.
382-
format: int32
383-
type: integer
384380
resources:
385381
description: ResourceRequirements describes the compute resource
386382
requirements.
@@ -692,6 +688,8 @@ spec:
692688
type: string
693689
type: object
694690
x-kubernetes-map-type: atomic
691+
required:
692+
- mountPath
695693
type: object
696694
x-kubernetes-validations:
697695
- message: One selection is required between ref and
@@ -711,8 +709,8 @@ spec:
711709
rule: '(has(self.pvc) && has(self.path)) ? !self.path.startsWith(''/'')
712710
: true'
713711
- message: Online store does not support S3 or GS buckets.
714-
rule: has(self.path) && !self.path.startsWith('s3://')
715-
&& !self.path.startsWith('gs://')
712+
rule: 'has(self.path) ? !(self.path.startsWith(''s3://'')
713+
|| self.path.startsWith(''gs://'')) : true'
716714
store:
717715
description: OnlineStoreDBStorePersistence configures
718716
the DB store persistence for the offline store service
@@ -760,12 +758,6 @@ spec:
760758
x-kubernetes-validations:
761759
- message: One selection required between file or store.
762760
rule: '[has(self.file), has(self.store)].exists_one(c, c)'
763-
replicas:
764-
description: |-
765-
Replicas determines the number of pods for the feast service.
766-
When Replicas > 1, persistence is recommended.
767-
format: int32
768-
type: integer
769761
resources:
770762
description: ResourceRequirements describes the compute resource
771763
requirements.
@@ -1082,6 +1074,8 @@ spec:
10821074
type: string
10831075
type: object
10841076
x-kubernetes-map-type: atomic
1077+
required:
1078+
- mountPath
10851079
type: object
10861080
x-kubernetes-validations:
10871081
- message: One selection is required between ref
@@ -1369,8 +1363,8 @@ spec:
13691363
pattern: ^[A-Za-z0-9][A-Za-z0-9_]*$
13701364
type: string
13711365
services:
1372-
description: FeatureStoreServices defines the desired feast service
1373-
deployments. ephemeral registry is deployed by default.
1366+
description: FeatureStoreServices defines the desired feast services.
1367+
An ephemeral registry is deployed by default.
13741368
properties:
13751369
offlineStore:
13761370
description: OfflineStore configures the deployed offline
@@ -1588,6 +1582,8 @@ spec:
15881582
type: string
15891583
type: object
15901584
x-kubernetes-map-type: atomic
1585+
required:
1586+
- mountPath
15911587
type: object
15921588
x-kubernetes-validations:
15931589
- message: One selection is required between ref
@@ -1647,12 +1643,6 @@ spec:
16471643
- message: One selection required between file or store.
16481644
rule: '[has(self.file), has(self.store)].exists_one(c,
16491645
c)'
1650-
replicas:
1651-
description: |-
1652-
Replicas determines the number of pods for the feast service.
1653-
When Replicas > 1, persistence is recommended.
1654-
format: int32
1655-
type: integer
16561646
resources:
16571647
description: ResourceRequirements describes the compute
16581648
resource requirements.
@@ -1967,6 +1957,8 @@ spec:
19671957
type: string
19681958
type: object
19691959
x-kubernetes-map-type: atomic
1960+
required:
1961+
- mountPath
19701962
type: object
19711963
x-kubernetes-validations:
19721964
- message: One selection is required between ref
@@ -1987,8 +1979,8 @@ spec:
19871979
: true'
19881980
- message: Online store does not support S3 or GS
19891981
buckets.
1990-
rule: has(self.path) && !self.path.startsWith('s3://')
1991-
&& !self.path.startsWith('gs://')
1982+
rule: 'has(self.path) ? !(self.path.startsWith(''s3://'')
1983+
|| self.path.startsWith(''gs://'')) : true'
19921984
store:
19931985
description: OnlineStoreDBStorePersistence configures
19941986
the DB store persistence for the offline store service
@@ -2038,12 +2030,6 @@ spec:
20382030
- message: One selection required between file or store.
20392031
rule: '[has(self.file), has(self.store)].exists_one(c,
20402032
c)'
2041-
replicas:
2042-
description: |-
2043-
Replicas determines the number of pods for the feast service.
2044-
When Replicas > 1, persistence is recommended.
2045-
format: int32
2046-
type: integer
20472033
resources:
20482034
description: ResourceRequirements describes the compute
20492035
resource requirements.
@@ -2368,6 +2354,8 @@ spec:
23682354
type: string
23692355
type: object
23702356
x-kubernetes-map-type: atomic
2357+
required:
2358+
- mountPath
23712359
type: object
23722360
x-kubernetes-validations:
23732361
- message: One selection is required between

infra/feast-operator/config/samples/v1alpha1_featurestore_pvc_persistence.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ metadata:
55
spec:
66
feastProject: my_project
77
services:
8+
# demonstrates using a pre-existing PVC
89
onlineStore:
910
persistence:
1011
file:
@@ -13,6 +14,7 @@ spec:
1314
ref:
1415
name: online-pvc
1516
mountPath: /data/online
17+
# demonstrates specifying a storageClassName and storage size
1618
offlineStore:
1719
persistence:
1820
file:
@@ -24,6 +26,7 @@ spec:
2426
requests:
2527
storage: 5Gi
2628
mountPath: /data/offline
29+
# demonstrates letting the Operator create a PVC w/ defaults set
2730
registry:
2831
local:
2932
persistence:
@@ -39,7 +42,7 @@ metadata:
3942
name: online-pvc
4043
spec:
4144
accessModes:
42-
- ReadWriteMany
45+
- ReadWriteOnce
4346
resources:
4447
requests:
4548
storage: 5Gi

0 commit comments

Comments
 (0)