-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(knative): make installation explicit
Instead of letting the CLI perfom the installation, we need to make it explicit in order to use the same approach for any other installation methodology. Closes #4716
- Loading branch information
Showing
25 changed files
with
248 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# --------------------------------------------------------------------------- | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# --------------------------------------------------------------------------- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- operator-role-knative.yaml | ||
- operator-role-binding-knative.yaml | ||
- operator-cluster-role-binding-custom-resource-definitions.yaml | ||
namespace: test-611551d1-a98e-4391-8486-804cc2658830 |
31 changes: 31 additions & 0 deletions
31
config/rbac/knative/operator-cluster-role-binding-custom-resource-definitions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# --------------------------------------------------------------------------- | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# --------------------------------------------------------------------------- | ||
|
||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: camel-k-operator-custom-resource-definitions | ||
labels: | ||
app: "camel-k" | ||
subjects: | ||
- kind: ServiceAccount | ||
name: camel-k-operator | ||
namespace: placeholder | ||
roleRef: | ||
kind: ClusterRole | ||
name: camel-k-operator-custom-resource-definitions | ||
apiGroup: rbac.authorization.k8s.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
= Knative installation | ||
|
||
"https://knative.dev[Knative] is an Open-Source Enterprise-level solution to build Serverless and Event Driven Applications. The effort done in this project is a great complement to Camel K, which can leverage natively some feature offered by Knative. In particular, Camel K will be able to leverage "scale to 0" (hence, serverless) feature offered by Knative. | ||
|
||
NOTE: Knative is an optional configuration. It is not required to run Camel K. | ||
|
||
[[install-knative]] | ||
== Knative roles configuration | ||
|
||
Camel K needs to have certain privileges to use the resources used by Knative. We have identified them, so, it follows a few configuration that you will need to apply in order to make Camel K work with Knative. | ||
|
||
NOTE: We assume you have already both the Knative operator and the Camel K operator up and running. If not, the first step is to install both operator. See the guide on xref:installation/installation.adoc[how to install Camel K] and the guide on https://knative.dev/docs/install/[how to install Knative] respectively. | ||
|
||
Once all the resources are installed in the cluster, you'll need to perform the following action: | ||
|
||
```bash | ||
kubectl apply -k https://github.com/apache/camel-k/tree/main/config/rbac/knative?ref=v2.1.0 | ||
``` | ||
|
||
The configuration above is using the released version `2.1.0`. You may want to use instead another version or the latest development available on `main` branch. Before continuing with the configuration, you need to make sure to know which are the namespaces on which the Operator is running and on which your Integration is going to run (they could be the same). In order to change it, you must perform some customization locally in a similar fashion: | ||
|
||
```bash | ||
git clone https://github.com/apache/camel-k.git | ||
cd camel-k/config/rbac/knative | ||
sed -i "s/namespace: placeholder/namespace: $OPERATOR_NAMESPACE/" operator-cluster-role-binding-custom-resource-definitions.yaml | ||
sed -i "s/namespace: placeholder/namespace: $OPERATOR_NAMESPACE/" operator-role-binding-knative.yaml | ||
kustomize edit set namespace $IT_NAMESPACE | ||
kubectl apply -k . | ||
``` | ||
|
||
NOTE: you will need `kustomize` CLI available. | ||
|
||
As the installation procedure can vary depending on the cluster and the methodology you use (Helm, OLM, Kustomize, ...), feel free to customize in the way that it results more convenient. In the `/config/rbac/knative` you will already find the basic `kustomization.yaml` on top of which you may provide any further level of customization. | ||
|
||
From now on you should be able to run some Camel application leveraging Knative with Camel K (see https://github.com/apache/camel-k-examples/tree/main/generic-examples/knative[examples]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.