Event-Based Transport Demo
Prerequisites
Setup
- Deploy Agent and Transport
make setup
export KUBECONFIG=${PWD}/test/.kubeconfig
- Run the Source
make run-source
Resource Management
1. Create a Resource
curl -X POST localhost:8080/resources -d @example/resource.json | jq
2. Get All Resources
curl localhost:8080/resources | jq
3. Get Resource by ID
resourceID=$(curl localhost:8080/resources | jq -r .[].resourceID)
curl localhost:8080/resources/${resourceID} | jq
4. Verify Resource Creation in Cluster
kubectl get deploy -n default
5. Update the Resource
curl -X PATCH localhost:8080/resources/${resourceID} -d @example/resource-patch.json | jq
kubectl get deploy -n default
6. Delete the Resource
curl -X DELETE localhost:8080/resources/${resourceID} | jq
kubectl get deploy -n default
7. Verify Resource Deletion at Source
curl localhost:8080/resources/${resourceID} | jq
Resync Resources
1. Scale Down Agent
kubectl -n agent scale deploy/agent --replicas 0
2. Create a New Resource
curl -X POST localhost:8080/resources -d @example/resource.json | jq
3. Verify the resource is not created in cluster
kubectl get deploy -n default
4. Scale up agent
kubectl -n agent scale deploy/agent --replicas 1
5. Verify the resource is synced
kubectl get deploy -n default
curl localhost:8080/resources | jq