Chapter 2. Preparing your OpenShift cluster This chapter explains how to install Red Hat Integration - Camel K and OpenShift Serverless on OpenShift, and how to install the required Camel K and OpenShift Serverless command-line client tools in your development environment. Section 2.1, "Installing Camel K" Section 2.2, "Installing OpenShift Serverless" 2.1. Installing Camel K You can install the Red Hat Integration - Camel K Operator on your OpenShift cluster from the OperatorHub. The OperatorHub is available from the OpenShift Container Platform web console and provides an interface for cluster administrators to discover and install Operators. After you install the Camel K Operator, you can install the Camel K CLI tool for command line access to all Camel K features. Prerequisites You have access to an OpenShift 4.6 (or later) cluster with the correct access level, the ability to create projects and install operators, and the ability to install CLI tools on your local system. Note You installed the OpenShift CLI tool ( oc ) so that you can interact with the OpenShift cluster at the command line. For details on how to install the OpenShift CLI, see Installing the OpenShift CLI . Procedure In the OpenShift Container Platform web console, log in by using an account with cluster administrator privileges. Create a new OpenShift project: In the left navigation menu, click Home > Project > Create Project . Enter a project name, for example, my-camel-k-project , and then click Create . In the left navigation menu, click Operators > OperatorHub . In the Filter by keyword text box, type Camel K and then click the Red Hat Integration - Camel K Operator card. Read the information about the operator and then click Install . The Operator installation page opens. Select the following subscription settings: Update Channel > latest Choose among the following 2 options: Installation Mode > A specific namespace on the cluster > my-camel-k-project Installation Mode > All namespaces on the cluster (default) > Openshift operator Note Approval Strategy > Automatic Note The Installation mode > All namespaces on the cluster and Approval Strategy > Manual settings are also available if required by your environment. Click Install , and wait a few moments until the Camel K Operator is ready for use. Download and install the Camel K CLI tool: From the Help menu (?) at the top of the OpenShift web console, select Command line tools . Scroll down to the kamel - Red Hat Integration - Camel K - Command Line Interface section. Click the link to download the binary for your local operating system (Linux, Mac, Windows). Unzip and install the CLI in your system path. To verify that you can access the Kamel K CLI, open a command window and then type the following: kamel --help This command shows information about Camel K CLI commands. Note If you uninstall the Camel K operator from OperatorHub using OLM, the CRDs are not removed. To shift back to a Camel K operator, you must remove the CRDs manually by using the following command. oc get crd -l app=camel-k -o name | xargs oc delete step (optional) Specifying Camel K resource limits 2.1.1. Consistent integration platform settings You can create namespace local Integration Platform resources to overwrite settings used in the operator. These namespace local platform settings must be derived from the Integration Platform being used by the operator by default. That is, only explicitly specified settings overwrite the platform defaults used in the operator. Therefore, you must use a consistent platform settings hierarchy where the global operator platform settings always represent the basis for user specified platform settings. In case of global Camel K operator, if IntegrationPlatform specifies non-default spec.build.buildStrategy, this value is also propagated to namespaced Camel-K operators installed thereafter. Default value for buildStrategy is routine. USD oc get ip camel-k -o yaml -n openshift-operators apiVersion: camel.apache.org/v1 kind: IntegrationPlatform metadata: labels: app: camel-k name: camel-k namespace: openshift-operators spec: build: buildStrategy: pod The parameter buildStrategy of global operator IntegrationPlatform can be edited by one of the following ways; From Dashboard Administrator view: Operators Installed operators in namespace openshift-operators (that is, globally installed operators), select Red Hat Integration - Camel K Integration Platform YAML Now add or edit (if already present) spec.build.buildStrategy: pod Click Save Using the following command. Any namespaced Camel K operators installed subsequently would inherit settings from the global IntegrationPlatform. oc patch ip/camel-k -p '{"spec":{"build":{"buildStrategy": "pod"}}}' --type merge -n openshift-operators 2.1.2. Specifying Camel K resource limits When you install Camel K, the OpenShift pod for Camel K does not have any limits set for CPU and memory (RAM) resources. If you want to define resource limits for Camel K, you must edit the Camel K subscription resource that was created during the installation process. Prerequisite You have cluster administrator access to an OpenShift project in which the Camel K Operator is installed as described in Installing Camel K . You know the resource limits that you want to apply to the Camel K subscription. For more information about resource limits, see the following documentation: Setting deployment resources in the OpenShift documentation. Managing Resources for Containers in the Kubernetes documentation. Procedure Log in to the OpenShift Web console. Select Operators > Installed Operators > Operator Details > Subscription . Select Actions > Edit Subscription . The file for the subscription opens in the YAML editor. Under the spec section, add a config.resources section and provide values for memory and cpu as shown in the following example: Save your changes. OpenShift updates the subscription and applies the resource limits that you specified. 2.2. Installing OpenShift Serverless You can install the OpenShift Serverless Operator on your OpenShift cluster from the OperatorHub. The OperatorHub is available from the OpenShift Container Platform web console and provides an interface for cluster administrators to discover and install Operators. The OpenShift Serverless Operator supports both Knative Serving and Knative Eventing features. For more details, see installing OpenShift Serverless Operator . Prerequisites You have cluster administrator access to an OpenShift project in which the Camel K Operator is installed. You installed the OpenShift CLI tool ( oc ) so that you can interact with the OpenShift cluster at the command line. For details on how to install the OpenShift CLI, see Installing the OpenShift CLI . Procedure In the OpenShift Container Platform web console, log in by using an account with cluster administrator privileges. In the left navigation menu, click Operators > OperatorHub . In the Filter by keyword text box, enter Serverless to find the OpenShift Serverless Operator . Read the information about the Operator and then click Install to display the Operator subscription page. Select the default subscription settings: Update Channel > Select the channel that matches your OpenShift version, for example, 4.14 Installation Mode > All namespaces on the cluster Approval Strategy > Automatic Note The Approval Strategy > Manual setting is also available if required by your environment. Click Install , and wait a few moments until the Operator is ready for use. Install the required Knative components using the steps in the OpenShift documentation: Installing Knative Serving Installing Knative Eventing (Optional) Download and install the OpenShift Serverless CLI tool: From the Help menu (?) at the top of the OpenShift web console, select Command line tools . Scroll down to the kn - OpenShift Serverless - Command Line Interface section. Click the link to download the binary for your local operating system (Linux, Mac, Windows) Unzip and install the CLI in your system path. To verify that you can access the kn CLI, open a command window and then type the following: kn --help This command shows information about OpenShift Serverless CLI commands. For more details, see the OpenShift Serverless CLI documentation . Additional resources Installing OpenShift Serverless in the OpenShift documentation 2.3. Configuring Maven repository for Camel K For Camel K operator, you can provide the Maven settings in a ConfigMap or a secret. Procedure To create a ConfigMap from a file, run the following command. Created ConfigMap can be then referenced in the IntegrationPlatform resource, from the spec.build.maven.settings field. Example Or you can edit the IntegrationPlatform resource directly to reference the ConfigMap that contains the Maven settings using following command: Configuring CA certificates for remote Maven repositories You can provide the CA certificates, used by the Maven commands to connect to the remote Maven repositories, in a Secret. Procedure Create a Secret from file using following command: Reference the created Secret in the IntegrationPlatform resource, from the spec.build.maven.caSecret field as shown below.

