Skip to content

Commit 03dac6f

Browse files
authored
feat(operator): Add tolerations and nodeSelector to the FeatureStore CR (feast-dev#6741)
Allow scheduling the operator-managed Deployment on tainted or specific nodes via spec.services.tolerations and spec.services.nodeSelector, alongside the existing affinity and topologySpreadConstraints fields. Signed-off-by: Shumin <[email protected]>
1 parent 1d5be95 commit 03dac6f

13 files changed

Lines changed: 765 additions & 10 deletions

File tree

‎.secrets.baseline‎

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/how-to-guides/feast-on-kubernetes.md‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,48 @@ batch jobs, and more via the operator, see the
7474
[Operator Configuration Guides](feast-operator/README.md).
7575
{% endhint %}
7676
77+
## Schedule FeatureStore pods on specific nodes
78+
79+
Use `spec.services.nodeSelector` to require labels on the nodes that run a
80+
FeatureStore. Use `spec.services.tolerations` to allow those pods onto nodes with
81+
matching taints (node conditions that repel pods). A toleration permits a matching
82+
taint; it does not select nodes by itself.
83+
84+
For example, the following places the FeatureStore on Linux nodes dedicated to Feast
85+
and permits the matching `dedicated=feast:NoSchedule` taint:
86+
87+
```yaml
88+
apiVersion: feast.dev/v1
89+
kind: FeatureStore
90+
metadata:
91+
name: sample
92+
spec:
93+
feastProject: my_project
94+
services:
95+
nodeSelector:
96+
kubernetes.io/os: linux
97+
workload: feast
98+
tolerations:
99+
- key: dedicated
100+
operator: Equal
101+
value: feast
102+
effect: NoSchedule
103+
```
104+
105+
These settings apply to the FeatureStore Deployment's pod, including its init
106+
containers and every enabled Feast service container. A `nodeSelector` configured
107+
under an individual service's `server` block is merged with the shared selector and
108+
overrides `services.nodeSelector` for duplicate keys. Because enabled services share
109+
one pod, use `services.nodeSelector` for the common placement policy; avoid conflicting
110+
per-service selector values.
111+
112+
To confirm the resolved placement after reconciliation:
113+
114+
```sh
115+
kubectl get deployment feast-sample -o jsonpath='{.spec.template.spec.nodeSelector}'
116+
kubectl get deployment feast-sample -o jsonpath='{.spec.template.spec.tolerations}'
117+
```
118+
77119
## Upgrading the Operator
78120

79121
### OLM-managed installations

‎infra/feast-operator/api/v1/featurestore_types.go‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,15 @@ type FeatureStoreServices struct {
536536
// pod anti-affinity rule to prefer spreading pods across nodes.
537537
// +optional
538538
Affinity *corev1.Affinity `json:"affinity,omitempty"`
539+
// Tolerations are applied to the FeatureStore deployment pods, allowing them to
540+
// be scheduled onto nodes with matching taints.
541+
// +optional
542+
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
543+
// NodeSelector is a selector which must be true for the FeatureStore deployment
544+
// pods to fit on a node. This selector must match a node's labels for the pod to
545+
// be scheduled on that node.
546+
// +optional
547+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
539548
// ResourceClaims defines which ResourceClaims must be allocated
540549
// and reserved before the Pod is allowed to start. The resources
541550
// will be made available to those containers which consume them

‎infra/feast-operator/api/v1/zz_generated.deepcopy.go‎

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,15 @@ type FeatureStoreServices struct {
305305
RunFeastApplyOnInit *bool `json:"runFeastApplyOnInit,omitempty"`
306306
// 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).
307307
Volumes []corev1.Volume `json:"volumes,omitempty"`
308+
// Tolerations are applied to the FeatureStore deployment pods, allowing them to
309+
// be scheduled onto nodes with matching taints.
310+
// +optional
311+
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
312+
// NodeSelector is a selector which must be true for the FeatureStore deployment
313+
// pods to fit on a node. This selector must match a node's labels for the pod to
314+
// be scheduled on that node.
315+
// +optional
316+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
308317
}
309318

310319
// OfflineStore configures the offline store service

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

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)