Skip to content

Commit

Permalink
fix: docs (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
VaibhavPage authored Jan 17, 2020
1 parent 437cb88 commit 07cabc7
Show file tree
Hide file tree
Showing 11 changed files with 344 additions and 492 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ minio-linux:

minio-image:
@if [ "$(BUILD_BINARY)" = "true" ]; then minio-linux; fi
docker build -t $(IMAGE_PREFIX)minio-gateway:$(IMAGE_TAG) -f ./gateways/server/minio/Dockerfile .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)minio-gateway:$(IMAGE_TAG) ; fi
docker build -t $(IMAGE_PREFIX)artifact-gateway:$(IMAGE_TAG) -f ./gateways/server/minio/Dockerfile .
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)artifact-gateway:$(IMAGE_TAG) ; fi


file:
Expand Down
117 changes: 52 additions & 65 deletions docs/tutorials/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,75 +18,64 @@ HTTP and executes an Argo workflow.

* Create the webhook event source.

```bash
kubectl -n argo-events create -f https://raw.githubusercontent.com/argoproj/argo-events/master/examples/event-sources/webhook.yaml
```
kubectl -n argo-events create -f https://raw.githubusercontent.com/argoproj/argo-events/master/examples/event-sources/webhook.yaml


* Create the webhook gateway.

```bash
kubectl -n argo-events create -f https://raw.githubusercontent.com/argoproj/argo-events/master/examples/gateways/webhook.yaml
```
kubectl -n argo-events create -f https://raw.githubusercontent.com/argoproj/argo-events/master/examples/gateways/webhook.yaml


* Create the webhook sensor.

```bash
kubectl -n argo-events create -f https://github.com/argoproj/argo-events/tree/master/examples/sensors/webhook.yaml
```
kubectl -n argo-events create -f https://github.com/argoproj/argo-events/tree/master/examples/sensors/webhook.yaml

If the commands are executed successfully, the gateway and sensor pods will get created. You will
also notice that a service is created for both the gateway and sensor.

* Expose the gateway pod via Ingress, OpenShift Route
or port forward to consume requests over HTTP.

```bash
kubectl -n port-forward <gateway-pod-name> 12000:12000
```
kubectl -n port-forward <gateway-pod-name> 12000:12000

* Use either Curl or Postman to send a post request to the `http://localhost:12000/example`

```bash
curl -d '{"message":"this is my first webhook"}' -H "Content-Type: application/json" -X POST http://localhost:12000/example
```
curl -d '{"message":"this is my first webhook"}' -H "Content-Type: application/json" -X POST http://localhost:12000/example

* Now, you should see an Argo workflow being created.

```bash
kubectl -n argo-events get wf
```
kubectl -n argo-events get wf

* Make sure the workflow pod ran successfully.

```
_________________________________________
/ {"context":{"type":"webhook","specVersi \
| on":"0.3","source":"webhook-gateway","e |
| ventID":"38376665363064642d343336352d34 |
| 3035372d393766662d366234326130656232343 |
| 337","time":"2020-01-11T16:55:42.996636 |
| Z","dataContentType":"application/json" |
| ,"subject":"example"},"data":"eyJoZWFkZ |
| XIiOnsiQWNjZXB0IjpbIiovKiJdLCJDb250ZW50 |
| LUxlbmd0aCI6WyIzOCJdLCJDb250ZW50LVR5cGU |
| iOlsiYXBwbGljYXRpb24vanNvbiJdLCJVc2VyLU |
| FnZW50IjpbImN1cmwvNy41NC4wIl19LCJib2R5I |
| jp7Im1lc3NhZ2UiOiJ0aGlzIGlzIG15IGZpcnN0 |
\ IHdlYmhvb2sifX0="} /
-----------------------------------------
\
\
\
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\______/
```
_________________________________________
/ {"context":{"type":"webhook","specVersi \
| on":"0.3","source":"webhook-gateway","e |
| ventID":"38376665363064642d343336352d34 |
| 3035372d393766662d366234326130656232343 |
| 337","time":"2020-01-11T16:55:42.996636 |
| Z","dataContentType":"application/json" |
| ,"subject":"example"},"data":"eyJoZWFkZ |
| XIiOnsiQWNjZXB0IjpbIiovKiJdLCJDb250ZW50 |
| LUxlbmd0aCI6WyIzOCJdLCJDb250ZW50LVR5cGU |
| iOlsiYXBwbGljYXRpb24vanNvbiJdLCJVc2VyLU |
| FnZW50IjpbImN1cmwvNy41NC4wIl19LCJib2R5I |
| jp7Im1lc3NhZ2UiOiJ0aGlzIGlzIG15IGZpcnN0 |
\ IHdlYmhvb2sifX0="} /
-----------------------------------------
\
\
\
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\______/


<b>Note:</b> You will see the message printed in the workflow logs contains both the event context
and data, with data being base64 encoded. In later sections, we will see how to extract particular key-value
from event context or data and pass it to the workflow as arguments.
Expand All @@ -95,23 +84,21 @@ from event context or data and pass it to the workflow as arguments.

If you don't see the gateway and sensor pod in `argo-events` namespace,

1. Make sure the correct Role and RoleBindings are applied to the service account
and there are no errors in both gateway and sensor controller.
2. Make sure gateway and sensor controller configmap has `namespace` set to
`argo-events`.
3. Check the logs of gateway and sensor controller. Make sure the controllers
have processed the gateway and sensor objects and there are no errors.
4. Look for any error in gateway or sensor pod.
5. Inspect the gateway,
```bash
kubectl -n argo-event gateway-object-name -o yaml
```
Inspect the sensor,
```bash
kubectl -n argo-events sensor-object-name -o yaml
```
and look for any errors within the `Status`.
1. Make sure the correct Role and RoleBindings are applied to the service account
and there are no errors in both gateway and sensor controller.
2. Make sure gateway and sensor controller configmap has `namespace` set to
`argo-events`.
3. Check the logs of gateway and sensor controller. Make sure the controllers
have processed the gateway and sensor objects and there are no errors.
4. Look for any error in gateway or sensor pod.
5. Inspect the gateway,

kubectl -n argo-event gateway-object-name -o yaml

Inspect the sensor,

kubectl -n argo-events sensor-object-name -o yaml

and look for any errors within the `Status`.

6. Raise an issue on GitHub or post a question on `argo-events` slack channel.
Loading

0 comments on commit 07cabc7

Please sign in to comment.