Single instance K8s cluster tool that detects local file changes and automates the build and deployment of pods
minikube start
minikube mount /{file directory to watch}:/mount-9p #(run this in new terminal tab. Keep open)
- # add watchpod.json to root of the directory that will be mounted (look at demo folder for example)
kubectl apply -f https://raw.githubusercontent.com/MinikubeAddon/watchpod/master/watchpod.yaml
- # wait ~60 seconds for watchpod to build
minikube service watchpod
This is all that is needed to run Watchpod.
Please see the demo folder for instructions if running Docker with Mac.
Watchpod can be used on Minikube or Docker for Mac. Please see the demo folder for specifics.
kubectl apply -f https://raw.githubusercontent.com/MinikubeAddon/watchpod/master/watchpod.yaml
- Run
minikube start
in a terminal tab - Open a seperate terminal window. Mount working directory where files are to be watched by running:
minikube mount /"path to files":/mount-9p
- Example:
minikube mount /Users/Github/frasaja/watchme:/mount-9p
- Leave the tab used to mount open. Move back to the tab where minikube is running
- Add watchpod.json to root of the directory that will be mounted (look at demo folder for example)
- Example:
- Run
kubectl apply -f https://raw.githubusercontent.com/MinikubeAddon/watchpod/master/watchpod.yaml
- In same non-mount terminal tab, run
minikube service watchpod
- Initial build here takes ~60 seconds. See "Terminal Output" tab to track progress
- The addon will now rebuild your application(s) in the "Service View" tab when a file in the mounted directory is changed
Watchpod requires a watchpod.json
file in the root of the directory that is being mounted (watched). watchpod.json
indicates the commands that need to be run in order to build docker images and kubernetes objects.
{
"docker": ["docker build -t my-image:v1 ."],
"kubernetes": ["kubectl create -f ./my-deployment.yaml"]
}
Watchpod is currently not available on Minikube. We are in the process of submitting the code for adoption. You can fork our Minikube clone with the Watchpod addon included, then follow the instructions on build guide to run Watchpod locally.
Run the two commands below with Minikube running to enable Watchpod as a Minikube addon:
minikube mount /{file directory to watch}:/mount-9p # (run this in new terminal tab. Keep open)
./out/minikube addons enable watchpod
Frank Hu |
Sarah Heacock |
Jared Weiss |
We'd love to have your helping hand on Watchpod! Please reach out if interested in contributing