Skip to content

Commit

Permalink
chore(helm): deprecate installation with platform
Browse files Browse the repository at this point in the history
Required in order to provide a uniform user experience and make it explicit the role of the IntegrationPlatform
  • Loading branch information
squakez committed Sep 5, 2024
1 parent d980193 commit 10f03f2
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 52 deletions.
132 changes: 93 additions & 39 deletions helm/camel-k/README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,132 @@
# 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:

```bash
$ 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: <my-registry-address>
organization: <my-organization>
secret: <my-secret-credentials>
```
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=<my-registry> \
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: <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.

Expand Down Expand Up @@ -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 | |
Expand All @@ -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
37 changes: 31 additions & 6 deletions helm/camel-k/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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: <my-registry-address>
organization: <my-organization>
secret: <my-k8s-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
4 changes: 3 additions & 1 deletion helm/camel-k/templates/platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.
# ---------------------------------------------------------------------------

{{- if .Values.platform }}
apiVersion: camel.apache.org/v1
kind: IntegrationPlatform
metadata:
Expand All @@ -23,4 +24,5 @@ metadata:
{{- include "camel-k.labels" . | nindent 4 }}
name: {{ .Values.operator.operatorId }}
spec:
{{- toYaml .Values.platform | nindent 2}}
{{- toYaml .Values.platform | nindent 2}}
{{- end }}
6 changes: 0 additions & 6 deletions helm/camel-k/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,3 @@ operator:

# Default operator name
operatorId: camel-k


platform:
build:
registry: {}
cluster: ""

0 comments on commit 10f03f2

Please sign in to comment.