Skip to content
Merged
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
21 changes: 8 additions & 13 deletions e2e/install/helm/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ import (
corev1 "k8s.io/api/core/v1"

. "github.com/apache/camel-k/v2/e2e/support"
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
"github.com/apache/camel-k/v2/pkg/util/defaults"
. "github.com/onsi/gomega"
)

func TestHelmInstallation(t *testing.T) {
WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) {
containerRegistry, ok := os.LookupEnv("KAMEL_INSTALL_REGISTRY")
g.Expect(ok).To(BeTrue(), "You must provide a registry address in KAMEL_INSTALL_REGISTRY env variable")
// Let's make sure no CRD is yet available in the cluster
// as we must make the procedure to install them accordingly
g.Eventually(CRDs(t)).Should(BeNil(), "No Camel K CRDs should be previously installed for this test")
Expand All @@ -52,14 +49,14 @@ func TestHelmInstallation(t *testing.T) {
"install",
"camel-k",
fmt.Sprintf("../../../docs/charts/camel-k-%s.tgz", defaults.Version),
"--set",
fmt.Sprintf("platform.build.registry.address=%s", containerRegistry),
"--set",
"platform.build.registry.insecure=true",
"--set",
fmt.Sprintf("operator.operatorId=%s", operatorID),
"-n",
ns,
"--set", "operator.env[0].name=REGISTRY_SVC_NAMESPACE",
"--set", "operator.env[0].value=kube-system",
"--set", "operator.env[1].name=REGISTRY_SVC_NAME",
"--set", "operator.env[1].value=registry",
"--set", "operator.env[2].name=REGISTRY_INSECURE",
"--set-string", "operator.env[2].value=true",
"--set", fmt.Sprintf("operator.operatorId=%s", operatorID),
"-n", ns,
"--force",
),
)
Expand All @@ -74,8 +71,6 @@ func TestHelmInstallation(t *testing.T) {
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.SeccompProfile).To(Equal(DefaultOperatorSecurityContext().SeccompProfile))
g.Expect(operatorPod.Spec.Containers[0].SecurityContext.AllowPrivilegeEscalation).To(Equal(DefaultOperatorSecurityContext().AllowPrivilegeEscalation))

g.Eventually(PlatformPhase(t, ctx, ns)).Should(Equal(v1.IntegrationPlatformPhaseReady))

