-
Notifications
You must be signed in to change notification settings - Fork 1
08 Webhooks
This page details how to use webhooks in order to have a running instance of Rancher server respond to outside world events.
A webhook is an endpoint publicly available, so whenever Rancher should take a specific action, notify it by posting a request with no body to a specific endpoint.
More information can be found here.
-
Create stack my-stack, as documented here: Create and Destroy Stack and Services Using Rancher CLI
-
Go to Rancher UI
-
Fill in the fields appropriately, then click the "Create" button
- Name: scale-my-stack
- Kind: Scale a service
- Action: Scale Up
- Target Service: alpine-3-5 from stack my-stack
- By: 1
- Minimum Scale: 1
- Maximum Scale: 100
-
Copy the trigger URL
-
Open a terminal and run the following command 3 times
curl -X POST "http://192.168.99.103:8080/v1-webhooks/endpoint?key=qIgRKbKri2MEUMoKU3hUC5uieK9DWYqbApw9VgGT&projectId=1a7"
Please make sure the URL above is put inside double quotes!
-
Go to Rancher UI and you should see that my-stack contains 4 containers (the default one + 3 added by calling the webhook)