-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathfeaturestore_types.go
More file actions
995 lines (897 loc) · 50.6 KB
/
Copy pathfeaturestore_types.go
File metadata and controls
995 lines (897 loc) · 50.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
/*
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 v1
import (
appsv1 "k8s.io/api/apps/v1"
autoscalingv2 "k8s.io/api/autoscaling/v2"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
const (
// Feast phases:
ReadyPhase = "Ready"
PendingPhase = "Pending"
FailedPhase = "Failed"
// Feast condition types:
ClientReadyType = "Client"
OfflineStoreReadyType = "OfflineStore"
OnlineStoreReadyType = "OnlineStore"
RegistryReadyType = "Registry"
UIReadyType = "UI"
ReadyType = "FeatureStore"
AuthorizationReadyType = "Authorization"
CronJobReadyType = "CronJob"
// Feast condition reasons:
ReadyReason = "Ready"
FailedReason = "FeatureStoreFailed"
DeploymentNotAvailableReason = "DeploymentNotAvailable"
OfflineStoreFailedReason = "OfflineStoreDeploymentFailed"
OnlineStoreFailedReason = "OnlineStoreDeploymentFailed"
RegistryFailedReason = "RegistryDeploymentFailed"
UIFailedReason = "UIDeploymentFailed"
ClientFailedReason = "ClientDeploymentFailed"
CronJobFailedReason = "CronJobDeploymentFailed"
KubernetesAuthzFailedReason = "KubernetesAuthorizationDeploymentFailed"
OidcAuthzFailedReason = "OidcAuthorizationDeploymentFailed"
// Feast condition messages:
ReadyMessage = "FeatureStore installation complete"
OfflineStoreReadyMessage = "Offline Store installation complete"
OnlineStoreReadyMessage = "Online Store installation complete"
RegistryReadyMessage = "Registry installation complete"
UIReadyMessage = "UI installation complete"
ClientReadyMessage = "Client installation complete"
CronJobReadyMessage = "CronJob installation complete"
KubernetesAuthzReadyMessage = "Kubernetes authorization installation complete"
OidcAuthzReadyMessage = "OIDC authorization installation complete"
DeploymentNotAvailableMessage = "Deployment is not available"
// entity_key_serialization_version
SerializationVersion = 3
)
// MaterializationConfig controls feature materialization behavior written into feature_store.yaml.
type MaterializationConfig struct {
// Number of rows per batch when writing to the online store during materialization.
// Prevents OOM for large feature views. Supported engines: local, spark, ray.
// If unset, all rows are written in a single batch.
// +kubebuilder:validation:Minimum=1
// +optional
OnlineWriteBatchSize *int32 `json:"onlineWriteBatchSize,omitempty"`
// ExtraConfig passes additional materialization key-value settings inline into
// feature_store.yaml.
// +optional
ExtraConfig map[string]string `json:"extraConfig,omitempty"`
}
// OpenLineageConfig enables OpenLineage data lineage tracking for Feast operations.
// Lineage events are emitted during feast apply and materialization when enabled.
type OpenLineageConfig struct {
// Enable OpenLineage integration.
Enabled bool `json:"enabled"`
// Transport type for lineage events.
// +kubebuilder:validation:Enum=http;console;file;kafka
// +optional
TransportType *string `json:"transportType,omitempty"`
// URL for HTTP transport (e.g. http://marquez:5000). Required when transportType is "http".
// +optional
TransportUrl *string `json:"transportUrl,omitempty"`
// API endpoint path appended to transportUrl. Defaults to "api/v1/lineage".
// +optional
TransportEndpoint *string `json:"transportEndpoint,omitempty"`
// Reference to a Secret containing the key "api_key" for lineage server authentication.
// +optional
ApiKeySecretRef *corev1.LocalObjectReference `json:"apiKeySecretRef,omitempty"`
// ExtraConfig holds additional OpenLineage key-value settings written inline into
// the openlineage block of feature_store.yaml alongside the typed fields above.
// Use this for non-core settings (e.g. namespace, producer, emit_on_apply,
// emit_on_materialize) and transport-specific options (e.g. kafka
// bootstrap_servers, topic; file path). Boolean values ("true"/"false") and
// integer values are automatically coerced to their native YAML types.
// Keys must be valid Feast OpenLineageConfig YAML field names.
// +optional
ExtraConfig map[string]string `json:"extraConfig,omitempty"`
}
// FeatureStoreSpec defines the desired state of FeatureStore
// +kubebuilder:validation:XValidation:rule="self.replicas <= 1 || !has(self.services) || !has(self.services.scaling) || !has(self.services.scaling.autoscaling)",message="replicas > 1 and services.scaling.autoscaling are mutually exclusive."
// +kubebuilder:validation:XValidation:rule="self.replicas <= 1 && (!has(self.services) || !has(self.services.scaling) || !has(self.services.scaling.autoscaling)) || (has(self.services) && has(self.services.onlineStore) && has(self.services.onlineStore.persistence) && has(self.services.onlineStore.persistence.store))",message="Scaling requires DB-backed persistence for the online store. Configure services.onlineStore.persistence.store when using replicas > 1 or autoscaling."
// +kubebuilder:validation:XValidation:rule="self.replicas <= 1 && (!has(self.services) || !has(self.services.scaling) || !has(self.services.scaling.autoscaling)) || (!has(self.services) || !has(self.services.offlineStore) || (has(self.services.offlineStore.persistence) && has(self.services.offlineStore.persistence.store)))",message="Scaling requires DB-backed persistence for the offline store. Configure services.offlineStore.persistence.store when using replicas > 1 or autoscaling."
// +kubebuilder:validation:XValidation:rule="self.replicas <= 1 && (!has(self.services) || !has(self.services.scaling) || !has(self.services.scaling.autoscaling)) || (has(self.services) && has(self.services.registry) && (has(self.services.registry.remote) || (has(self.services.registry.local) && has(self.services.registry.local.persistence) && (has(self.services.registry.local.persistence.store) || (has(self.services.registry.local.persistence.file) && has(self.services.registry.local.persistence.file.path) && (self.services.registry.local.persistence.file.path.startsWith('s3://') || self.services.registry.local.persistence.file.path.startsWith('gs://')))))))",message="Scaling requires DB-backed or remote registry. Configure registry.local.persistence.store or use a remote registry when using replicas > 1 or autoscaling. S3/GCS-backed registry is also allowed."
type FeatureStoreSpec struct {
// +kubebuilder:validation:Pattern="^[A-Za-z0-9][A-Za-z0-9_-]*$"
// FeastProject is the Feast project id. This can be any alphanumeric string with underscores and hyphens, but it cannot start with an underscore or hyphen. Required.
FeastProject string `json:"feastProject"`
FeastProjectDir *FeastProjectDir `json:"feastProjectDir,omitempty"`
Services *FeatureStoreServices `json:"services,omitempty"`
AuthzConfig *AuthzConfig `json:"authz,omitempty"`
CronJob *FeastCronJob `json:"cronJob,omitempty"`
BatchEngine *BatchEngineConfig `json:"batchEngine,omitempty"`
// DataQualityMonitoring configures Data Quality Monitoring behaviour.
// +optional
DataQualityMonitoring *DataQualityMonitoringConfig `json:"dataQualityMonitoring,omitempty"`
// Replicas is the desired number of pod replicas. Used by the scale sub-resource.
// Mutually exclusive with services.scaling.autoscaling.
// +kubebuilder:default=1
// +kubebuilder:validation:Minimum=1
Replicas *int32 `json:"replicas,omitempty"`
// Materialization controls feature materialization behavior (batch size, pull strategy).
// Written into feature_store.yaml for all service pods.
// +optional
Materialization *MaterializationConfig `json:"materialization,omitempty"`
// OpenLineage enables OpenLineage data lineage tracking for Feast operations.
// Written into feature_store.yaml for all service pods.
// +optional
OpenLineage *OpenLineageConfig `json:"openlineage,omitempty"`
}
// FeastProjectDir defines how to create the feast project directory.
// +kubebuilder:validation:XValidation:rule="[has(self.git), has(self.init)].exists_one(c, c)",message="One selection required between init or git."
type FeastProjectDir struct {
Git *GitCloneOptions `json:"git,omitempty"`
Init *FeastInitOptions `json:"init,omitempty"`
}
// GitCloneOptions describes how a clone should be performed.
// +kubebuilder:validation:XValidation:rule="has(self.featureRepoPath) ? !self.featureRepoPath.startsWith('/') : true",message="RepoPath must be a file name only, with no slashes."
type GitCloneOptions struct {
// The repository URL to clone from.
URL string `json:"url"`
// Reference to a branch / tag / commit
Ref string `json:"ref,omitempty"`
// Configs passed to git via `-c`
// e.g. http.sslVerify: 'false'
// OR 'url."https://api:\${TOKEN}@github.com/".insteadOf': 'https://github.com/'
Configs map[string]string `json:"configs,omitempty"`
// FeatureRepoPath is the relative path to the feature repo subdirectory. Default is 'feature_repo'.
FeatureRepoPath string `json:"featureRepoPath,omitempty"`
Env *[]corev1.EnvVar `json:"env,omitempty"`
EnvFrom *[]corev1.EnvFromSource `json:"envFrom,omitempty"`
}
// FeastInitOptions defines how to run a `feast init`.
type FeastInitOptions struct {
Minimal bool `json:"minimal,omitempty"`
// Template for the created project
// +kubebuilder:validation:Enum=local;gcp;aws;snowflake;spark;postgres;hbase;cassandra;hazelcast;couchbase;clickhouse;milvus;ray;ray_rag;pytorch_nlp
Template string `json:"template,omitempty"`
}
// FeastCronJob defines a CronJob to execute against a Feature Store deployment.
type FeastCronJob struct {
// Annotations to be added to the CronJob metadata.
Annotations map[string]string `json:"annotations,omitempty"`
// Specification of the desired behavior of a job.
JobSpec *JobSpec `json:"jobSpec,omitempty"`
ContainerConfigs *CronJobContainerConfigs `json:"containerConfigs,omitempty"`
// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
Schedule string `json:"schedule,omitempty"`
// The time zone name for the given schedule, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
// If not specified, this will default to the time zone of the kube-controller-manager process.
// The set of valid time zone names and the time zone offset is loaded from the system-wide time zone
// database by the API server during CronJob validation and the controller manager during execution.
// If no system-wide time zone database can be found a bundled version of the database is used instead.
// If the time zone name becomes invalid during the lifetime of a CronJob or due to a change in host
// configuration, the controller will stop creating new new Jobs and will create a system event with the
// reason UnknownTimeZone.
// More information can be found in https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#time-zones
TimeZone *string `json:"timeZone,omitempty"`
// Optional deadline in seconds for starting the job if it misses scheduled
// time for any reason. Missed jobs executions will be counted as failed ones.
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`
// Specifies how to treat concurrent executions of a Job.
// Valid values are:
//
// - "Allow" (default): allows CronJobs to run concurrently;
// - "Forbid": forbids concurrent runs, skipping next run if previous run hasn't finished yet;
// - "Replace": cancels currently running job and replaces it with a new one
ConcurrencyPolicy batchv1.ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`
// This flag tells the controller to suspend subsequent executions, it does
// not apply to already started executions.
Suspend *bool `json:"suspend,omitempty"`
// The number of successful finished jobs to retain. Value must be non-negative integer.
SuccessfulJobsHistoryLimit *int32 `json:"successfulJobsHistoryLimit,omitempty"`
// The number of failed finished jobs to retain. Value must be non-negative integer.
FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"`
}
// BatchEngineConfig defines the batch compute engine configuration.
type BatchEngineConfig struct {
// Reference to a ConfigMap containing the batch engine configuration.
// The ConfigMap should contain YAML-formatted config with 'type' and engine-specific fields.
ConfigMapRef *corev1.LocalObjectReference `json:"configMapRef,omitempty"`
// Key name in the ConfigMap. Defaults to "config" if not specified.
ConfigMapKey string `json:"configMapKey,omitempty"`
}
// DataQualityMonitoringConfig defines the Data Quality Monitoring configuration.
type DataQualityMonitoringConfig struct {
// AutoBaseline controls whether baseline distribution is computed automatically on feast apply. Defaults to true.
// +kubebuilder:default=true
AutoBaseline *bool `json:"autoBaseline,omitempty"`
}
// JobSpec describes how the job execution will look like.
type JobSpec struct {
// PodTemplateAnnotations are annotations to be applied to the CronJob's PodTemplate
// metadata. This is separate from the CronJob-level annotations and must be
// set explicitly by users if they want annotations on the PodTemplate.
PodTemplateAnnotations map[string]string `json:"podTemplateAnnotations,omitempty"`
// Specifies the maximum desired number of pods the job should
// run at any given time. The actual number of pods running in steady state will
// be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism),
// i.e. when the work left to do is less than max parallelism.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
Parallelism *int32 `json:"parallelism,omitempty"`
// Specifies the desired number of successfully finished pods the
// job should be run with. Setting to null means that the success of any
// pod signals the success of all pods, and allows parallelism to have any positive
// value. Setting to 1 means that parallelism is limited to 1 and the success of that
// pod signals the success of the job.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
Completions *int32 `json:"completions,omitempty"`
// Specifies the duration in seconds relative to the startTime that the job
// may be continuously active before the system tries to terminate it; value
// must be positive integer. If a Job is suspended (at creation or through an
// update), this timer will effectively be stopped and reset when the Job is
// resumed again.
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
// Specifies the policy of handling failed pods. In particular, it allows to
// specify the set of actions and conditions which need to be
// satisfied to take the associated action.
// If empty, the default behaviour applies - the counter of failed pods,
// represented by the jobs's .status.failed field, is incremented and it is
// checked against the backoffLimit. This field cannot be used in combination
// with restartPolicy=OnFailure.
//
// This field is beta-level. It can be used when the `JobPodFailurePolicy`
// feature gate is enabled (enabled by default).
PodFailurePolicy *batchv1.PodFailurePolicy `json:"podFailurePolicy,omitempty"`
// Specifies the number of retries before marking this job failed.
BackoffLimit *int32 `json:"backoffLimit,omitempty"`
// Specifies the limit for the number of retries within an
// index before marking this index as failed. When enabled the number of
// failures per index is kept in the pod's
// batch.kubernetes.io/job-index-failure-count annotation. It can only
// be set when Job's completionMode=Indexed, and the Pod's restart
// policy is Never. The field is immutable.
// This field is beta-level. It can be used when the `JobBackoffLimitPerIndex`
// feature gate is enabled (enabled by default).
BackoffLimitPerIndex *int32 `json:"backoffLimitPerIndex,omitempty"`
// Specifies the maximal number of failed indexes before marking the Job as
// failed, when backoffLimitPerIndex is set. Once the number of failed
// indexes exceeds this number the entire Job is marked as Failed and its
// execution is terminated. When left as null the job continues execution of
// all of its indexes and is marked with the `Complete` Job condition.
// It can only be specified when backoffLimitPerIndex is set.
// It can be null or up to completions. It is required and must be
// less than or equal to 10^4 when is completions greater than 10^5.
// This field is beta-level. It can be used when the `JobBackoffLimitPerIndex`
// feature gate is enabled (enabled by default).
MaxFailedIndexes *int32 `json:"maxFailedIndexes,omitempty"`
// ttlSecondsAfterFinished limits the lifetime of a Job that has finished
// execution (either Complete or Failed). If this field is set,
// ttlSecondsAfterFinished after the Job finishes, it is eligible to be
// automatically deleted. When the Job is being deleted, its lifecycle
// guarantees (e.g. finalizers) will be honored. If this field is unset,
// the Job won't be automatically deleted. If this field is set to zero,
// the Job becomes eligible to be deleted immediately after it finishes.
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`
// completionMode specifies how Pod completions are tracked. It can be
// `NonIndexed` (default) or `Indexed`.
//
// `NonIndexed` means that the Job is considered complete when there have
// been .spec.completions successfully completed Pods. Each Pod completion is
// homologous to each other.
//
// `Indexed` means that the Pods of a
// Job get an associated completion index from 0 to (.spec.completions - 1),
// available in the annotation batch.kubernetes.io/job-completion-index.
// The Job is considered complete when there is one successfully completed Pod
// for each index.
// When value is `Indexed`, .spec.completions must be specified and
// `.spec.parallelism` must be less than or equal to 10^5.
// In addition, The Pod name takes the form
// `$(job-name)-$(index)-$(random-string)`,
// the Pod hostname takes the form `$(job-name)-$(index)`.
//
// More completion modes can be added in the future.
// If the Job controller observes a mode that it doesn't recognize, which
// is possible during upgrades due to version skew, the controller
// skips updates for the Job.
CompletionMode *batchv1.CompletionMode `json:"completionMode,omitempty"`
// suspend specifies whether the Job controller should create Pods or not. If
// a Job is created with suspend set to true, no Pods are created by the Job
// controller. If a Job is suspended after creation (i.e. the flag goes from
// false to true), the Job controller will delete all active Pods associated
// with this Job. Users must design their workload to gracefully handle this.
// Suspending a Job will reset the StartTime field of the Job, effectively
// resetting the ActiveDeadlineSeconds timer too.
//
Suspend *bool `json:"suspend,omitempty"`
// podReplacementPolicy specifies when to create replacement Pods.
// Possible values are:
// - TerminatingOrFailed means that we recreate pods
// when they are terminating (has a metadata.deletionTimestamp) or failed.
// - Failed means to wait until a previously created Pod is fully terminated (has phase
// Failed or Succeeded) before creating a replacement Pod.
//
// When using podFailurePolicy, Failed is the the only allowed value.
// TerminatingOrFailed and Failed are allowed values when podFailurePolicy is not in use.
// This is an beta field. To use this, enable the JobPodReplacementPolicy feature toggle.
// This is on by default.
PodReplacementPolicy *batchv1.PodReplacementPolicy `json:"podReplacementPolicy,omitempty"`
}
// FeatureStoreServices defines the desired feast services. An ephemeral onlineStore feature server is deployed by default.
type FeatureStoreServices struct {
OfflineStore *OfflineStore `json:"offlineStore,omitempty"`
OnlineStore *OnlineStore `json:"onlineStore,omitempty"`
Registry *Registry `json:"registry,omitempty"`
// Creates a UI server container
UI *ServerConfigs `json:"ui,omitempty"`
DeploymentStrategy *appsv1.DeploymentStrategy `json:"deploymentStrategy,omitempty"`
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
// PodAnnotations are annotations to be applied to the Deployment's PodTemplate metadata.
// This enables annotation-driven integrations like OpenTelemetry auto-instrumentation,
// Istio sidecar injection, Vault agent injection, etc.
// +optional
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
// Disable the 'feast repo initialization' initContainer
DisableInitContainers bool `json:"disableInitContainers,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).
Volumes []corev1.Volume `json:"volumes,omitempty"`
// Scaling configures horizontal scaling for the FeatureStore deployment (e.g. HPA autoscaling).
// For static replicas, use spec.replicas instead.
Scaling *ScalingConfig `json:"scaling,omitempty"`
// PodDisruptionBudgets configures a PodDisruptionBudget for the FeatureStore deployment.
// Only created when scaling is enabled (replicas > 1 or autoscaling).
// +optional
PodDisruptionBudgets *PDBConfig `json:"podDisruptionBudgets,omitempty"`
// TopologySpreadConstraints defines how pods are spread across topology domains.
// When scaling is enabled and this is not set, the operator auto-injects a soft
// zone-spread constraint (whenUnsatisfiable: ScheduleAnyway).
// Set to an empty array to disable auto-injection.
// +optional
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
// Affinity defines the pod scheduling constraints for the FeatureStore deployment.
// When scaling is enabled and this is not set, the operator auto-injects a soft
// pod anti-affinity rule to prefer spreading pods across nodes.
// +optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// ResourceClaims defines which ResourceClaims must be allocated
// and reserved before the Pod is allowed to start. The resources
// will be made available to those containers which consume them
// by name.
//
// +patchMergeKey=name
// +patchStrategy=merge,retainKeys
// +listType=map
// +listMapKey=name
// +optional
ResourceClaims []corev1.PodResourceClaim `json:"resourceClaims,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name"`
}
// ScalingConfig configures horizontal scaling for the FeatureStore deployment.
type ScalingConfig struct {
// Autoscaling configures a HorizontalPodAutoscaler for the FeatureStore deployment.
// Mutually exclusive with spec.replicas.
// +optional
Autoscaling *AutoscalingConfig `json:"autoscaling,omitempty"`
}
// AutoscalingConfig defines HPA settings for the FeatureStore deployment.
type AutoscalingConfig struct {
// MinReplicas is the lower limit for the number of replicas. Defaults to 1.
// +kubebuilder:validation:Minimum=1
// +optional
MinReplicas *int32 `json:"minReplicas,omitempty"`
// MaxReplicas is the upper limit for the number of replicas. Required.
// +kubebuilder:validation:Minimum=1
MaxReplicas int32 `json:"maxReplicas"`
// Metrics contains the specifications for which to use to calculate the desired replica count.
// If not set, defaults to 80% CPU utilization.
// +optional
Metrics []autoscalingv2.MetricSpec `json:"metrics,omitempty"`
// Behavior configures the scaling behavior of the target.
// +optional
Behavior *autoscalingv2.HorizontalPodAutoscalerBehavior `json:"behavior,omitempty"`
}
// PDBConfig configures a PodDisruptionBudget for the FeatureStore deployment.
// Exactly one of minAvailable or maxUnavailable must be set.
// +kubebuilder:validation:XValidation:rule="[has(self.minAvailable), has(self.maxUnavailable)].exists_one(c, c)",message="Exactly one of minAvailable or maxUnavailable must be set."
type PDBConfig struct {
// MinAvailable specifies the minimum number/percentage of pods that must remain available.
// Mutually exclusive with maxUnavailable.
// +optional
MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"`
// MaxUnavailable specifies the maximum number/percentage of pods that can be unavailable.
// Mutually exclusive with minAvailable.
// +optional
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
}
// OfflineStore configures the offline store service
type OfflineStore struct {
// Creates a remote offline server container
Server *ServerConfigs `json:"server,omitempty"`
Persistence *OfflineStorePersistence `json:"persistence,omitempty"`
}
// OfflineStorePersistence configures the persistence settings for the offline store service
// +kubebuilder:validation:XValidation:rule="[has(self.file), has(self.store)].exists_one(c, c)",message="One selection required between file or store."
type OfflineStorePersistence struct {
FilePersistence *OfflineStoreFilePersistence `json:"file,omitempty"`
DBPersistence *OfflineStoreDBStorePersistence `json:"store,omitempty"`
}
// OfflineStoreFilePersistence configures the file-based persistence for the offline store service
type OfflineStoreFilePersistence struct {
// +kubebuilder:validation:Enum=file;dask;duckdb
Type string `json:"type,omitempty"`
PvcConfig *PvcConfig `json:"pvc,omitempty"`
}
var ValidOfflineStoreFilePersistenceTypes = []string{
"dask",
"duckdb",
"file",
}
// OfflineStoreDBStorePersistence configures the DB store persistence for the offline store service
type OfflineStoreDBStorePersistence struct {
// Type of the persistence type you want to use.
// +kubebuilder:validation:Enum=snowflake.offline;bigquery;redshift;spark;postgres;trino;athena;mssql;couchbase.offline;clickhouse;ray;oracle
Type string `json:"type"`
// Data store parameters should be placed as-is from the "feature_store.yaml" under the secret key. "registry_type" & "type" fields should be removed.
SecretRef corev1.LocalObjectReference `json:"secretRef"`
// By default, the selected store "type" is used as the SecretKeyName
SecretKeyName string `json:"secretKeyName,omitempty"`
}
var ValidOfflineStoreDBStorePersistenceTypes = []string{
"snowflake.offline",
"bigquery",
"redshift",
"spark",
"postgres",
"trino",
"athena",
"mssql",
"couchbase.offline",
"clickhouse",
"ray",
"oracle",
}
// OnlineStore configures the online store service
type OnlineStore struct {
// Creates a feature server container
Server *ServerConfigs `json:"server,omitempty"`
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
// Serving configures the Feast feature_server section written into feature_store.yaml for the online serve pod.
// Controls metrics granularity, offline push batching, and MCP.
// +optional
Serving *ServingConfig `json:"serving,omitempty"`
}
// ServingConfig configures the feature_server section of the generated feature_store.yaml.
// When Mcp is set, the feature server type is switched to "mcp"; otherwise "local" is used.
type ServingConfig struct {
// Metrics configures per-category Prometheus metrics for the feature server.
// Coexists with the server.metrics bool flag — both can be set simultaneously.
// +optional
Metrics *ServingMetricsConfig `json:"metrics,omitempty"`
// OfflinePushBatching batches writes to the offline store via the /push endpoint.
// +optional
OfflinePushBatching *OfflinePushBatchingConfig `json:"offlinePushBatching,omitempty"`
// Mcp enables MCP (Model Context Protocol) server support. When set, feature server type is "mcp".
// +optional
Mcp *McpConfig `json:"mcp,omitempty"`
}
// ServingMetricsConfig controls per-category Prometheus metrics for the feature server.
// Setting Enabled to true activates the metrics HTTP server on port 8000.
// All metric categories default to true when enabled; use Categories to selectively disable them.
type ServingMetricsConfig struct {
// Enable the Prometheus metrics endpoint on port 8000.
Enabled bool `json:"enabled"`
// Categories selectively enables or disables individual Feast metric categories.
// Keys are Feast MetricsConfig field names (e.g. "resource", "request",
// "online_features", "push", "materialization", "freshness"). Omitted keys
// default to true when metrics is enabled.
// +optional
Categories map[string]bool `json:"categories,omitempty"`
}
// OfflinePushBatchingConfig controls batching of writes to the offline store via the /push endpoint.
// Recommended for high-throughput push workloads (streaming pipelines, IoT) to prevent OOM.
type OfflinePushBatchingConfig struct {
// Enable offline push batching.
Enabled bool `json:"enabled"`
// Maximum number of rows per offline write batch.
// +kubebuilder:validation:Minimum=1
// +optional
BatchSize *int32 `json:"batchSize,omitempty"`
// Seconds between batch flushes to the offline store.
// +kubebuilder:validation:Minimum=1
// +optional
BatchIntervalSeconds *int32 `json:"batchIntervalSeconds,omitempty"`
}
// McpConfig enables MCP (Model Context Protocol) server support in the feature server.
// When this field is set on ServingConfig, the feature server type is switched to "mcp".
type McpConfig struct {
// Enable the MCP server.
Enabled bool `json:"enabled"`
// MCP server name for identification. Defaults to "feast-mcp-server".
// +optional
ServerName *string `json:"serverName,omitempty"`
// MCP server version string. Defaults to "1.0.0".
// +optional
ServerVersion *string `json:"serverVersion,omitempty"`
// MCP transport protocol.
// +kubebuilder:validation:Enum=sse;http
// +optional
Transport *string `json:"transport,omitempty"`
}
// OnlineStorePersistence configures the persistence settings for the online store service
// +kubebuilder:validation:XValidation:rule="[has(self.file), has(self.store)].exists_one(c, c)",message="One selection required between file or store."
type OnlineStorePersistence struct {
FilePersistence *OnlineStoreFilePersistence `json:"file,omitempty"`
DBPersistence *OnlineStoreDBStorePersistence `json:"store,omitempty"`
}
// OnlineStoreFilePersistence configures the file-based persistence for the online store service
// +kubebuilder:validation:XValidation:rule="(!has(self.pvc) && has(self.path)) ? self.path.startsWith('/') : true",message="Ephemeral stores must have absolute paths."
// +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."
// +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."
type OnlineStoreFilePersistence struct {
Path string `json:"path,omitempty"`
PvcConfig *PvcConfig `json:"pvc,omitempty"`
}
// OnlineStoreDBStorePersistence configures the DB store persistence for the online store service
type OnlineStoreDBStorePersistence struct {
// Type of the persistence type you want to use.
// +kubebuilder:validation:Enum=snowflake.online;redis;datastore;dynamodb;bigtable;postgres;cassandra;mysql;hazelcast;singlestore;hbase;elasticsearch;qdrant;couchbase.online;milvus;hybrid;mongodb
Type string `json:"type"`
// Data store parameters should be placed as-is from the "feature_store.yaml" under the secret key. "registry_type" & "type" fields should be removed.
SecretRef corev1.LocalObjectReference `json:"secretRef"`
// By default, the selected store "type" is used as the SecretKeyName
SecretKeyName string `json:"secretKeyName,omitempty"`
}
var ValidOnlineStoreDBStorePersistenceTypes = []string{
"snowflake.online",
"redis",
"datastore",
"dynamodb",
"bigtable",
"postgres",
"cassandra",
"mysql",
"hazelcast",
"singlestore",
"hbase",
"elasticsearch",
"qdrant",
"couchbase.online",
"milvus",
"hybrid",
"mongodb",
}
// LocalRegistryConfig configures the registry service
type LocalRegistryConfig struct {
// Creates a registry server container
Server *RegistryServerConfigs `json:"server,omitempty"`
Persistence *RegistryPersistence `json:"persistence,omitempty"`
}
// RegistryPersistence configures the persistence settings for the registry service
// +kubebuilder:validation:XValidation:rule="[has(self.file), has(self.store)].exists_one(c, c)",message="One selection required between file or store."
type RegistryPersistence struct {
FilePersistence *RegistryFilePersistence `json:"file,omitempty"`
DBPersistence *RegistryDBStorePersistence `json:"store,omitempty"`
}
// RegistryFilePersistence configures the file-based persistence for the registry service
// +kubebuilder:validation:XValidation:rule="(!has(self.pvc) && has(self.path)) ? (self.path.startsWith('/') || self.path.startsWith('s3://') || self.path.startsWith('gs://')) : true",message="Registry files must use absolute paths or be S3 ('s3://') or GS ('gs://') object store URIs."
// +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."
// +kubebuilder:validation:XValidation:rule="(has(self.pvc) && has(self.path)) ? !(self.path.startsWith('s3://') || self.path.startsWith('gs://')) : true",message="PVC persistence does not support S3 or GS object store URIs."
// +kubebuilder:validation:XValidation:rule="(has(self.s3_additional_kwargs) && has(self.path)) ? self.path.startsWith('s3://') : true",message="Additional S3 settings are available only for S3 object store URIs."
type RegistryFilePersistence struct {
Path string `json:"path,omitempty"`
PvcConfig *PvcConfig `json:"pvc,omitempty"`
S3AdditionalKwargs *map[string]string `json:"s3_additional_kwargs,omitempty"`
// CacheTTLSeconds defines the TTL (in seconds) for the registry cache.
// +kubebuilder:validation:Minimum=0
// +optional
CacheTTLSeconds *int32 `json:"cache_ttl_seconds,omitempty"`
// CacheMode defines the registry cache update strategy.
// Allowed values are "sync" and "thread".
// +kubebuilder:validation:Enum=none;sync;thread
// +optional
CacheMode *string `json:"cache_mode,omitempty"`
}
// RegistryDBStorePersistence configures the DB store persistence for the registry service
type RegistryDBStorePersistence struct {
// Type of the persistence type you want to use.
// +kubebuilder:validation:Enum=sql;snowflake.registry
Type string `json:"type"`
// Data store parameters should be placed as-is from the "feature_store.yaml" under the secret key. "registry_type" & "type" fields should be removed.
SecretRef corev1.LocalObjectReference `json:"secretRef"`
// By default, the selected store "type" is used as the SecretKeyName
SecretKeyName string `json:"secretKeyName,omitempty"`
}
var ValidRegistryDBStorePersistenceTypes = []string{
"sql",
"snowflake.registry",
}
// PvcConfig defines the settings for a persistent file store based on PVCs.
// We can refer to an existing PVC using the `Ref` field, or create a new one using the `Create` field.
// +kubebuilder:validation:XValidation:rule="[has(self.ref), has(self.create)].exists_one(c, c)",message="One selection is required between ref and create."
// +kubebuilder:validation:XValidation:rule="self.mountPath.matches('^/[^:]*$')",message="Mount path must start with '/' and must not contain ':'"
type PvcConfig struct {
// Reference to an existing field
Ref *corev1.LocalObjectReference `json:"ref,omitempty"`
// Settings for creating a new PVC
Create *PvcCreate `json:"create,omitempty"`
// MountPath within the container at which the volume should be mounted.
// Must start by "/" and cannot contain ':'.
MountPath string `json:"mountPath"`
}
// PvcCreate defines the immutable settings to create a new PVC mounted at the given path.
// The PVC name is the same as the associated deployment & feast service name.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="PvcCreate is immutable"
type PvcCreate struct {
// AccessModes k8s persistent volume access modes. Defaults to ["ReadWriteOnce"].
AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"`
// StorageClassName is the name of an existing StorageClass to which this persistent volume belongs. Empty value
// means that this volume does not belong to any StorageClass and the cluster default will be used.
StorageClassName *string `json:"storageClassName,omitempty"`
// Resources describes the storage resource requirements for a volume.
// Default requested storage size depends on the associated service:
// - 10Gi for offline store
// - 5Gi for online store
// - 5Gi for registry
Resources corev1.VolumeResourceRequirements `json:"resources,omitempty"`
}
// Registry configures the registry service. One selection is required. Local is the default setting.
// +kubebuilder:validation:XValidation:rule="[has(self.local), has(self.remote)].exists_one(c, c)",message="One selection required."
type Registry struct {
Local *LocalRegistryConfig `json:"local,omitempty"`
Remote *RemoteRegistryConfig `json:"remote,omitempty"`
}
// RemoteRegistryConfig points to a remote feast registry server. When set, the operator will not deploy a registry for this FeatureStore CR.
// Instead, this FeatureStore CR's online/offline services will use a remote registry. One selection is required.
// +kubebuilder:validation:XValidation:rule="[has(self.hostname), has(self.feastRef)].exists_one(c, c)",message="One selection required."
type RemoteRegistryConfig struct {
// Host address of the remote registry service - <domain>:<port>, e.g. `registry.<namespace>.svc.cluster.local:80`
Hostname *string `json:"hostname,omitempty"`
// Reference to an existing `FeatureStore` CR in the same k8s cluster.
FeastRef *FeatureStoreRef `json:"feastRef,omitempty"`
TLS *TlsRemoteRegistryConfigs `json:"tls,omitempty"`
}
// FeatureStoreRef defines which existing FeatureStore's registry should be used
type FeatureStoreRef struct {
// Name of the FeatureStore
Name string `json:"name"`
// Namespace of the FeatureStore
Namespace string `json:"namespace,omitempty"`
}
// ServerConfigs creates a server for the feast service, with specified container configurations.
type ServerConfigs struct {
ContainerConfigs `json:",inline"`
TLS *TlsConfigs `json:"tls,omitempty"`
// LogLevel sets the logging level for the server
// Allowed values: "debug", "info", "warning", "error", "critical".
// +kubebuilder:validation:Enum=debug;info;warning;error;critical
LogLevel *string `json:"logLevel,omitempty"`
// Metrics exposes Prometheus-compatible metrics for the Feast server when enabled.
Metrics *bool `json:"metrics,omitempty"`
// VolumeMounts defines the list of volumes that should be mounted into the feast container.
// This allows attaching persistent storage, config files, secrets, or other resources
// required by the Feast components. Ensure that each volume mount has a corresponding
// volume definition in the Volumes field.
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
// WorkerConfigs defines the worker configuration for the Feast server.
// These options are primarily used for production deployments to optimize performance.
WorkerConfigs *WorkerConfigs `json:"workerConfigs,omitempty"`
}
// WorkerConfigs defines the worker configuration for Feast servers.
// These settings control gunicorn worker processes for production deployments.
type WorkerConfigs struct {
// Workers is the number of worker processes. Use -1 to auto-calculate based on CPU cores (2 * CPU + 1).
// Defaults to 1 if not specified.
// +kubebuilder:validation:Minimum=-1
// +optional
Workers *int32 `json:"workers,omitempty"`
// WorkerConnections is the maximum number of simultaneous clients per worker process.
// Defaults to 1000.
// +kubebuilder:validation:Minimum=1
// +optional
WorkerConnections *int32 `json:"workerConnections,omitempty"`
// MaxRequests is the maximum number of requests a worker will process before restarting.
// This helps prevent memory leaks. Defaults to 1000.
// +kubebuilder:validation:Minimum=0
// +optional
MaxRequests *int32 `json:"maxRequests,omitempty"`
// MaxRequestsJitter is the maximum jitter to add to max-requests to prevent
// thundering herd effect on worker restart. Defaults to 50.
// +kubebuilder:validation:Minimum=0
// +optional
MaxRequestsJitter *int32 `json:"maxRequestsJitter,omitempty"`
// KeepAliveTimeout is the timeout for keep-alive connections in seconds.
// Defaults to 30.
// +kubebuilder:validation:Minimum=1
// +optional
KeepAliveTimeout *int32 `json:"keepAliveTimeout,omitempty"`
// RegistryTTLSeconds is the number of seconds after which the registry is refreshed.
// Higher values reduce refresh overhead but increase staleness. Defaults to 60.
// +kubebuilder:validation:Minimum=0
// +optional
RegistryTTLSeconds *int32 `json:"registryTTLSeconds,omitempty"`
}
// RegistryServerConfigs creates a registry server for the feast service, with specified container configurations.
// +kubebuilder:validation:XValidation:rule="self.restAPI == true || self.grpc == true || !has(self.grpc)", message="At least one of restAPI or grpc must be true"
// +kubebuilder:validation:XValidation:rule="!has(self.mcp) || !self.mcp.enabled || (has(self.restAPI) && self.restAPI == true)", message="MCP requires restAPI to be true"
type RegistryServerConfigs struct {
ServerConfigs `json:",inline"`
// Enable REST API registry server.
RestAPI *bool `json:"restAPI,omitempty"`
// Enable gRPC registry server. Defaults to true if unset.
GRPC *bool `json:"grpc,omitempty"`
// Mcp enables MCP (Model Context Protocol) on the REST registry server.
// Requires restAPI to be true. Reuses the same McpConfig struct as the online store.
// +optional
Mcp *McpConfig `json:"mcp,omitempty"`
}
// CronJobContainerConfigs k8s container settings for the CronJob
type CronJobContainerConfigs struct {
ContainerConfigs `json:",inline"`
// Array of commands to be executed (in order) against a Feature Store deployment.
// Defaults to "feast apply" & "feast materialize-incremental $(date -u +'%Y-%m-%dT%H:%M:%S')"
Commands []string `json:"commands,omitempty"`
}
// ContainerConfigs k8s container settings for the server
type ContainerConfigs struct {
DefaultCtrConfigs `json:",inline"`
OptionalCtrConfigs `json:",inline"`
}
// DefaultCtrConfigs k8s container settings that are applied by default
type DefaultCtrConfigs struct {
Image *string `json:"image,omitempty"`
}
// OptionalCtrConfigs k8s container settings that are optional
type OptionalCtrConfigs struct {
Env *[]corev1.EnvVar `json:"env,omitempty"`
EnvFrom *[]corev1.EnvFromSource `json:"envFrom,omitempty"`
ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
NodeSelector *map[string]string `json:"nodeSelector,omitempty"`
}
// AuthzConfig defines the authorization settings for the deployed Feast services.
// +kubebuilder:validation:XValidation:rule="[has(self.kubernetes), has(self.oidc)].exists_one(c, c)",message="One selection required between kubernetes or oidc."
type AuthzConfig struct {
KubernetesAuthz *KubernetesAuthz `json:"kubernetes,omitempty"`
OidcAuthz *OidcAuthz `json:"oidc,omitempty"`
}
// KubernetesAuthz provides a way to define the authorization settings using Kubernetes RBAC resources.
// https://kubernetes.io/docs/reference/access-authn-authz/rbac/
type KubernetesAuthz struct {
// The Kubernetes RBAC roles to be deployed in the same namespace of the FeatureStore.
// Roles are managed by the operator and created with an empty list of rules.
// See the Feast permission model at https://docs.feast.dev/getting-started/concepts/permission
// The feature store admin is not obligated to manage roles using the Feast operator, roles can be managed independently.
// This configuration option is only providing a way to automate this procedure.
// Important note: the operator cannot ensure that these roles will match the ones used in the configured Feast permissions.
Roles []string `json:"roles,omitempty"`
}
// OidcAuthz defines the authorization settings for deployments using an Open ID Connect identity provider.
// https://auth0.com/docs/authenticate/protocols/openid-connect-protocol
type OidcAuthz struct {
// OIDC issuer URL. The operator appends /.well-known/openid-configuration to derive the discovery endpoint.
// +optional
// +kubebuilder:validation:Pattern=`^https://\S+$`
IssuerUrl string `json:"issuerUrl,omitempty"`
// Secret with OIDC properties (auth_discovery_url, client_id, client_secret). issuerUrl takes precedence.
// +optional
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
// Key in the Secret containing all OIDC properties as a YAML value. If unset, each key is a property.
// +optional
SecretKeyName string `json:"secretKeyName,omitempty"`
// Env var name for client pods to read an OIDC token from. Sets token_env_var in client config.
// +optional
TokenEnvVar *string `json:"tokenEnvVar,omitempty"`
// Verify SSL certificates for the OIDC provider. Defaults to true.
// +optional
VerifySSL *bool `json:"verifySSL,omitempty"`
// ConfigMap with the CA certificate for self-signed OIDC providers. Auto-detected on RHOAI/ODH.
// +optional
CACertConfigMap *OidcCACertConfigMap `json:"caCertConfigMap,omitempty"`
}
// OidcCACertConfigMap references a ConfigMap containing a CA certificate for OIDC provider TLS.
type OidcCACertConfigMap struct {
// ConfigMap name.
Name string `json:"name"`
// Key in the ConfigMap holding the PEM certificate. Defaults to "ca-bundle.crt".
// +optional
Key string `json:"key,omitempty"`
}
// TlsConfigs configures server TLS for a feast service. in an openshift cluster, this is configured by default using service serving certificates.
// +kubebuilder:validation:XValidation:rule="(!has(self.disable) || !self.disable) ? has(self.secretRef) : true",message="`secretRef` required if `disable` is false."
type TlsConfigs struct {
// references the local k8s secret where the TLS key and cert reside
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
SecretKeyNames SecretKeyNames `json:"secretKeyNames,omitempty"`
// will disable TLS for the feast service. useful in an openshift cluster, for example, where TLS is configured by default
Disable *bool `json:"disable,omitempty"`
}
// `secretRef` required if `disable` is false.
func (tls *TlsConfigs) IsTLS() bool {
if tls != nil {
if tls.Disable != nil && *tls.Disable {
return false
} else if tls.SecretRef == nil {
return false
}
return true
}
return false
}
// TlsRemoteRegistryConfigs configures client TLS for a remote feast registry. in an openshift cluster, this is configured by default when the remote feast registry is using service serving certificates.
type TlsRemoteRegistryConfigs struct {
// references the local k8s configmap where the TLS cert resides
ConfigMapRef corev1.LocalObjectReference `json:"configMapRef"`
// defines the configmap key name for the client TLS cert.
CertName string `json:"certName"`
}
// SecretKeyNames defines the secret key names for the TLS key and cert.
type SecretKeyNames struct {
// defaults to "tls.crt"
TlsCrt string `json:"tlsCrt,omitempty"`
// defaults to "tls.key"
TlsKey string `json:"tlsKey,omitempty"`
}
// FeatureStoreStatus defines the observed state of FeatureStore
type FeatureStoreStatus struct {
// Shows the currently applied feast configuration, including any pertinent defaults
Applied FeatureStoreSpec `json:"applied,omitempty"`
// ConfigMap in this namespace containing a client `feature_store.yaml` for this feast deployment
ClientConfigMap string `json:"clientConfigMap,omitempty"`
// CronJob in this namespace for this feast deployment
CronJob string `json:"cronJob,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
FeastVersion string `json:"feastVersion,omitempty"`
Phase string `json:"phase,omitempty"`
ServiceHostnames ServiceHostnames `json:"serviceHostnames,omitempty"`
// Replicas is the current number of ready pod replicas (used by the scale sub-resource).
Replicas int32 `json:"replicas,omitempty"`
// Selector is the label selector for pods managed by the FeatureStore deployment (used by the scale sub-resource).
Selector string `json:"selector,omitempty"`
// ScalingStatus reports the current scaling state of the FeatureStore deployment.
ScalingStatus *ScalingStatus `json:"scalingStatus,omitempty"`
}
// ScalingStatus reports the observed scaling state.
type ScalingStatus struct {
// CurrentReplicas is the current number of pod replicas.
CurrentReplicas int32 `json:"currentReplicas,omitempty"`
// DesiredReplicas is the desired number of pod replicas.
DesiredReplicas int32 `json:"desiredReplicas,omitempty"`
}
// ServiceHostnames defines the service hostnames in the format of <domain>:<port>, e.g. example.svc.cluster.local:80
type ServiceHostnames struct {
OfflineStore string `json:"offlineStore,omitempty"`
OnlineStore string `json:"onlineStore,omitempty"`
Registry string `json:"registry,omitempty"`
RegistryRest string `json:"registryRest,omitempty"`
UI string `json:"ui,omitempty"`
}
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:shortName=feast
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
// +kubebuilder:storageversion
// FeatureStore is the Schema for the featurestores API
type FeatureStore struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec FeatureStoreSpec `json:"spec,omitempty"`
Status FeatureStoreStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// FeatureStoreList contains a list of FeatureStore
type FeatureStoreList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []FeatureStore `json:"items"`
}
func init() {
SchemeBuilder.Register(&FeatureStore{}, &FeatureStoreList{})
}