FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: Add nodeSelector to service config by blaketastic2 · Pull Request #5675 · feast-dev/feast · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .go  (4) .md  (1) .yaml  (2) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ type OptionalCtrConfigs struct {
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.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ spec:
description: PullPolicy describes a policy for if/when to
pull a container image
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
requirements.
Expand Down Expand Up @@ -1025,6 +1029,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -1480,6 +1488,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -1946,6 +1958,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -2441,6 +2457,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
requirements.
Expand Down Expand Up @@ -4216,6 +4236,10 @@ spec:
description: PullPolicy describes a policy for if/when
to pull a container image
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -4994,6 +5018,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -5457,6 +5485,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -5935,6 +5967,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the
compute resource requirements.
Expand Down Expand Up @@ -6440,6 +6476,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down
40 changes: 40 additions & 0 deletions infra/feast-operator/dist/install.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ spec:
description: PullPolicy describes a policy for if/when to
pull a container image
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
requirements.
Expand Down Expand Up @@ -1033,6 +1037,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -1488,6 +1496,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -1954,6 +1966,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -2449,6 +2465,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute resource
requirements.
Expand Down Expand Up @@ -4224,6 +4244,10 @@ spec:
description: PullPolicy describes a policy for if/when
to pull a container image
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -5002,6 +5026,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -5465,6 +5493,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down Expand Up @@ -5943,6 +5975,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the
compute resource requirements.
Expand Down Expand Up @@ -6448,6 +6484,10 @@ spec:
- error
- critical
type: string
nodeSelector:
additionalProperties:
type: string
type: object
resources:
description: ResourceRequirements describes the compute
resource requirements.
Expand Down
5 changes: 5 additions & 0 deletions infra/feast-operator/docs/api/markdown/ref.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ _Appears in:_
| `envFrom` _[EnvFromSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#envfromsource-v1-core)_ | |
| `imagePullPolicy` _[PullPolicy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#pullpolicy-v1-core)_ | |
| `resources` _[ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core)_ | |
| `nodeSelector` _map[string]string_ | |


#### CronJobContainerConfigs
Expand All @@ -64,6 +65,7 @@ _Appears in:_
| `envFrom` _[EnvFromSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#envfromsource-v1-core)_ | |
| `imagePullPolicy` _[PullPolicy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#pullpolicy-v1-core)_ | |
| `resources` _[ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core)_ | |
| `nodeSelector` _map[string]string_ | |
| `commands` _string array_ | 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')" |

Expand Down Expand Up @@ -566,6 +568,7 @@ _Appears in:_
| `envFrom` _[EnvFromSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#envfromsource-v1-core)_ | |
| `imagePullPolicy` _[PullPolicy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#pullpolicy-v1-core)_ | |
| `resources` _[ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core)_ | |
| `nodeSelector` _map[string]string_ | |


#### PvcConfig
Expand Down Expand Up @@ -688,6 +691,7 @@ _Appears in:_
| `envFrom` _[EnvFromSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#envfromsource-v1-core)_ | |
| `imagePullPolicy` _[PullPolicy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#pullpolicy-v1-core)_ | |
| `resources` _[ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core)_ | |
| `nodeSelector` _map[string]string_ | |
| `tls` _[TlsConfigs](#tlsconfigs)_ | |
| `logLevel` _string_ | LogLevel sets the logging level for the server
Allowed values: "debug", "info", "warning", "error", "critical". |
Expand Down Expand Up @@ -750,6 +754,7 @@ _Appears in:_
| `envFrom` _[EnvFromSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#envfromsource-v1-core)_ | |
| `imagePullPolicy` _[PullPolicy](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#pullpolicy-v1-core)_ | |
| `resources` _[ResourceRequirements](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core)_ | |
| `nodeSelector` _map[string]string_ | |
| `tls` _[TlsConfigs](#tlsconfigs)_ | |
| `logLevel` _string_ | LogLevel sets the logging level for the server
Allowed values: "debug", "info", "warning", "error", "critical". |
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ func (feast *FeastServices) setPod(podSpec *corev1.PodSpec) error {
feast.mountPvcConfigs(podSpec)
feast.mountEmptyDirVolumes(podSpec)
feast.mountUserDefinedVolumes(podSpec)
feast.applyNodeSelector(podSpec)

return nil
}
Expand Down Expand Up @@ -793,6 +794,56 @@ func (feast *FeastServices) getLogLevelForType(feastType FeastServiceType) *stri
return nil
}

func (feast *FeastServices) getNodeSelectorForType(feastType FeastServiceType) *map[string]string {
if serviceConfigs := feast.getServerConfigs(feastType); serviceConfigs != nil {
return serviceConfigs.ContainerConfigs.OptionalCtrConfigs.NodeSelector
}
return nil
}

func (feast *FeastServices) applyNodeSelector(podSpec *corev1.PodSpec) {
// Merge node selectors from all services
mergedNodeSelector := make(map[string]string)

// Check all service types for node selector configuration
allServiceTypes := append(feastServerTypes, UIFeastType)
for _, feastType := range allServiceTypes {
if selector := feast.getNodeSelectorForType(feastType); selector != nil && len(*selector) > 0 {
for k, v := range *selector {
mergedNodeSelector[k] = v
}
}
}

// If no service has node selector configured, we're done
if len(mergedNodeSelector) == 0 {
return
}

// Merge with any existing node selectors (from ops team or other sources)
// This preserves pre-existing selectors while adding operator requirements
finalNodeSelector := feast.mergeNodeSelectors(podSpec.NodeSelector, mergedNodeSelector)
podSpec.NodeSelector = finalNodeSelector
}

// mergeNodeSelectors merges existing and operator node selectors
// Existing selectors are preserved, operator selectors can override existing keys
func (feast *FeastServices) mergeNodeSelectors(existing, operator map[string]string) map[string]string {
merged := make(map[string]string)

// Start with existing selectors (from ops team or other sources)
for k, v := range existing {
merged[k] = v
}

// Add/override with operator selectors
for k, v := range operator {
merged[k] = v
}

return merged
}

// GetObjectMeta returns the feast k8s object metadata with type
func (feast *FeastServices) GetObjectMeta() metav1.ObjectMeta {
return metav1.ObjectMeta{Name: GetFeastName(feast.Handler.FeatureStore), Namespace: feast.Handler.FeatureStore.Namespace}
Expand Down
Loading
Loading

Back | FazBrowse Home | New Git URL