From ac3008c5ece834f89ed40a644627174998af8b29 Mon Sep 17 00:00:00 2001 From: nferraro Date: Tue, 11 Sep 2018 10:40:13 +0200 Subject: [PATCH] Add getting started guide --- README.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++- build/Makefile | 1 + 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b8c432c21..b360da8f17 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,74 @@ Apache Camel K (a.k.a. Kamel) is a lightweight integration framework built from Apache Camel that runs natively on Kubernetes and is specifically designed for serverless and microservice architectures. -## Build +## Getting Started + +You can run Camel K integrations on a Kubernetes or Openshift cluster, so you can choose to create a development cluster or use a cloud instance +for Camel K. + +### Creating a Development Cluster +There are various options for creating a development cluster: + +**Minishift** + +You can run Camel K integrations on Openshift using the Minishift cluster creation tool. +Follow the instructions in the [getting started guide](https://github.com/minishift/minishift#getting-started) for the installation. + +After installing the `minishift` binary, you need to enable the `admin-user` addon: + +``` +minishift addons enable admin-user +``` + +Then you can start the cluster with: + +``` +minishift start +``` + +**Minikube** + +Minikube and Kubernetes are not yet supported (but support is coming soon). + +### Setting Up the Cluster + +To start using Camel K you need the **"kamel"** binary, that can be used to both configure the cluster and run integrations. + +There's currently no release channel for the "kamel" binary, so you need to **build it from source!** Refer to the [building section](#building) +for information on how to do it. + +Once you have the "kamel" binary, log into your cluster using the "oc" or "kubectl" tool and execute the following command to install Camel K: + +``` +kamel install +``` + +This will configure the cluster with the Camel K custom resource definitions and install the operator on the current namespace. + +**Note:** Custom Resource Definitions (CRD) are cluster-wide objects and you need admin rights to install them. Fortunately this +operation can be done once per cluster. So, if the `kamel install` operation fails, you'll be asked to repeat it when logged as admin. +For Minishift, this means executing `oc login -u system:admin` before first-time installation only. + +### Running a Integration + +After the initial setup, you can run a Camel integration on the cluster executing: + +``` +kamel run Sample.java +``` + +A "Sample.java" file is included in the root of this repository. You can change the content of the file and execute the command again to see the changes. + +### Monitoring the Status + +Camel K integrations follow a lifecycle composed of several steps before getting into the `Running` state. +You can check the status of all integrations by executing the following command: + +``` +kamel get +``` + +## Building In order to build the project follow these steps: - this project is supposed to be cloned in `$GOPATH/src/github.com/apache/camel-k` diff --git a/build/Makefile b/build/Makefile index 0aad657a42..ce662c18f7 100644 --- a/build/Makefile +++ b/build/Makefile @@ -22,6 +22,7 @@ clean: go clean rm -f camel-k-operator rm -f kamel + rm -rf tmp/_maven_output codegen: ./tmp/codegen/update-generated.sh