Commands:
You do not need to create a pull secret when installing Camel K from the OpenShift OperatorHub. The Camel K Operator automatically reuses the OpenShift cluster-level authentication to pull the Camel K image from `registry.redhat.io`.
If you do not choose among the above two options, the system by default chooses a global namespace on the cluster then leading to openshift operator.
oc get ip camel-k -o yaml -n openshift-operators apiVersion: camel.apache.org/v1 kind: IntegrationPlatform metadata: labels: app: camel-k name: camel-k namespace: openshift-operators spec: build: buildStrategy: pod
patch ip/camel-k -p '{"spec":{"build":{"buildStrategy": "pod"}}}' --type merge -n openshift-operators
spec: channel: default config: resources: limits: memory: 512Mi cpu: 500m requests: cpu: 200m memory: 128Mi
create configmap maven-settings --from-file=settings.xml
apiVersion: camel.apache.org/v1 kind: IntegrationPlatform metadata: name: camel-k spec: build: maven: settings: configMapKeyRef: key: settings.xml name: maven-settings
edit ip camel-k
create secret generic maven-ca-certs --from-file=ca.crt
apiVersion: camel.apache.org/v1 kind: IntegrationPlatform metadata: name: camel-k spec: build: maven: caSecret: key: tls.crt name: tls-secret