By default, the development environment uses a pre-built image for the Rust-based cluster-agent. To work on the Rust source code, set the KUBETAIL_RUST_DEV_MODE environment variable when running tilt up.
Docker Mode
Compiles the Rust code inside a Docker container. No local Rust toolchain is required.
KUBETAIL_RUST_DEV_MODE=docker tilt up
Local Mode
Compiles the Rust code on your machine using cross-compilation. This is faster for rebuilds but requires local setup.
Dependencies:
- rustup
- protobuf
- A cross-compiler toolchain:
- macOS:
brew install FiloSottile/musl-cross/musl-cross - Linux (Ubuntu):
apt-get install musl-tools
Setup Steps:
- Add the required Rust target:
# x86_64
rustup target add x86_64-unknown-linux-musl
# aarch64
rustup target add aarch64-unknown-linux-musl
- For macOS users, configure the linker in
~/.cargo/config.toml:[target.x86_64-unknown-linux-musl]
linker = "x86_64-linux-musl-gcc"
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
- Run Tilt in local mode:
KUBETAIL_RUST_DEV_MODE=local tilt up