- git clone this repo
- task run-api-local
In a given namespace running the api
this api can spinup a worker on demand based on an api call
/workers/list
- return list of replicas of agiven deploymnet filter bylabel_selector
same as runningkubectl -n wod get deploy -l unique-instance-id=worker-0
/worker/activate
- scale a deployment from0
to1
/worker/deactivate
- scale a deployment from1
to0
The equivalent of kubectl -n wod get deploy -l unique-instance-id=worker-0
curl -X GET http://localhost:9090/workers/list?label_selector=unique-instance-id=worker-0
The equivalent of kubectl -n wod scale deploy -l unique-instance-id=worker-0 --replicas 1
curl -X POST http://localhost:9090/worker/activate?label_selector=unique-instance-id=worker-0
The equivalent of kubectl -n wod scale deploy -l unique-instance-id=worker-0 --replicas 1
curl -X POST http://localhost:9090/worker/deactivate?label_selector=unique-instance-id=worker-0
using Playground cluster:
aws eks update-kubeconfig --name $CLUSTER_NAME --region $AWS_REGION --profile $AWS_PROFILE
k apply -k .kustomize/
namespace/wod unchanged
serviceaccount/deployment-manager-sa unchanged
role.rbac.authorization.k8s.io/deployment-manager unchanged
clusterrole.rbac.authorization.k8s.io/namespace-listener unchanged
rolebinding.rbac.authorization.k8s.io/deployment-manager-binding unchanged
clusterrolebinding.rbac.authorization.k8s.io/namespace-listener-binding unchanged
service/api unchanged
deployment.apps/api unchanged
deployment.apps/worker unchanged