|
| 1 | +# Guide 1 — Project Provisioning |
| 2 | + |
| 3 | +The operator needs a Feast feature repository (a directory containing `feature_store.yaml` |
| 4 | +and Python feature-view definitions) to work from. `spec.feastProjectDir` controls how that |
| 5 | +directory is created inside the pods. Exactly one of `git` or `init` must be set. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Option A — Clone from a Git repository (`feastProjectDir.git`) |
| 10 | + |
| 11 | +The operator runs an init container that clones the repository before the Feast processes |
| 12 | +start. Use this for production: your feature definitions live in version control and the |
| 13 | +operator tracks a specific commit or branch. |
| 14 | + |
| 15 | +### Minimal example |
| 16 | + |
| 17 | +```yaml |
| 18 | +apiVersion: feast.dev/v1 |
| 19 | +kind: FeatureStore |
| 20 | +metadata: |
| 21 | + name: my-feature-store |
| 22 | +spec: |
| 23 | + feastProject: credit_scoring |
| 24 | + feastProjectDir: |
| 25 | + git: |
| 26 | + url: https://github.com/my-org/feast-feature-repo |
| 27 | + ref: main # branch, tag, or commit SHA |
| 28 | +``` |
| 29 | +
|
| 30 | +### Pinning to a specific commit (recommended for production) |
| 31 | +
|
| 32 | +```yaml |
| 33 | +feastProjectDir: |
| 34 | + git: |
| 35 | + url: https://github.com/my-org/feast-feature-repo |
| 36 | + ref: 598a270 # immutable SHA — no surprise changes on pod restart |
| 37 | +``` |
| 38 | +
|
| 39 | +### Monorepo: feature repo in a subdirectory |
| 40 | +
|
| 41 | +When the Feast feature repository lives inside a larger monorepo, use `featureRepoPath` |
| 42 | +to point at the subdirectory (relative path, no leading `/`): |
| 43 | + |
| 44 | +```yaml |
| 45 | +feastProjectDir: |
| 46 | + git: |
| 47 | + url: https://github.com/my-org/data-platform |
| 48 | + ref: e959053 |
| 49 | + featureRepoPath: ml/feast/feature_repo # relative to repo root |
| 50 | +``` |
| 51 | + |
| 52 | +### Private repositories — token authentication |
| 53 | + |
| 54 | +Create a Kubernetes Secret containing the token: |
| 55 | + |
| 56 | +```yaml |
| 57 | +apiVersion: v1 |
| 58 | +kind: Secret |
| 59 | +metadata: |
| 60 | + name: git-token |
| 61 | +stringData: |
| 62 | + TOKEN: <your-personal-access-token> |
| 63 | +``` |
| 64 | + |
| 65 | +Reference the Secret from `envFrom` and rewrite the remote URL via `configs`: |
| 66 | + |
| 67 | +```yaml |
| 68 | +feastProjectDir: |
| 69 | + git: |
| 70 | + url: https://github.com/my-org/private-repo |
| 71 | + configs: |
| 72 | + # Replaces the HTTPS URL with one that includes the token |
| 73 | + 'url."https://api:${TOKEN}@github.com/".insteadOf': 'https://github.com/' |
| 74 | + envFrom: |
| 75 | + - secretRef: |
| 76 | + name: git-token |
| 77 | +``` |
| 78 | + |
| 79 | +### Disabling TLS verification (not recommended for production) |
| 80 | + |
| 81 | +```yaml |
| 82 | +feastProjectDir: |
| 83 | + git: |
| 84 | + url: https://internal-git.corp/feast-repo |
| 85 | + configs: |
| 86 | + http.sslVerify: 'false' |
| 87 | +``` |
| 88 | + |
| 89 | +### Full `git` field reference |
| 90 | + |
| 91 | +| Field | Type | Description | |
| 92 | +|-------|------|-------------| |
| 93 | +| `url` | string | Repository URL (HTTPS or SSH) | |
| 94 | +| `ref` | string | Branch, tag, or commit SHA. Defaults to the remote HEAD | |
| 95 | +| `featureRepoPath` | string | Relative path within the repo to the feature repository directory. Default: `feature_repo` | |
| 96 | +| `configs` | map[string]string | Key-value pairs passed to `git -c` before clone | |
| 97 | +| `env` | EnvVar[] | Environment variables for the git init container | |
| 98 | +| `envFrom` | EnvFromSource[] | Sources (Secrets, ConfigMaps) for init container environment | |
| 99 | + |
| 100 | +--- |
| 101 | + |
| 102 | +## Option B — Scaffold a new project (`feastProjectDir.init`) |
| 103 | + |
| 104 | +The operator runs `feast init` on first startup to create a minimal feature repository. |
| 105 | +Use this for development, demos, and CI environments where you do not yet have a feature |
| 106 | +repo to point at. |
| 107 | + |
| 108 | +```yaml |
| 109 | +apiVersion: feast.dev/v1 |
| 110 | +kind: FeatureStore |
| 111 | +metadata: |
| 112 | + name: feast-dev |
| 113 | +spec: |
| 114 | + feastProject: sample_project |
| 115 | + feastProjectDir: |
| 116 | + init: {} # defaults: template=local, minimal=false |
| 117 | +``` |
| 118 | + |
| 119 | +### Templates |
| 120 | + |
| 121 | +`feast init` supports store-specific templates. Set `template` to generate a scaffold that |
| 122 | +matches your chosen online/offline store: |
| 123 | + |
| 124 | +```yaml |
| 125 | +feastProjectDir: |
| 126 | + init: |
| 127 | + template: spark # scaffolds Spark-compatible feature_store.yaml |
| 128 | +``` |
| 129 | + |
| 130 | +Available templates (validated by the CRD): |
| 131 | +`local` · `gcp` · `aws` · `snowflake` · `spark` · `postgres` · `hbase` · `cassandra` · |
| 132 | +`hazelcast` · `couchbase` · `clickhouse` |
| 133 | + |
| 134 | +### Minimal scaffold |
| 135 | + |
| 136 | +`minimal: true` skips example feature-view files and creates only the bare |
| 137 | +`feature_store.yaml`: |
| 138 | + |
| 139 | +```yaml |
| 140 | +feastProjectDir: |
| 141 | + init: |
| 142 | + minimal: true |
| 143 | +``` |
| 144 | + |
| 145 | +### Full `init` field reference |
| 146 | + |
| 147 | +| Field | Type | Default | Description | |
| 148 | +|-------|------|---------|-------------| |
| 149 | +| `template` | string | `local` | Template name for `feast init --template` | |
| 150 | +| `minimal` | bool | `false` | Pass `--minimal` to `feast init` | |
| 151 | + |
| 152 | +--- |
| 153 | + |
| 154 | +## `feast apply` on startup |
| 155 | + |
| 156 | +By default, when the init container completes (git clone or `feast init`), the operator runs |
| 157 | +`feast apply` before starting the servers. This registers all feature definitions with the |
| 158 | +registry. |
| 159 | + |
| 160 | +To **skip** `feast apply` on pod start (e.g. you manage registry updates separately): |
| 161 | + |
| 162 | +```yaml |
| 163 | +services: |
| 164 | + disableInitContainers: true # skip both clone/init AND feast apply |
| 165 | +``` |
| 166 | + |
| 167 | +Or to keep the init container but skip the apply step: |
| 168 | + |
| 169 | +```yaml |
| 170 | +services: |
| 171 | + runFeastApplyOnInit: false |
| 172 | +``` |
| 173 | + |
| 174 | +--- |
| 175 | + |
| 176 | +## When `feastProjectDir` is omitted |
| 177 | + |
| 178 | +If neither `git` nor `init` is set, the operator mounts an empty directory. In this case |
| 179 | +you must supply a `feature_store.yaml` through another mechanism (e.g. a ConfigMap volume |
| 180 | +mount via `services.volumes` + `volumeMounts`). |
| 181 | + |
| 182 | +--- |
| 183 | + |
| 184 | +## See also |
| 185 | + |
| 186 | +- [API reference — `FeastProjectDir`](https://github.com/feast-dev/feast/blob/stable/infra/feast-operator/docs/api/markdown/ref.md#feastprojectdir) |
| 187 | +- [Sample: public git repo](https://github.com/feast-dev/feast/blob/stable/infra/feast-operator/config/samples/v1_featurestore_git.yaml) |
| 188 | +- [Sample: private git repo with token](https://github.com/feast-dev/feast/blob/stable/infra/feast-operator/config/samples/v1_featurestore_git_token.yaml) |
| 189 | +- [Sample: monorepo with featureRepoPath](https://github.com/feast-dev/feast/blob/stable/infra/feast-operator/config/samples/v1_featurestore_git_repopath.yaml) |
| 190 | +- [Sample: feast init](https://github.com/feast-dev/feast/blob/stable/infra/feast-operator/config/samples/v1_featurestore_init.yaml) |
0 commit comments