Back to Feast

01 Install

examples/operator-quickstart/01-Install.ipynb

0.63.03.6 KB
Original Source

Install Feast on Kubernetes with the Feast Operator

Objective

Provide a reference implementation of a runbook to deploy a Feast environment on a Kubernetes cluster using the Feast Operator.

Prerequisites

  • Kubernetes Cluster
  • kubectl Kubernetes CLI tool.

Install Prerequisites

The following commands install and configure all the prerequisites on a MacOS environment. You can find the equivalent instructions on the offical documentation pages:

  • Install the kubectl cli.
  • Install Kubernetes and Container runtime (e.g. Colima).
    • Alternatively, authenticate to an existing Kubernetes or OpenShift cluster.
bash
brew install colima kubectl
colima start -r containerd -k -m 3 -d 100 -c 2 --cpu-type max -a x86_64
colima list
python
!kubectl create ns feast
!kubectl config set-context --current --namespace feast

Validate the cluster setup:

python
!kubectl get ns feast

Deployment Architecture

The primary objective of this runbook is to guide the deployment of Feast services on a Kubernetes cluster, using the postgres template to set up a basic feature store.

In this notebook, we will deploy a distributed topology of Feast services, which includes:

  • Registry Server: Handles metadata storage for feature definitions.
  • Online Store Server: Uses the Registry Server to query metadata and is responsible for low-latency serving of features.
  • Offline Store Server: Uses the Registry Server to query metadata and provides access to batch data for historical feature retrieval.

Each service is backed by a PostgreSQL database, which is also deployed within the same cluster.

Setup Postgresql and Redis

Apply the included postgres & redis deployments to run simple databases.

python
!kubectl apply -f postgres.yaml -f redis.yaml
!kubectl wait --for=condition=available --timeout=5m deployment/redis
!kubectl wait --for=condition=available --timeout=5m deployment/postgres
python
!kubectl get all

Install the Feast Operator

python
## Use this install command from a release branch (e.g. 'v0.43-branch')
!kubectl apply -f ../../infra/feast-operator/dist/install.yaml

## OR, for the latest code/builds, use one the following commands from the 'master' branch
# !make -C ../../infra/feast-operator install deploy IMG=quay.io/feastdev-ci/feast-operator:develop FS_IMG=quay.io/feastdev-ci/feature-server:develop
# !make -C ../../infra/feast-operator install deploy IMG=quay.io/feastdev-ci/feast-operator:$(git rev-parse HEAD) FS_IMG=quay.io/feastdev-ci/feature-server:$(git rev-parse HEAD)

!kubectl wait --for=condition=available --timeout=5m deployment/feast-operator-controller-manager -n feast-operator-system

Install the Feast services via FeatureStore CR

Next, we'll use the running Feast Operator to install the feast services. Apply the included reference deployment to install and configure Feast.

python
!kubectl apply -f feast.yaml

Validate the running FeatureStore deployment

Validate the deployment status.

python
!kubectl get all
!kubectl wait --for=condition=available --timeout=8m deployment/feast-example

Validate that the FeatureStore CR is in a Ready state.

python
!kubectl get feast

Verify that the DB includes the expected tables.

python
!kubectl exec deploy/postgres -- psql -h localhost -U feast feast -c '\dt'

Finally, let's verify the feast version.

python
!kubectl exec deployment/feast-example -itc online -- feast version