This is a guide to getting started with Argo Events.
- Kubernetes cluster >v1.9
- Installed the kubectl command-line tool >v1.9.0
- Installed Go >1.9 and properly setup the GOPATH environment variable
- Installed dep, Go's dependency tool
go get github.com/argoproj/argo-events
cd $GOPATH/src/github.com/argoproj/argo-events
Note: Modify the argo-events-cluster-roles.yaml file to use the correct namespace that you wish to deploy the sensor controller and gateway controller.
kubectl create namespace argo-events
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/hack/k8s/manifests/argo-events-sa.yaml
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/hack/k8s/manifests/argo-events-cluster-roles.yaml
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/hack/k8s/manifests/sensor-crd.yaml
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/hack/k8s/manifests/gateway-crd.yaml
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/hack/k8s/manifests/sensor-controller-configmap.yaml
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/hack/k8s/manifests/sensor-controller-deployment.yaml
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/hack/k8s/manifests/gateway-controller-configmap.yaml
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/master/hack/k8s/manifests/gateway-controller-deployment.yaml
Note If you want to use a different namespace for deployments, make sure to update namespace references to your-namespace in above files
Follow instructions from https://github.com/argoproj/argo/blob/master/demo.md
Note: Make sure to install Argo in argo-events
namespace
kubectl apply -n argo-events -f examples/gateways/webhook-gateway-configmap.yaml
kubectl apply -n argo-events -f examples/gateways/webhook-http.yaml
kubectl apply -n argo-events -f examples/sensors/webhook-http.yaml
Trigger the webhook via sending a http POST request to /foo
endpoint. You can add different endpoint to
gateway configuration at run time as well.
Note: the WEBHOOK_SERVICE_URL
will differ based on the Kubernetes cluster.
export WEBHOOK_SERVICE_URL=$(minikube service -n argo-events --url <gateway_service_name>)
echo $WEBHOOK_SERVICE_URL
curl -d '{"message":"this is my first webhook"}' -H "Content-Type: application/json" -X POST $WEBHOOK_SERVICE_URL/foo
Note:
- If you are facing an issue getting service url by running
minikube service -n argo-events --url <gateway_service_name>
, you can usekubectl port-forward
- Open another terminal window and enter
kubectl port-forward -n argo-events <name_of_the_webhook_gateway_pod> 9003:<port_on_which_gateway_server_is_running>
- You can now use
localhost:9003
to query webhook gateway
Verify that the Argo workflow was run when the trigger was executed.
argo list -n argo-events
To debug, check the logs of the sensor-controller pod, gateway-controller, associated gateways and sensors.