diff --git a/helm/camel-k/README.md b/helm/camel-k/README.md index cfca2d3458..da5789f321 100644 --- a/helm/camel-k/README.md +++ b/helm/camel-k/README.md @@ -1,15 +1,13 @@ # Camel K -Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers: the easiest way to build and manage your Camel applications on Kubernetes. - -This chart deploys the Camel K operator and all resources needed to natively run Apache Camel integrations on any Kubernetes cluster. +Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers: the easiest way to build and manage your Camel applications on Kubernetes. This chart deploys the Camel K operator and all resources needed to natively run Apache Camel Integrations on any Kubernetes cluster. ## Prerequisites - Kubernetes 1.11+ -- Container Image Registry installed and configured for pull (optional in Openshift or Minikube) +- Container Image Registry installed and configured for pull -## Installing the Chart +## Installation procedure To install the chart, first add the Camel K repository: @@ -17,55 +15,118 @@ To install the chart, first add the Camel K repository: $ helm repo add camel-k https://apache.github.io/camel-k/charts ``` -Depending on the cloud platform of choice, you will need to specify a container registry at installation time. +## Install the operator + +```bash +$ helm install camel-k camel-k/camel-k +``` + +## Set the container registry configuration + +A regular installation requires you to provide a registry used by Camel K to build application containers. See official [Camel K registry documentation](https://camel.apache.org/camel-k/next/installation/registry/registry.html) or move to next section to run on a local Minikube cluster. + +Create an `itp.yaml` file like: + +```yaml +apiVersion: camel.apache.org/v1 +kind: IntegrationPlatform +metadata: + labels: + app: camel-k + name: camel-k +spec: + build: + registry: + address: + organization: + secret: +``` + +and save the resource to the cluster with `kubectl apply -f itp.yaml`. -### Plain Kubernetes +### Minikube -A regular installation requires you to provide a registry, used by Camel K to build application containers. See official [Camel K registry documentation](https://camel.apache.org/camel-k/next/installation/registry/registry.html). +Minikube offers a container registry addon, which it makes very well suited for local Camel K development and testing purposes. You can see the cluster IP registry addon using the following script: ```bash -$ helm install camel-k \ - --set platform.build.registry.address= \ - camel-k/camel-k +$ minikube addons enable registry +$ kubectl -n kube-system get service registry -o jsonpath='{.spec.clusterIP}' +``` + +Then you can provide the IntegrationPlatform as `itp.yaml`: + +```yaml +apiVersion: camel.apache.org/v1 +kind: IntegrationPlatform +metadata: + labels: + app: camel-k + name: camel-k +spec: + build: + registry: + address: + insecure: true ``` -You may install Camel K and specify a container registry later. You may need to provide the `--force` option if the installation complains about an existing `IntegrationPlatform`. +and save the resource to the cluster with `kubectl apply -f itp.yaml`. -### Openshift +## Test your installation -If you are installing on OpenShift, Camel K can use the OpenShift internal registry to store and pull images: +Verify the IntegrationPlatform is in Ready status: ```bash -$ helm install camel-k \ - --set platform.cluster=OpenShift \ - camel-k/camel-k +kubectl get itp +NAME PHASE BUILD STRATEGY PUBLISH STRATEGY REGISTRY ADDRESS DEFAULT RUNTIME +camel-k Ready routine Jib 10.100.107.57 3.8.1 ``` -### Minikube +Create a simple testing "Hello World" Integration as `test.yaml`: + +```yaml +apiVersion: camel.apache.org/v1 +kind: Integration +metadata: + name: test +spec: + flows: + - from: + parameters: + period: "1000" + steps: + - setBody: + simple: Hello Camel from ${routeId} + - log: ${body} + uri: timer:yaml +``` -Minikube offers a container registry addon, which it makes very well suited for local Camel K development and testing purposes. You can export the cluster IP registry addon using the following script: +Run it on cloud: ```bash -$ minikube addons enable registry -$ export REGISTRY_ADDRESS=$(kubectl -n kube-system get service registry -o jsonpath='{.spec.clusterIP}') +kubectl apply -f test.yaml ``` -Then you can install Camel K with: +Monitor how it is running: ```bash -$ helm install camel-k \ - --set platform.build.registry.address=${REGISTRY_ADDRESS} \ - --set platform.build.registry.insecure=true \ - camel-k/camel-k +$ kubectl get it -w +NAME PHASE READY RUNTIME PROVIDER RUNTIME VERSION CATALOG VERSION KIT REPLICAS +test Building Kit quarkus 3.8.1 3.8.1 kit-crc382j18sec73deq24g +test Deploying quarkus 3.8.1 3.8.1 kit-crc382j18sec73deq24g +test Running False quarkus 3.8.1 3.8.1 kit-crc382j18sec73deq24g 0 +test Running False quarkus 3.8.1 3.8.1 kit-crc382j18sec73deq24g 1 +test Running True quarkus 3.8.1 3.8.1 kit-crc382j18sec73deq24g 1 ``` -### Knative configuration +For any problem, check it out the official [troubleshooting guide](https://camel.apache.org/camel-k/next/troubleshooting/troubleshooting.html) or the [documentation](https://camel.apache.org/camel-k/next/index.html). + +## Knative configuration Camel K offers the possibility to run serverless Integrations in conjunction with [Knative operator](https://knative.dev). Once Knative and Camel K are installed on the same platform, you can configure Knative resources to be played by Camel K. See instructions [how to enable Knative on Camel K](https://camel.apache.org/camel-k/next/installation/knative.html). -### Additional installation time configuration +## Additional installation time configuration The [configuration](#configuration) section lists additional parameters that can be set during installation. @@ -106,16 +167,10 @@ $ kubectl delete -f camel-k/crds ## Configuration -The following table lists the most commonly configured parameters of the Camel K chart and their default values. The chart allows configuration of an `IntegrationPlatform` resource, which among others includes build properties and traits configuration. A full list of parameters can be found [in the operator specification][1]. +The following table lists the most commonly configured parameters of the Camel K chart and their default values. | Parameter | Description | Default | |----------------------------------------|---------------------------------------------------------------------------|--------------------------------| -| `platform.build.registry.address` | The address of a container image registry to push images | | -| `platform.build.registry.secret` | A secret used to push/pull images to the Docker registry | | -| `platform.build.registry.organization` | An organization on the Docker registry that can be used to publish images | | -| `platform.build.registry.insecure` | Indicates if the registry is not secured | true | -| `platform.cluster` | The kind of Kubernetes cluster (Kubernetes or OpenShift) | `Kubernetes` | -| `platform.profile` | The trait profile to use (Knative, Kubernetes or OpenShift) | auto | | `operator.global` | Indicates if the operator should watch all namespaces | `false` | | `operator.nodeSelector` | The nodeSelector to use for the operator | | | `operator.resources` | The resource requests and limits to use for the operator | | @@ -126,8 +181,7 @@ The following table lists the most commonly configured parameters of the Camel K We'd like to hear your feedback and we love any kind of contribution! -The main contact points for the Camel K project are the [GitHub repository][2] and the [Camel K chat room][3]. +The main contact points for the Camel K project are the [GitHub repository][1] and the [Camel K chat room][2]. -[1]: https://camel.apache.org/camel-k/next/architecture/cr/integration-platform.html -[2]: https://github.com/apache/camel-k -[3]: https://camel.zulipchat.com +[1]: https://github.com/apache/camel-k +[2]: https://camel.zulipchat.com diff --git a/helm/camel-k/templates/NOTES.txt b/helm/camel-k/templates/NOTES.txt index 32c70c08a8..1708d369c6 100644 --- a/helm/camel-k/templates/NOTES.txt +++ b/helm/camel-k/templates/NOTES.txt @@ -1,8 +1,33 @@ -{{/* -Constraints -*/}} -{{- if or (not .Values.platform.cluster) (ne .Values.platform.cluster "OpenShift") }} -{{ required "Field \"platform.build.registry.address\" is required when not running on OpenShift (set \"platform.cluster=OpenShift\" if you're using OpenShift instead)!" .Values.platform.build.registry.address | substr 0 0 }} +Thanks for installing Camel K version {{ .Chart.Version }}! + +{{- if .Values.platform }} +WARNING: you're setting some IntegrationPlatform values. This is deprecated and may remove in future releases. Make sure to install an IntegrationPlatform as a separate process. {{- end }} -Connect the world with Camel K on {{ include "camel-k.cluster" . }}! +{{- if not (.Values.platform) }} +- How to configure the container registry + + Please, install an IntegrationPlatform containing your container registry configuration before running any Integration. + You can run the following script: + + printf "\ + apiVersion: camel.apache.org/v1 + kind: IntegrationPlatform + metadata: + labels: + app: camel-k + name: camel-k + spec: + build: + registry: + address: + organization: + secret: + " | kubectl apply -f - + + More info on https://camel.apache.org/camel-k/next/installation/integrationplatform.html +{{- end }} + +- How to run a Camel application + + Learn more about running an Integration: https://camel.apache.org/camel-k/next/running/running.html diff --git a/helm/camel-k/templates/platform.yaml b/helm/camel-k/templates/platform.yaml index 2786fd3bfd..3106af4bb4 100644 --- a/helm/camel-k/templates/platform.yaml +++ b/helm/camel-k/templates/platform.yaml @@ -15,6 +15,7 @@ # limitations under the License. # --------------------------------------------------------------------------- +{{- if .Values.platform }} apiVersion: camel.apache.org/v1 kind: IntegrationPlatform metadata: @@ -23,4 +24,5 @@ metadata: {{- include "camel-k.labels" . | nindent 4 }} name: {{ .Values.operator.operatorId }} spec: - {{- toYaml .Values.platform | nindent 2}} \ No newline at end of file + {{- toYaml .Values.platform | nindent 2}} +{{- end }} diff --git a/helm/camel-k/values.yaml b/helm/camel-k/values.yaml index ae4fce8854..8494774277 100644 --- a/helm/camel-k/values.yaml +++ b/helm/camel-k/values.yaml @@ -45,9 +45,3 @@ operator: # Default operator name operatorId: camel-k - - -platform: - build: - registry: {} - cluster: ""