Automatically apply Kubernetes manifest changes with a file watcher
kubewatch is a lightweight Linux daemon that monitors a directory for changes to Kubernetes manifests (*.yaml/*.yml) and automatically applies them to your cluster using kubectl apply. Perfect for development, GitOps workflows, or syncing local changes to a cluster without manual intervention.
- 🕵️ Real-time file watching – Detects changes in specified directories.
- ⚡ Auto-apply – Runs
kubectl apply -fon modified manifests. - 🔧 Configurable paths – Set your watched directory via config file.
- 🖥️ Systemd service – Runs as a background daemon (
systemctlsupport). - 🔒 Kubernetes RBAC-aware – Uses local
kubeconfigfor authentication.
You can install Kubewatch directly from the APT repository:
# Add our GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://boniface.github.io/kubewatch/public.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubewatch-archive-keyring.gpg
# Add repository to sources
echo "deb [signed-by=/etc/apt/keyrings/kubewatch-archive-keyring.gpg] https://boniface.github.io/kubewatch stable main" | sudo tee /etc/apt/sources.list.d/kubewatch.list
# Update package lists
sudo apt-get update
# Install kubewatch
sudo apt-get install kubewatch# Download and install the package
wget https://example.com/kubewatch.deb
sudo apt install ./kubewatch.debAfter installation, you can start and enable the systemd service:
sudo systemctl start kubewatch
sudo systemctl enable kubewatch# Clone the repo
git clone https://github.com/boniface/kubewatch.git
cd kubewatch
# Build and install
cargo build --release
sudo cp target/release/kubewatch /usr/local/bin/Edit /etc/kubewatch/config.yaml:
watchDir: "/path/to/manifests" # Directory to monitor
kubeconfig: "/home/user/.kube/config" # Optional: Custom kubeconfig
logLevel: "info" # debug, info, warn, errorRestart to apply changes:
sudo systemctl restart kubewatch- Place Kubernetes manifests in the configured
watchDir. - On file save,
kubewatchdetects changes and runs:kubectl apply -f /path/to/changed/file.yaml
- Check logs:
journalctl -u kubewatch -f
PRs welcome! See CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.