Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minio webhook #782

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Docker-Swarm-deployment/analytics/minio/webhook/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
RABBITMQ_HOST=
RABBITMQ_PORT=
RABBITMQ_USERNAME=
RABBITMQ_PASSWORD=
RABBITMQ_VHOST=""
RABBITMQ_EXCHANGE=""
RABBITMQ_ROUTING_KEY=""

MINIO_ENDPOINT=
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MINIO_USE_SSL=true
MINIO_BUCKET_NAME=

AUTH_TOKEN="<minio-auth-token>"
39 changes: 39 additions & 0 deletions Docker-Swarm-deployment/analytics/minio/webhook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# MinIO Webhook

## Introduction
MinIO Webhook is a lightweight service that integrates with MinIO to enable event-driven workflows. When data is uploaded to a MinIO bucket, an event is triggered that invokes the webhook. This webhook then pushes the event data to the appropriate RabbitMQ exchange.

## Installation

### 1. Configure the .env File

Substitute appropriate values in the .env file to configure the webhook service. Replace placeholders (<>) with actual values as per your environment. Below is an example of the .env file:

```bash
RABBITMQ_HOST=tasks.rabbitmq
RABBITMQ_PORT=5672
RABBITMQ_USERNAME=admin
RABBITMQ_PASSWORD=admin-password
RABBITMQ_VHOST="INTERNAL"
RABBITMQ_EXCHANGE="demo"
RABBITMQ_ROUTING_KEY="demo_key"

MINIO_ENDPOINT=minio.com
MINIO_ACCESS_KEY=minio-username
MINIO_SECRET_KEY=minio-password
MINIO_USE_SSL=true
MINIO_BUCKET_NAME=webhook

AUTH_TOKEN="minio-auth-token"
```

### 2. Deploy Using Docker Stack


Once the image is built and the .env file is configured, deploy the webhook service in a Docker stack using below command:

```bash
docker stack deploy -c webhook-stack.yaml minio-webhook
```

The upstream code for minio-webhook is available at **[here](https://github.com/datakaveri/minio-webhook-handler)**.
36 changes: 36 additions & 0 deletions Docker-Swarm-deployment/analytics/minio/webhook/webhook-stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: '3.9'

networks:
overlay-net:
external: true
driver: overlay

services:
minio-webhook:
image: minio-webhook:latest
restart: on-failure
configs:
- source: webhook-config
target: /app/.env
networks:
- overlay-net
deploy:
replicas: 1
restart_policy:
condition: any
max_attempts: 5
placement:
constraints:
- "node.labels.minio-node==true"
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
tag: "{\"name\":\"{{.Name}}\",\"id\":\"{{.ID}}\"}"
ports:
- 8000:8000

configs:
webhook-config:
file: ./.env
Loading