Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/guilhermecamposo/demo_serverless_minio

Example on how to use Camel K for a serverless integration with Minio
https://github.com/guilhermecamposo/demo_serverless_minio

camel camelk minio serverless

Last synced: about 2 months ago
JSON representation

Example on how to use Camel K for a serverless integration with Minio

Awesome Lists containing this project

README

        

= Camel K Serveless Minio Integration Demo

== Requirements

* OpenShift Cluster
* Camel K CLI - kamel
* OpenShift CLI - oc

=== Ansible Automation

* https://www.ansible.com/[Ansible 3]
- https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#control-node-requirements[Ansible's requirement]
* https://pypi.org/project/kubernetes/[Python's Kubernetes module]

== Preparing the Environment Using Ansible

=== Parameters

[options="header"]
|=======================
| Parameter | Example Value | Definition
| token | sha256~vFanQbthlPKfsaldJT3bdLXIyEkd7ypO_XPygY1DNtQ | access token for a user with cluster-admin privileges
| server | https://api.${domain}.com:6443 | Cluster API URL.
|=======================

=== Running the playbook

You will need an user with permission to create a project and install operators on cluster level.
Export the user's `token` and the `server` API address as environment variables, then run the following command under the `ansible` folder:

----
cd ansible/

ansible-playbook -e token=${token} -e server=${server} playbook.yml
----

== Running the Integration

Before using `kamel` CLI make sure your are connected to the right namespace.

----
oc login
oc project camel-k-serverless
----

Then move to `camel-k` folder and run the integration.

With properties:

----
kamel run --property file:minio.properties MinioUploader.java
----

With configmaps:

----
oc create -f minio-config.yml -n camel-k-serverless
kamel run --config configmap:minio-config MinioUploader.java
----

== Testing the Integration

You may test your deployment using cURL:

----
ROUTE=$(oc get routes.serving.knative.dev minio-uploader -o jsonpath='{.status.url}' -n camel-k-serverless)

curl --request POST $ROUTE --header 'Content-Type: text/plain' --data-raw 'This is the file content.'
----