1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-05 08:17:04 +00:00

Describe how to develop locally with Tilt

Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
This commit is contained in:
Feruzjon Muyassarov 2022-08-30 11:24:08 +03:00
parent bac1ea1642
commit a30ceb2973

View file

@ -235,6 +235,50 @@ Preceding Kubernetes v1.23, the `kubelet` must be started with the following fla
Starting Kubernetes v1.23, the `GetAllocatableResources` is enabled by default
through `KubeletPodResourcesGetAllocatable` [feature gate][feature-gate].
## Running with Tilt
Another option for building NFD locally is via Tilt tool, which can build container
images, push them to a local registry and reload your Kubernetes pods automatically.
When using Tilt, you don't have to build container images and re-deploy your pods
manually but instead let the Tilt take care of it. Tiltfile is a configuration file
for the Tilt and is located at the root direcotry. To develop NFD with Tilt, follow
the steps below.
### Prerequisites
1. Install [Docker](https://docs.docker.com/engine/install/)
1. Setup Docker as a non-root user.
1. Install [kubectl](https://kubernetes.io/docs/tasks/tools/)
1. Install [kustomize](https://github.com/kubernetes-sigs/kustomize)
1. Install [tilt](https://docs.tilt.dev/install.html)
1. Create a local Kubernetes cluster
To start up your Tilt development environment, just run
```shell
tilt up
```
at the root of your local NFD codebase. Tilt will start a web interface in the
localhost and port 10350. From the web interface, you are able to see how NFD worker
and master are progressing, watch their build and runtime logs. Once your code changes
are saved locally, Tilt will notice it and re-build the container image from the
current code, push the image to the registry and re-deploy NFD pods with the latest
container image.
### Environment variables
To override environment variables used in the Tiltfile during image build,
export them in your current terminal before starting Tilt.
```shell
export IMAGE_TAG_NAME="v1"
tilt up
```
This will override the default value(`master`) of `IMAGE_TAG_NAME` variable defined
in the Tiltfile.
## Documentation
All documentation resides under the