Skip to content

Commit 5a177ec

Browse files
committed
chore(helm): platformless installation
1 parent 886c3cc commit 5a177ec

6 files changed

Lines changed: 52 additions & 139 deletions

File tree

e2e/install/helm/setup_test.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,12 @@ import (
3232
corev1 "k8s.io/api/core/v1"
3333

3434
. "github.com/apache/camel-k/v2/e2e/support"
35-
v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
3635
"github.com/apache/camel-k/v2/pkg/util/defaults"
3736
. "github.com/onsi/gomega"
3837
)
3938

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

77-
g.Eventually(PlatformPhase(t, ctx, ns)).Should(Equal(v1.IntegrationPlatformPhaseReady))
78-
7974
// Test a simple route
8075
t.Run("simple route", func(t *testing.T) {
8176
g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/yaml.yaml").Execute()).To(Succeed())

helm/camel-k/README.md

Lines changed: 36 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,58 @@
11
# Camel K
22

3-
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.
3+
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.
44

55
## Prerequisites
66

7-
- Kubernetes 1.11+
8-
- Container Image Registry installed and configured for pull
7+
- A container image registry installed and configured for pull
8+
- For production environments, a registry secret containing the access to container registry
99

10-
## Installation procedure
11-
12-
To install the chart, first add the Camel K repository:
13-
14-
```bash
15-
$ helm repo add camel-k https://apache.github.io/camel-k/charts
16-
```
10+
### Minikube
1711

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

2014
```bash
21-
$ helm install camel-k camel-k/camel-k
15+
$ minikube addons enable registry
2216
```
2317

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

26-
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.
20+
## Installation procedure
2721

28-
Create an `itp.yaml` file like:
22+
To install the chart, first add the Camel K repository:
2923

30-
```yaml
31-
apiVersion: camel.apache.org/v1
32-
kind: IntegrationPlatform
33-
metadata:
34-
labels:
35-
app: camel-k
36-
name: camel-k
37-
spec:
38-
build:
39-
registry:
40-
address: <my-registry-address>
41-
organization: <my-organization>
42-
secret: <my-secret-credentials>
24+
```bash
25+
$ helm repo add camel-k https://apache.github.io/camel-k/charts
4326
```
4427

45-
and save the resource to the cluster with `kubectl apply -f itp.yaml`.
46-
47-
### Minikube
28+
## Install the operator
4829

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

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

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

58-
```yaml
59-
apiVersion: camel.apache.org/v1
60-
kind: IntegrationPlatform
61-
metadata:
62-
labels:
63-
app: camel-k
64-
name: camel-k
65-
spec:
66-
build:
67-
registry:
68-
address: <REGISTRY_ADDRESS>
69-
insecure: true
42+
```bash
43+
$ helm install camel-k camel-k/camel-k --set global=true \
44+
--set operator.env[0].name=REGISTRY_SVC_NAMESPACE \
45+
--set operator.env[0].value=kube-system \
46+
--set operator.env[1].name=REGISTRY_SVC_NAME \
47+
--set operator.env[1].value=registry \
48+
--set operator.env[2].name=REGISTRY_INSECURE \
49+
--set-string operator.env[2].value=true
7050
```
7151

72-
and save the resource to the cluster with `kubectl apply -f itp.yaml`.
52+
> **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.
7353
7454
## Test your installation
7555

76-
Verify the IntegrationPlatform is in Ready status:
77-
78-
```bash
79-
kubectl get itp
80-
NAME PHASE BUILD STRATEGY PUBLISH STRATEGY REGISTRY ADDRESS DEFAULT RUNTIME
81-
camel-k Ready routine Jib 10.100.107.57 3.8.1
82-
```
83-
8456
Create a simple testing "Hello World" Integration as `test.yaml`:
8557

8658
```yaml
@@ -120,15 +92,9 @@ test Running True quarkus 3.8.1 3.8.1
12092

12193
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).
12294

123-
## Knative configuration
124-
125-
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.
126-
127-
See instructions [how to enable Knative on Camel K](https://camel.apache.org/camel-k/next/installation/knative.html).
128-
12995
## Additional installation time configuration
13096

131-
The [configuration](#configuration) section lists additional parameters that can be set during installation.
97+
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.
13298

13399
> **Tip**: List all releases using `helm list`
134100
@@ -171,11 +137,18 @@ The following table lists the most commonly configured parameters of the Camel K
171137

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

180153
## Contributing
181154

helm/camel-k/templates/NOTES.txt

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1 @@
1-
Thanks for installing Camel K version {{ .Chart.Version }}!
2-
3-
{{- if .Values.platform }}
4-
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.
5-
{{- end }}
6-
7-
{{- if not (.Values.platform) }}
8-
- How to configure the container registry
9-
10-
Please, install an IntegrationPlatform containing your container registry configuration before running any Integration.
11-
You can run the following script:
12-
13-
printf "\
14-
apiVersion: camel.apache.org/v1
15-
kind: IntegrationPlatform
16-
metadata:
17-
labels:
18-
app: camel-k
19-
name: camel-k
20-
spec:
21-
build:
22-
registry:
23-
address: <my-registry-address>
24-
organization: <my-organization>
25-
secret: <my-k8s-secret>
26-
" | kubectl apply -f -
27-
28-
More info on https://camel.apache.org/camel-k/next/installation/integrationplatform.html
29-
{{- end }}
30-
31-
- How to run a Camel application
32-
33-
Learn more about running an Integration: https://camel.apache.org/camel-k/next/running/running.html
1+
Thanks for installing Camel K version {{ .Chart.Version }}! Learn more about running an Integration: https://camel.apache.org/camel-k/next/running/running.html

helm/camel-k/templates/default-itp.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

helm/camel-k/templates/operator-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ spec:
8282
{{- with .Values.operator.extraEnv }}
8383
{{- . | toYaml | nindent 12 }}
8484
{{- end }}
85+
{{- with .Values.operator.env }}
86+
{{- . | toYaml | nindent 12 }}
87+
{{- end }}
8588
image: {{ .Values.operator.image }}
8689
imagePullPolicy: IfNotPresent
8790
livenessProbe:

helm/camel-k/values.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ operator:
5050
annotations:
5151

5252
## Extra environment variables.
53+
## Deprecated: use env instead
5354
## ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
5455
extraEnv: []
55-
# - name: MY_VAR
56-
# value: my_value
56+
57+
## Operator environment variables: used to add any platform related configuration.
58+
env: []

0 commit comments

Comments
 (0)