Skip to content

Commit

Permalink
Resource version validation (#268)
Browse files Browse the repository at this point in the history
* chore(): moving gateway configmaps to event source directory

* chore(): moving gateway configmaps to event source directory

* updating event source definitions with better comments

* updating event source definitions with better comments

* updating gateway, event-source and sensor examples

* updating gateway, event-source and sensor examples

* started amending logger

* adding tests for event sources

* adding tests for event sources

* adding check for event source version before processing it in watcher. adding func and file name in log.

* adding comments to trun ssl on webhook and adding formatter to logger

* updating event source examples

* adding back gateway and sensor guide

* fix e2e test

* fix e2e test

* fix e2e test

* add ca-certs to community gateways

* updating docs structure

* updating docs

* updating docs

* updating docs

* updating docs

* updating docs

* updating docs

* update version to v0.10

* update e2e test images

* fix e2e test

* fix e2e test

* fix e2e test

* fix e2e test

* fix e2e test

* fix event source
  • Loading branch information
VaibhavPage authored Apr 25, 2019
1 parent 68bbdd4 commit b68b94a
Show file tree
Hide file tree
Showing 279 changed files with 2,770 additions and 3,518 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cache:
env:
global:
- DOCKER_PUSH=false
- IMAGE_TAG=latest
- IMAGE_TAG=v0.10-test
- PATH=$HOME/bin:$PATH

before_install:
Expand Down
43 changes: 22 additions & 21 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 2 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,105 +33,8 @@ and trigger Kubernetes objects after successful event dependencies resolution.
* CloudEvents compliant.
* Ability to manage event sources at runtime.

## Core Concepts
The framework is made up of two components:

1. **`Gateway`** which is implemented as a Kubernetes-native Custom Resource Definition processes events from event source.

2. **`Sensor`** which is implemented as a Kubernetes-native Custom Resource Definition defines a set of event dependencies and triggers K8s resources.

## Install

* ### Requirements
* Kubernetes cluster >v1.9
* Installed the [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) command-line tool >v1.9.0

* ### Helm Chart

Make sure you have helm client installed and Tiller server is running. To install helm, follow https://docs.helm.sh/using_helm/

1. Add `argoproj` repository

```bash
helm repo add argo https://argoproj.github.io/argo-helm
```

2. Install `argo-events` chart

```bash
helm install argo/argo-events
```

* ### Using kubectl
* Deploy Argo Events SA, Roles, ConfigMap, 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 have already deployed the argo workflow controller in another namespace
and the controller is namespace scoped, make sure to deploy a new controller in `argo-events` namespace.

## Get Started
Lets deploy a webhook gateway and sensor,

* First, we need to setup event sources for gateway to listen. The event sources for any gateway are managed using K8s configmap.

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

* Create webhook gateway,

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

After running above command, gateway controller will create corresponding gateway pod and a LoadBalancing service.

* Create webhook sensor,

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

Once sensor resource is created, sensor controller will create corresponding sensor pod and a ClusterIP service.

* Once the gateway and sensor pods are running, trigger the webhook via a http POST request to `/foo` endpoint.
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
```
<b>Note</b>:
* If you are facing an issue getting service url by running `minikube service -n argo-events --url <gateway_service_name>`, you can use `kubectl 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
```
* More examples can be found at [examples](./examples)
## Further Reading
1. [Gateway](docs/gateway-guide.md)
2. [Sensor](docs/sensor-guide.md)
3. [Trigger](docs/trigger-guide.md)
4. [Communication between gateway and sensor](docs/communication.md)
5. [Controllers](docs/controllers-guide.md)
6. [Setup Gateways & Sensors](docs/setup.md)
## Documentation
To learn more about Argo Events, [go to complete documentation](docs/)

## Contribute
Read and abide by the [Argo Events Code of Conduct](https://github.com/argoproj/argo-events/blob/master/CODE_OF_CONDUCT.md)
Expand Down
6 changes: 4 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Roadmap

## Development Phase
- Boolean logic for event dependencies in sensor
- Add prometheus metrics collection
- E2E testing
- Microsoft Azure Blob Gateway
- Microsoft Teams Gateway
- Document use-cases

## Idea Phase
- Use [hashicorp/go-getter](https://github.com/hashicorp/go-getter) for the `ArtifactReader` interface.
- Add [Upspin](https://upspin.io/) as an `Artifact` file source.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9
0.10
Loading

0 comments on commit b68b94a

Please sign in to comment.