event-based-transport-demo

module
v0.0.0-...-6a882ce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: Apache-2.0

README

Event-Based Transport Demo

event-based-transport-demo.jpg

Prerequisites

Setup

  1. Deploy Agent and Transport
make setup
export KUBECONFIG=${PWD}/test/.kubeconfig
  1. 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

Directories

Path Synopsis
cmd
pkg
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL