diff --git a/infra/feast-operator/config/samples/v1alpha1_featurestore_db_persistence_volumes.yaml b/infra/feast-operator/config/samples/v1alpha1_featurestore_db_persistence_volumes.yaml new file mode 100644 index 0000000000..f9652a7fea --- /dev/null +++ b/infra/feast-operator/config/samples/v1alpha1_featurestore_db_persistence_volumes.yaml @@ -0,0 +1,86 @@ +apiVersion: v1 +kind: Secret +metadata: + name: postgres-secret + namespace: test + labels: + app: postgres +stringData: + POSTGRES_DB: feast + POSTGRES_USER: feast + POSTGRES_PASSWORD: feast +--- +apiVersion: v1 +kind: Secret +metadata: + name: feast-data-stores + namespace: test +stringData: + postgres-secret-parameters: | + path: postgresql+psycopg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres.test.svc.cluster.local:5432/${POSTGRES_DB} + cache_ttl_seconds: 60 + sqlalchemy_config_kwargs: + echo: false + pool_pre_ping: true + postgres: | + host: postgres.test.svc.cluster.local + port: 5432 + database: ${POSTGRES_DB} + db_schema: public + user: ${POSTGRES_USER} + password: ${POSTGRES_PASSWORD} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: feast-config + namespace: test +data: + feature_store.yaml: | + registry: + path: /config/registry.db +--- +apiVersion: feast.dev/v1alpha1 +kind: FeatureStore +metadata: + name: example + namespace: test +spec: + feastProject: my_project + services: + volumes: + - name: feast-config-volume + configMap: + name: feast-config + - name: cache-volume + emptyDir: {} + + onlineStore: + persistence: + store: + type: postgres + secretRef: + name: feast-data-stores + envFrom: + - secretRef: + name: postgres-secret + volumeMounts: + - mountPath: /config + name: feast-config-volume + - mountPath: /cache + name: cache-volume + + registry: + local: + persistence: + store: + type: sql + secretRef: + name: feast-data-stores + secretKeyName: postgres-secret-parameters + envFrom: + - secretRef: + name: postgres-secret + volumeMounts: + - mountPath: /config + name: feast-config-volume \ No newline at end of file diff --git a/infra/feast-operator/internal/controller/services/services.go b/infra/feast-operator/internal/controller/services/services.go index d7d272f982..8d416c5633 100644 --- a/infra/feast-operator/internal/controller/services/services.go +++ b/infra/feast-operator/internal/controller/services/services.go @@ -352,7 +352,7 @@ func (feast *FeastServices) setPod(podSpec *corev1.PodSpec) error { feast.mountTlsConfigs(podSpec) feast.mountPvcConfigs(podSpec) feast.mountEmptyDirVolumes(podSpec) - feast.mountPodVolumes(podSpec) + feast.mountUserDefinedVolumes(podSpec) return nil } @@ -380,8 +380,7 @@ func (feast *FeastServices) setContainers(podSpec *corev1.PodSpec) error { return nil } -func (feast *FeastServices) setContainer(containers *[]corev1.Container, feastType FeastServiceType, - fsYamlB64 string) { +func (feast *FeastServices) setContainer(containers *[]corev1.Container, feastType FeastServiceType, fsYamlB64 string) { tls := feast.getTlsConfigs(feastType) serviceConfigs := feast.getServiceConfigs(feastType) defaultServiceConfigs := serviceConfigs.DefaultConfigs @@ -893,7 +892,7 @@ func (feast *FeastServices) mountPvcConfig(podSpec *corev1.PodSpec, pvcConfig *f } } -func (feast *FeastServices) mountPodVolumes(podSpec *corev1.PodSpec) { +func (feast *FeastServices) mountUserDefinedVolumes(podSpec *corev1.PodSpec) { var volumes []corev1.Volume if feast.Handler.FeatureStore.Spec.Services != nil { volumes = feast.Handler.FeatureStore.Spec.Services.Volumes