This documentation shows an example to run two jobs on a local kubernetes cluster and see the job scaling status.
-
Start a local minikube cluster.
minikube start --kubernetes-version v1.6.4
-
Run the following commands to create sample training workspace and data.
mkdir /path/to/workspace cp $REPO_PATH/doc/autoscale_example/*.py /path/to/workspace mkdir -p /path/to/workspace/data/ cp -r $REPO_PATH/doc/autoscale_example/uci_housing/ /path/to/workspace/data/
-
Mount the workspace folder into Minikube:
minikube mount /path/to/workspace:/workspace
The
minikube mount
command will block, so start a new terminal to continue the tutorial. -
Start controller and a example job:
cd $REPO_PATH/k8s/controller kubectl create -f controller.yaml kubectl create -f trainingjob_resource.yaml kubectl create -f autoscale_job/ kubectl get pods
-
Start another job simulating cluster load, then you can observe the scale process using
kubectl get pods
:kubectl create -f autoscale_load/ kubectl get pods