// Test a simple route
t.Run("simple route", func(t *testing.T) {
g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/yaml.yaml").Execute()).To(Succeed())
Expand Down
99 changes: 36 additions & 63 deletions helm/camel-k/README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,58 @@
# 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 the lightweight integration platform for Kubernetes: 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
- A container image registry installed and configured for pull
- For production environments, a registry secret containing the access to container registry

## 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
```
### Minikube

## Install the operator
Minikube offers a container registry addon, which it makes very well suited for local Camel K development and testing purposes:

```bash
$ helm install camel-k camel-k/camel-k
$ minikube addons enable registry
```

## Set the container registry configuration
You can use the container registry Service `registry` in namespace `kube-system` to configure in Camel K.

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.
## Installation procedure

Create an `itp.yaml` file like:
To install the chart, first add the Camel K repository:

```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>
```bash
$ helm repo add camel-k https://apache.github.io/camel-k/charts
```

and save the resource to the cluster with `kubectl apply -f itp.yaml`.

### Minikube
## Install the operator

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:
When installing the operator you must at least include the container registry to use (either the address or the service to use):

```bash
$ minikube addons enable registry
$ kubectl -n kube-system get service registry -o jsonpath='{.spec.clusterIP}'
$ helm install camel-k camel-k/camel-k --set global=true \
--set operator.env[0].name=REGISTRY_ADDRESS \
--set operator.env[0].value=<my-registry-address> \
--set operator.env[1].name=REGISTRY_SECRET \
--set operator.env[1].value=<my-registry-secret>
```

Then you can provide the IntegrationPlatform as `itp.yaml`:
In the case of a local registry available (for example, in Minikube):

```yaml
apiVersion: camel.apache.org/v1
kind: IntegrationPlatform
metadata:
labels:
app: camel-k
name: camel-k
spec:
build:
registry:
address: <REGISTRY_ADDRESS>
insecure: true
```bash
$ helm install camel-k camel-k/camel-k --set global=true \
--set operator.env[0].name=REGISTRY_SVC_NAMESPACE \
--set operator.env[0].value=kube-system \
--set operator.env[1].name=REGISTRY_SVC_NAME \
--set operator.env[1].value=registry \
--set operator.env[2].name=REGISTRY_INSECURE \
--set-string operator.env[2].value=true
```

and save the resource to the cluster with `kubectl apply -f itp.yaml`.
> **Note**: the installation RBAC provide the setting to access the Service in the namespace, you need to provide the specific RBAC if using another Service.

## Test your installation

Verify the IntegrationPlatform is in Ready status:

```bash
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
```

Create a simple testing "Hello World" Integration as `test.yaml`:

```yaml
Expand Down Expand Up @@ -120,15 +92,9 @@ test Running True quarkus 3.8.1 3.8.1

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

The [configuration](#configuration) section lists additional parameters that can be set during installation.
The [configuration](#configuration) section lists additional parameters that can be set during installation. From version 2.11.0 onward, the majority of parameters are expected to be configured via environment variables. See official documentation on Apache website for a full list.

> **Tip**: List all releases using `helm list`

Expand Down Expand Up @@ -171,11 +137,18 @@ The following table lists the most commonly configured parameters of the Camel K

| Parameter | Description | Default |
|----------------------------------------|---------------------------------------------------------------------------|--------------------------------|
| `operator.operatorId` | The id of the Camel K operator | `camel-k` |
| `operator.global` | Indicates if the operator should watch all namespaces | `false` |
| `operator.image` | The container image to use to run the operator | <the official image> |
| `operator.nodeSelector` | The nodeSelector to use for the operator | |
| `operator.resources` | The resource requests and limits to use for the operator | |
| `operator.securityContext` | The (container-related) securityContext to use for the operator | |
| `operator.tolerations` | The list of tolerations to use for the operator | |
| `operator.imagePullSecret` | The id of the Camel K operator | |
| `operator.annotations` | The list of annotations to include to the operator Deployment | |
| `operator.serviceAccount.annotations` | The list of annotations to include to the operator Service Account | |
| `extraEnv` | Extra env var on the operator Deployment (deprecated, use `env`) | |
| `env` | The operator configuration via environment variables | |

## Contributing

Expand Down
34 changes: 1 addition & 33 deletions helm/camel-k/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1 @@
Thanks for installing Camel K version {{ .Chart.Version }}!

{{- if .Values.platform }}
WARNING: you're setting some IntegrationPlatform values. This is deprecated and may be removed in future releases. Make sure to install an IntegrationPlatform as a separate process.
{{- end }}

{{- 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
Thanks for installing Camel K version {{ .Chart.Version }}! Learn more about running an Integration: https://camel.apache.org/camel-k/next/running/running.html
28 changes: 0 additions & 28 deletions helm/camel-k/templates/default-itp.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions helm/camel-k/templates/operator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ spec:
{{- with .Values.operator.extraEnv }}
{{- . | toYaml | nindent 12 }}
{{- end }}
{{- with .Values.operator.env }}
{{- . | toYaml | nindent 12 }}
{{- end }}
image: {{ .Values.operator.image }}
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down
6 changes: 4 additions & 2 deletions helm/camel-k/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ operator:
annotations:

## Extra environment variables.
## Deprecated: use env instead
## ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
extraEnv: []
# - name: MY_VAR
# value: my_value

## Operator environment variables: used to add any platform related configuration.
env: []
Loading