You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix section "7-Connect Slack via Camel-K" in e2e tutorial. (#6424)
* Fix section "7-Connect Slack via Camel-K" in e2e
Overhauled the Camel K operator installation and configuration. Fixed
issues with the overall setup, a few typos and wrong directory paths.
The Pipe CR had a typo in the Broker name "bad-word-broker". Now it is
correctly "badword-broker"
Issue #6423.
Signed-off-by: Stanislav Jakuschevskij <[email protected]>
* Fix paths for slack sink manifests.
Signed-off-by: Stanislav Jakuschevskij <[email protected]>
---------
Signed-off-by: Stanislav Jakuschevskij <[email protected]>
Install the Apache Camel K CLI (`kamel`) on your local machine. You can find the installation instructions [here](https://camel.apache.org/camel-k/2.2.x/cli/cli.html){:target="_blank"}.
26
+

29
27
30
-
???+ bug "Troubleshooting"
31
-
32
-
If after installation you run `kamel version` and you get an error message, you may need to add the `kamel` binary to your system's PATH. You can do this by moving the `kamel` binary to a directory that is already in your PATH, or by adding the directory where `kamel` is located to your PATH.
28
+
Install Apache Camel K operator on your cluster using any of the methods listed in [the official installation docs](https://camel.apache.org/camel-k/2.8.x/installation/installation.html). We will use the installation via Kustomize:
Now you need to setup an `IntegrationPlatform` with a container registry. You can read more about it in [the official installation docs](https://camel.apache.org/camel-k/2.8.x/installation/installation.html#integration-platform). For all our needs we only need to create the `IntegrationPlatform` CR with a container registry entry. For example let's say we're using a Kind cluster with a local registry named `kind-registry` on port `5000`. Then your `IntegrationPlatform` CR will look like the following:
39
36
40
-

37
+
```yaml
38
+
apiVersion: camel.apache.org/v1
39
+
kind: IntegrationPlatform
40
+
metadata:
41
+
name: camel-k
42
+
namespace: camel-k # Make sure this is the namespace where your operator is running
43
+
spec:
44
+
build:
45
+
registry:
46
+
address: kind-registry:5000
47
+
insecure: true
48
+
```
41
49
42
-
Next, install Apache Camel K on your cluster using the Apache Camel K CLI:
Replace the placeholders with your actual Docker registry information.
49
-
50
-
If you are using other container registries, you may need to read more [here](https://camel.apache.org/camel-k/2.2.x/installation/registry/registry.html){:target="_blank"} for the installation.
67
+
If you are using other container registries, you may need to read more in the [container registry configuration docs](https://camel.apache.org/camel-k/2.8.x/installation/registry/registry.html#how-to-configure){:target="_blank"} for Apache Camel K.
51
68
52
69
???+ success "Verify"
53
70
54
-
You will see this message if the installation is successful:
71
+
Check the installation status of the operator:
55
72
56
73
```sh
57
-
📦 OLM is not available in the cluster. Fallback to regular installation.
58
-
🐪 Camel K installed in namespace default
74
+
kubectl get deploy -n camel-k
59
75
```
60
76
61
-
### **Prerequisite 3: Create a Slack App and Generate an Incoming Webhook URL**
77
+
You will see the output:
78
+
79
+
```
80
+
NAME READY UP-TO-DATE AVAILABLE AGE
81
+
camel-k-operator 1/1 1 1 47h
82
+
```
83
+
84
+
And the IntegrationPlatform:
85
+
86
+
```sh
87
+
kubectl get integrationplatforms -n camel-k
88
+
```
89
+
90
+
You will see the output with the registry address:
91
+
92
+
```sh
93
+
kubectl get integrationplatforms -n camel-k
94
+
NAME PHASE BUILD STRATEGY PUBLISH STRATEGY REGISTRY ADDRESS DEFAULT RUNTIME CAMEL VERSION
We use a feature called ["Pipe"](https://camel.apache.org/camel-k/2.3.x/apis/camel-k.html#_camel_apache_org_v1_Pipe){:target="_blank"} (a.k.a [KameletBinding](https://github.com/apache/camel-k/issues/2625){:target="_blank"}) in Apache Camel K to link event sources and destinations. Specifically, the Pipe connects events from our Broker, our source, to the Slack channel through a Slack sink [Kamelet](https://camel.apache.org/camel-k/2.3.x/kamelets/kamelets.html){:target="_blank"}, our destination.
147
+
We use a feature called ["Pipe"](https://camel.apache.org/camel-k/2.8.x/apis/camel-k.html#_camel_apache_org_v1_Pipe){:target="_blank"} (a.k.a [KameletBinding](https://github.com/apache/camel-k/issues/2625){:target="_blank"}) in Apache Camel K to link event sources and destinations. Specifically, the Pipe connects events from our Broker, our source, to the Slack channel through a Slack sink [Kamelet](https://camel.apache.org/camel-k/2.8.x/apis/camel-k.html#_camel_apache_org_v1_Kamelet){:target="_blank"}, our destination.
111
148
112
149

113
150
@@ -140,11 +177,11 @@ In the current implementation using Apache Camel K, we **can only filter based o
140
177
141
178

142
179
143
-
Here, we will be connecting `book-review-broker` with a new Broker called `badword-broker`. And we will be creating a Trigger that helps us perform the filtering with the extension `badwordfilter: good`.
180
+
Here, we will be connecting `bookstore-broker` with a new Broker called `badword-broker`. And we will be creating a Trigger that helps us perform the filtering with the extension `badwordfilter: good`.
144
181
145
-
- 1: Append the following content to your `node-server/config/200-broker.yaml`:
182
+
- 1: Create a new file named `slack-sink/config/100-broker.yaml` and add the following content:
You should see this message if the Broker is created successfully:
@@ -193,7 +230,6 @@ Broker 'badword-broker' successfully created in namespace 'default'.
193
230
```
194
231
195
232
196
-
197
233
???+ bug "Troubleshooting"
198
234
199
235
If there are issues, use the following command to diagnose:
@@ -206,15 +242,15 @@ Broker 'badword-broker' successfully created in namespace 'default'.
206
242
207
243

208
244
209
-
We are creating the Trigger to process the events that have type moderated-comment, and the extension `badwordfilter: bad` and route them to badword-broker.
245
+
We are creating the Trigger to process the events that have type `moderated-comment`, and the extension `badwordfilter: bad` and route them to `badword-broker`.
210
246
211
247
**Create a Trigger:**
212
248
213
249

214
250
215
-
- 1: Create a new YAML file named `node-server/config/badword-noti-trigger.yaml` and add the following content:
251
+
- 1: Append the following content to your `slack-sink/config/100-broker.yaml`:
@@ -372,7 +415,7 @@ This configuration ensures that Knative will always maintain at least one instan
372
415
???+ success "Verify"
373
416
374
417
```sh
375
-
$ kubectl get pods
418
+
kubectl get pods
376
419
```
377
420
378
421
Periodically check the status of the pipe-deployment pods, and see whether they will disappear! If they stay there, then we are good!
@@ -381,7 +424,7 @@ This configuration ensures that Knative will always maintain at least one instan
381
424
382
425

383
426
384
-
Now, you have completed building the sample app. When you submit a comment, you should always receive a notification in your test Slack workspace, achieving the same result as shown in the demo video.
427
+
Now, you have completed building the sample app. When you submit a "bad" comment, you should receive a notification in your test Slack workspace, achieving the same result as shown in the demo video.
385
428
386
429
## **Conclusion**
387
430
@@ -397,6 +440,4 @@ Congratulations on successfully completing the bookstore sample app tutorial! If
397
440
398
441
We've prepared additional challenges that build on top of the existing bookstore app for you to tackle. Some solutions are provided, while others are left open to encourage you to explore your own solutions.
399
442
400
-
401
-
402
443
[Go to Extra Challenges :fontawesome-solid-paper-plane:](../extra-challenge/README.md){ .md-button .md-button--primary }
0 commit comments