This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit b1128fbbf53a52927bd7520543c2c0774fe66d68 Author: Pasquale Congiusti <[email protected]> AuthorDate: Fri Jun 28 11:11:20 2024 +0200 chore(cmd): deprecate kamel install --- .../ROOT/pages/contributing/developers.adoc | 29 ++--- .../ROOT/pages/contributing/local-development.adoc | 2 +- .../ROOT/pages/contributing/remote-debugging.adoc | 3 +- .../pages/installation/advanced/http-proxy.adoc | 9 +- .../ROOT/pages/installation/advanced/maven.adoc | 132 ++------------------- .../ROOT/pages/installation/advanced/multi.adoc | 5 +- .../ROOT/pages/installation/advanced/offline.adoc | 9 +- .../pages/installation/advanced/resources.adoc | 24 +--- .../ROOT/pages/installation/installation.adoc | 19 --- docs/modules/ROOT/pages/installation/upgrade.adoc | 36 ++---- .../ROOT/pages/observability/logging/operator.adoc | 12 +- pkg/cmd/install.go | 9 +- pkg/cmd/reset.go | 2 +- pkg/cmd/uninstall.go | 11 +- release.adoc | 5 +- 15 files changed, 65 insertions(+), 242 deletions(-) diff --git a/docs/modules/ROOT/pages/contributing/developers.adoc b/docs/modules/ROOT/pages/contributing/developers.adoc index a7ba4a676..98a905b68 100644 --- a/docs/modules/ROOT/pages/contributing/developers.adoc +++ b/docs/modules/ROOT/pages/contributing/developers.adoc @@ -57,7 +57,7 @@ This is a high-level overview of the project structure: [options="header"] |======================= | Path | Content -| https://github.com/apache/camel-k/tree/main/addons[/addons] | Contains various of addons. +| https://github.com/apache/camel-k/tree/main/addons[/addons] | Contains various of addons. | https://github.com/apache/camel-k/tree/main/build[/build] | Contains the Docker and Maven build configuration. | https://github.com/apache/camel-k/tree/main/cmd[/cmd] | Contains the entry points (the *main* functions) for the **camel-k** binary (manager) and the **kamel** client tool. | https://github.com/apache/camel-k/tree/main/docs[/docs] | Contains the documentation website based on https://antora.org/[Antora]. @@ -130,6 +130,15 @@ For more detail on integration testing, refer to the following documentation: If you want to install everything you have in your source code and see it running on Kubernetes, you need to run the following command: +=== For Minikube + +First remove any camel k operator you may have installed, otherwise it will conflict with the new one we will build and install. + +* Enable the `registry` minikube addon: `minikube addons enable registry` +* Set the access to the internal minikube registry: `eval $(minikube docker-env)` +* Run `make images` to build the project and install the image in the internal minikube registry +* Install camel-k-operator: `make install-k8s-global` + === For Red Hat CodeReady Containers (CRC) * You need to have https://docs.docker.com/get-docker/[Docker] installed and running (or connected to a Docker daemon) @@ -137,32 +146,20 @@ If you want to install everything you have in your source code and see it runnin ** `oc extract secret/router-ca --keys=tls.crt -n openshift-ingress-operator`: to extract the certificate ** `sudo cp tls.crt /etc/docker/certs.d/default-route-openshift-image-registry.apps-crc.testing/ca.crt`: to copy the certificate for Docker daemon to trust ** `docker login -u kubeadmin -p $(oc whoami -t) default-route-openshift-image-registry.apps-crc.testing`: to test that the certificate is trusted -* Run `make install-crc`: to build the project and install it in the current namespace on CRC -* You can specify a different namespace with `make install-crc project=myawesomeproject` -* To uninstall Camel K, run `kamel uninstall --all --olm=false` +* Run `make install-openshift-global` The commands assume you have an already running CRC instance and logged in correctly. -=== For Minikube - -First remove any camel k operator you may have installed, otherwise it will conflict with the new one we will build and install. - -* Enable the `registry` minikube addon: `minikube addons enable registry` -* Set the access to the internal minikube registry: `eval $(minikube docker-env)` -* Run `make images` to build the project and install the image in the internal minikube registry -* Install camel-k-operator: `./kamel install` - === For remote Kubernetes/OpenShift clusters If you have changed anything locally and want to apply the changes to a remote cluster, first push your `camel-k` image to a custom repository (see <<building>>) and run the following command (the image name `docker.io/myrepo/camel-k:2.4.0-SNAPSHOT` should be changed accordingly): [source] ---- -kamel install --operator-image=docker.io/myrepo/camel-k:2.4.0-SNAPSHOT --operator-image-pull-policy=Always --olm=false +CUSTOM_IMAGE=docker.io/myrepo/camel-k CUSTOM_VERSION=2.4.0-SNAPSHOT make bundle +make install-k8s-global ---- -Note `--olm=false` is necessary as otherwise the OLM bundle version is preferred. - === Local Helm installation If you want to test Helm installation diff --git a/docs/modules/ROOT/pages/contributing/local-development.adoc b/docs/modules/ROOT/pages/contributing/local-development.adoc index c849b6e1c..a908f9f7a 100644 --- a/docs/modules/ROOT/pages/contributing/local-development.adoc +++ b/docs/modules/ROOT/pages/contributing/local-development.adoc @@ -54,7 +54,7 @@ Camel K integrations are based on https://github.com/apache/camel-k-runtime[Came make images CAMEL_K_RUNTIME_DIR=<path/to/local/ck-runtime/project> ---- -Once this is done you need to re-install via `./kamel install`. +Once this is done you need to re-install via `make install-k8s-global`. [[local-multi-arch]] === Local Multiple Architecture diff --git a/docs/modules/ROOT/pages/contributing/remote-debugging.adoc b/docs/modules/ROOT/pages/contributing/remote-debugging.adoc index a7b304914..b2506c397 100644 --- a/docs/modules/ROOT/pages/contributing/remote-debugging.adoc +++ b/docs/modules/ROOT/pages/contributing/remote-debugging.adoc @@ -60,7 +60,8 @@ namespace/test created Then, install the operator with the image that we built before [source,shell] ---- -./kamel install --olm=false --operator-image apache/camel-k-debug:2.0.0-SNAPSHOT --debugging -n test +CUSTOM_IMAGE=docker.io/myrepo/camel-k CUSTOM_VERSION=2.4.0-SNAPSHOT make bundle +make install-k8s-global ---- It will install the operator using `apache/camel-k-debug:2.0.0-SNAPSHOT` as docker image and launch it in debug mode. diff --git a/docs/modules/ROOT/pages/installation/advanced/http-proxy.adoc b/docs/modules/ROOT/pages/installation/advanced/http-proxy.adoc index 7e0b3517c..b79ea226a 100644 --- a/docs/modules/ROOT/pages/installation/advanced/http-proxy.adoc +++ b/docs/modules/ROOT/pages/installation/advanced/http-proxy.adoc @@ -5,14 +5,7 @@ Production or corporate environments can deny direct access to the Internet, and The Camel K operator can be configured to route egress traffic to this proxy, by setting the usual `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` on the operator Deployment. -This can be achieved with the Kamel CLI, at installation time, e.g.: - -[source,console] ----- -$ kamel install --operator-env-vars=HTTP_PROXY=http://proxy ----- - -Alternatively, the operator Deployment can be amended with the `kubectl` CLI, e.g.: +This can be achieved with the proper customization at installation time (see details for each specific installation method). Alternatively, the operator Deployment can be amended with the `kubectl` CLI, e.g.: [source,console] ---- diff --git a/docs/modules/ROOT/pages/installation/advanced/maven.adoc b/docs/modules/ROOT/pages/installation/advanced/maven.adoc index 6ce49386a..2d20b8cd1 100644 --- a/docs/modules/ROOT/pages/installation/advanced/maven.adoc +++ b/docs/modules/ROOT/pages/installation/advanced/maven.adoc @@ -35,13 +35,7 @@ In general you can https://maven.apache.org/settings.html[tune Maven] with any p kubectl create cm my-maven-proxy --from-file settings.xml ``` -Once the Configmap/Secret is ready, then, you can configure it in your Camel K operator directly at installation time: - -``` -kamel install --maven-settings configmap:my-maven-proxy/settings.xml -``` - -The ConfigMap or Secret can then be also referenced in the IntegrationPlatform resource, from the `spec.pipeline.maven.settings` field, e.g.: +Once the Configmap/Secret is ready, then, you can configure it in your Camel K operator directly at installation time (see specific installation method details). The ConfigMap or Secret can then be also referenced in the IntegrationPlatform resource, from the `spec.build.maven.settings` field, e.g.: [source,yaml] ---- @@ -50,7 +44,7 @@ kind: IntegrationPlatform metadata: name: camel-k spec: - pipeline: + build: maven: settings: configMapKeyRef: @@ -98,81 +92,6 @@ The IntegrationPlatform resource can be edited directly, to reference the Config $ kubectl edit ip camel-k ---- -[[maven-repositories]] -== Maven Repositories - -In case you only want to configure remote repositories, you can use the `--maven-repository` option, that automatically generates a `settings.xml` file (which is stored as a Configmap anyway): - -[source,console] ----- -$ kamel install --maven-repository <repository_url> ----- - -NOTE: Check the <<ca-certificates>> section, if these remote repositories require custom CA certificates. - -Extra attributes can be appended to the `repository_url`, using the `@` separator. -The following attributes are supported: - -.Maven Repository Attributes -[cols="1m,1,2"] -|=== -|Name |Type |Description - -| @id -| string -| Sets the repository `id` - -| @name -| string -| Sets the repository `name` - -| @snapshots -| flag -| Turns `snapshots.enabled` to `true` - -| @noreleases -| flag -| Turns `snapshots.enabled` to `false` - -| @checksumpolicy -| string -| Sets the repository `checksumPolicy` - -| @mirrorOf -| string -| Declares the repository as a mirror of the repositories with matching ids - -|=== - -For example, running the following command: - -[source,console] ----- -$ kamel install --maven-repository https://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases ----- - -Results in generating the following `settings.xml` file: - -[source,xml] ----- -<repositories> - <repository> - <id>apache</id> - <url>http://repository.apache.org/content/groups/snapshots-group</url> - <snapshots> - <enabled>true</enabled> - </snapshots> - <releases> - <enabled>false</enabled> - </releases> - </repository> -</repositories> ----- - -WARNING: The `--maven-settings` and `--maven-repository` options are mutually exclusive. - -You can find more information in the https://maven.apache.org/guides/introduction/introduction-to-repositories.html[Introduction to Repositories] from the Maven documentation. - [[http-proxy]] == HTTP Proxy @@ -196,11 +115,9 @@ The `kubectl` CLI provides a convenient command, to create a Secret from a file, $ kubectl create secret generic maven-ca-certs --from-file=ca.crt ---- -The Secret can contain X.509 certificates, and PKCS#7 formatted certificate chains. -A JKS formatted keystore is automatically created to store the CA certificate(s), and configured to be used as a trusted certificate(s) by the Maven commands. -The root CA certificates are also imported into the created keystore. +The Secret can contain X.509 certificates, and PKCS#7 formatted certificate chains. A JKS formatted keystore is automatically created to store the CA certificate(s), and configured to be used as a trusted certificate(s) by the Maven commands. The root CA certificates are also imported into the created keystore. -The created Secret can then be referenced in the IntegrationPlatform resource, from the `spec.pipeline.maven.caSecret` field, e.g.: +The created Secret can then be referenced in the IntegrationPlatform resource, from the `spec.build.maven.caSecret` field, e.g.: [source,yaml] ---- @@ -216,24 +133,10 @@ spec: name: tls-secret ---- -Alternatively, the Kamel CLI provides the `--maven-ca-secret` option, with the `install` command, that can be used to configure the Maven CA Secret at installation time, e.g.: - -[source,console] ----- -$ kamel install --maven-ca-secret <secret_name>/<secret_key> ----- - [[maven-extensions]] == Maven Extensions -The Maven https://maven.apache.org/guides/mini/guide-using-extensions.html[extensions] used by the Camel K operator while building integrations can be configured using the Kamel CLI through the `--maven-extension` option, e.g.: - -[source,console] ----- -$ kamel install --maven-extension fi.yle.tools:aws-maven:1.4.2 ----- - -The IntegrationPlatform resource stores extensions in the `spec.pipeline.maven.extension` field, e.g: +The Maven https://maven.apache.org/guides/mini/guide-using-extensions.html[extensions] used by the Camel K operator while building integrations can be configured changing the `spec.build.maven.extension` field, e.g: [source,yaml] ---- @@ -243,11 +146,10 @@ metadata: name: camel-k spec: build: - pipeline: - extension: - - artifactId: aws-maven - groupId: fi.yle.tools - version: 1.4.2 + extension: + - artifactId: aws-maven + groupId: fi.yle.tools + version: 1.4.2 ---- The IntegrationPlatform resource can be edited directly, to add or remove extensions, e.g.: @@ -377,8 +279,7 @@ $ kubectl create secret generic camel-k-s3-maven-settings --from-file=maven-sett === S3 TLS Certificates -In most cases, you will need to add the certificate(s) served by your S3 instance to the list of certificate(s) trusted by the Camel K Operator when running Maven commands. -Where/how to get the certificate(s) varies greatly depending on how your S3 instance is set up, and will not be covered here. +In most cases, you will need to add the certificate(s) served by your S3 instance to the list of certificate(s) trusted by the Camel K Operator when running Maven commands. Where/how to get the certificate(s) varies greatly depending on how your S3 instance is set up, and will not be covered here. Once retrieved, you should create a Kubernetes Secret containing the certificate(s) similar to what is described in the section <<ca-certificates>>, e.g.: [source,console] @@ -388,20 +289,11 @@ $ kubectl create secret generic s3-ca --from-file=s3-ca=ca.crt === Maven settings, certificates and extensions -We are now ready to configure the Camel K operator to use your S3 bucket as a Maven repository. -This can be done while installing the Operator using the Kamel CLI, e.g: - -[source,console] ----- -$ kamel install --maven-settings secret:camel-k-s3-maven-settings/maven-settings --maven-ca-secret s3-ca/s3-ca --maven-extension fi.yle.tools:aws-maven:1.4.3 ----- +We are now ready to configure the Camel K operator to use your S3 bucket as a Maven repository. This can be done setting the Maven settings, the CA secret and the extension as explained in the chapter above. -Maven dependencies hosted in your S3 bucket can now be used just like any other dependency when running an integration. -For example when using the Kamel CLI using the `--dependency` option: +Maven dependencies hosted in your S3 bucket can now be used just like any other dependency when running an integration. For example when using the Kamel CLI using the `--dependency` option: [source,console] ---- $ kamel run S3.java --dependency=mvn:artfiactId:groupId:version ---- - -Enjoy ! diff --git a/docs/modules/ROOT/pages/installation/advanced/multi.adoc b/docs/modules/ROOT/pages/installation/advanced/multi.adoc index 048f29a1c..2fbd1121a 100644 --- a/docs/modules/ROOT/pages/installation/advanced/multi.adoc +++ b/docs/modules/ROOT/pages/installation/advanced/multi.adoc @@ -15,10 +15,7 @@ The assigned operator will be responsible for the reconciliation of the annotate In detail, the Camel K operator supports the environment variable `OPERATOR_ID`. The value is an identifier that can be equal to any string (e.g. `OPERATOR_ID=operator-1`). Once the operator is assigned with an identifier, it will *only reconcile* Camel K custom resources that are assigned to that ID (unannotated resources will be ignored as well). -By default, the Camel K operator is using the id `camel-k`. When installing many operators the instances must use a different operator id. -(e.g. `kamel install --global --olm=false -n camel-ns-1 --operator-id=operator-2`). - -To assign a resource to a specific operator, the user can annotate it with `camel.apache.org/operator.id`. For example: +By default, the Camel K operator is using the id `camel-k`. When installing many operators the instances must use a different operator id. To assign a resource to a specific operator, the user can annotate it with `camel.apache.org/operator.id`. For example: [source,yaml] ---- diff --git a/docs/modules/ROOT/pages/installation/advanced/offline.adoc b/docs/modules/ROOT/pages/installation/advanced/offline.adoc index e88856f1f..afe970769 100644 --- a/docs/modules/ROOT/pages/installation/advanced/offline.adoc +++ b/docs/modules/ROOT/pages/installation/advanced/offline.adoc @@ -107,11 +107,7 @@ If you have already installed Camel K, then you can patch the `IntegrationPlatfo kubectl patch itp/camel-k --type=merge -p '{"spec": {"build": {"maven": {"settings": {"configMapKeyRef": {"key": "settings.xml", "name": "local-maven-settings-offline"}}}}}}' ``` -If you want to install Camel K with this custom maven settings.xml, use the parameter `--maven-settings`: - -``` -kamel install --maven-settings configmap:local-maven-settings-offline -``` +If you want to install Camel K with this custom maven settings.xml. [[itp-build-native]] === Quarkus Native Build @@ -181,7 +177,8 @@ Also in this case, you need to edit the IntegrationPlatform and add the `--offli Last option we may suggest is to build your own image of the operator from source and include in it the entire set of dependencies extracted. You need to extract everything under _/build/_maven_output_ directory. Then, run `make images` and it will create an image containing the whole repo. You can publish such image (which should have an average of 5 GB) calling it for instance `my-camel-k:2.0.0-offline` and later use to install the operator normally: ```bash -kamel install --operator-image my-camel-k:2.0.0-offline +CUSTOM_IMAGE=my-camel-k CUSTOM_VERSION=2.0.0-offline make bundle +make install-k8s-global ``` Also here, you need to edit the IntegrationPlatform and add the `--offline` (or `-o`) option as shown above. diff --git a/docs/modules/ROOT/pages/installation/advanced/resources.adoc b/docs/modules/ROOT/pages/installation/advanced/resources.adoc index 796c852fa..b6599ad25 100644 --- a/docs/modules/ROOT/pages/installation/advanced/resources.adoc +++ b/docs/modules/ROOT/pages/installation/advanced/resources.adoc @@ -11,33 +11,15 @@ NOTE: The aforementioned flags setting will work both with `OLM` installation an == Scheduling === Node Selectors -The most basic operation we provide is to let you assign Camel K operator `Pods` to a specific cluster `Node` via `--node-selector` option. The functionality is based on https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/[`NodeSelector` Kubernetes feature]. As an example, you can schedule Camel K infra `Pods` to a specific `Node` of your cluster: - -``` -kamel install --node-selector kubernetes.io/hostname=ip-172-20-114-199.ec2.internal ... -``` - -The option will accept any `key=value` pair as specified and supported by Kubernetes. You can specify more than one `node-selector`. +The most basic operation we provide is to let you assign Camel K operator `Pods` to a specific cluster `Node`. The functionality is based on https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/[`NodeSelector` Kubernetes feature]. As an example, you can schedule Camel K infra `Pods` to a specific `Node` of your cluster. See how to configure according the installation methodology selected. === Tolerations -The `--toleration` option will let you tolerate a Camel K infra `Pod` to support any matching `Taint` according the https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/[`Taint` and `Toleration` Kubernetes feature]. As an example, let's suppose we have a node tainted as "dedicated=camel-k:NoSchedule". In order to allow the infra `Pods` to be scheduled on that `Node` we can provide the following option during installation procedure: - -``` -kamel install --toleration dedicated=camel-k:NoSchedule ... -``` - -The option accept a value in the following format `Key[=Value]:Effect[:Seconds]` where the values in squared bracket are considered optional and `Effect` must admit any of the `Taints` accepted values: `NoSchedule`, `PreferNoSchedule`, `NoExecute`. You can specify more than one `toleration`. +The `--toleration` option will let you tolerate a Camel K infra `Pod` to support any matching `Taint` according the https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/[`Taint` and `Toleration` Kubernetes feature]. As an example, let's suppose we have a node tainted as "dedicated=camel-k:NoSchedule". In order to allow the infra `Pods` to be scheduled on that `Node` we can provide the following option during installation procedure. See how to configure according t [...] [[scheduling-infra-pod-resources]] == Resources -While installing the Camel K operator, you can also specify the resources requests and limits to assign to the operator `Pod` with `--operator-resources` option. The option will expect the configuration as required by https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[Kubernetes Resource Management]. - -``` -kamel install --operator-resources limits.cpu=8 --operator-resources limits.memory=32Gi ... -``` - -The value expected by the option are in the form `requestType.requestResource=value` where `requestType` must be either `requests` or `limits`, `requestResource` must be either `cpu` or `memory` and `value` expressed in the numeric value as expected by the resource. You can specify more than one `operator-resources`. +While installing the Camel K operator, you can also specify the resources requests and limits to assign to the operator `Pod` with `--operator-resources` option. The option will expect the configuration as required by https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[Kubernetes Resource Management]. See how to configure according the installation methodology selected. NOTE: if you specify a limit, but does not specify a request, Kubernetes automatically assigns a request that matches the limit. diff --git a/docs/modules/ROOT/pages/installation/installation.adoc b/docs/modules/ROOT/pages/installation/installation.adoc index cd5ad7d4b..8b78acaa6 100644 --- a/docs/modules/ROOT/pages/installation/installation.adoc +++ b/docs/modules/ROOT/pages/installation/installation.adoc @@ -8,25 +8,6 @@ Camel K allows us to run Camel integrations directly on a Kubernetes or OpenShif Camel K may require a container registry which is used to store the images built for your applications. Certain clusters may use their internal container registry (ie, Openshift, Minikube or https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry[KEP-1755 compatible] clusters). If it's not the case for your cluster make sure to have a xref:installation/registry/registry.adoc#configuring-registry-install-time[container [...] -[[cli]] -== Installation via Kamel CLI - -To start using Camel K you need the **"kamel"** CLI tool, that can be used to both configure the cluster and run integrations. Look into the https://github.com/apache/camel-k/releases[release page] for the latest version of the *camel-k-client* tool for your specific platform. - -Download and deflate the archive. It contains a small binary file named `kamel` that you should put into your system path. For example, if you're using Linux, you can put `kamel` in `/usr/bin`. - -Once you have put the `kamel` CLI in the path, log into your cluster using the standard `oc` (OpenShift) or `kubectl` (Kubernetes) client tool and execute the following command to install Camel K: - -[source] ----- -$ kamel install --olm=false ----- - -This will configure the cluster with the Camel K custom resource definitions and install the operator on the current namespace with the default settings. - -IMPORTANT: Custom Resource Definitions (CRD) are cluster-wide objects and you need admin rights to install them. Fortunately, this operation can be done *once per cluster*. So, if the `kamel install` operation fails, you'll be asked to repeat it when logged as admin. -For CRC, this means executing `oc login -u system:admin` then `kamel install --cluster-setup` only for the first-time installation. - [[helm]] == Installation via Helm Hub diff --git a/docs/modules/ROOT/pages/installation/upgrade.adoc b/docs/modules/ROOT/pages/installation/upgrade.adoc index 95dccc2b3..08ddf9c79 100644 --- a/docs/modules/ROOT/pages/installation/upgrade.adoc +++ b/docs/modules/ROOT/pages/installation/upgrade.adoc @@ -5,17 +5,21 @@ Camel K is delivering new features with each new release, so, you'll be probably NOTE: you must notice that the deployment resources linked to an Integration (ie, Deployment, Knative-Service or CronJob) can change, if the new operator is setting any new configuration. This would lead to a transparent Pod rollout for all the existing Integrations at their very first reconciliation loop cycle (when the new operator will takeover from the previous one). -[[cli]] -== Upgrade via Kamel CLI +[[kustomize]] +== Upgrade via Kustomize -The CLI needs to perform a forcefully installation on top of the existing installation. This is required in order to upgrade the CRDs and any other configuration in the new operator. You need to replace your `kamel` CLI binary with the new one released. Once you have replaced your new `kamel` you can proceed with the installation: +If you want to upgrade via https://kustomize.io[Kustomize] you'll need to execute the same installation procedure you did for the previous version and add the `--force-conflicts` flag which will take care to overwrite any conflicting configuration (ie, rewriting the CRDs). Here an example for a descoped (global) installation procedure: -[source] ----- -kamel install --force --olm=false ----- +``` +$ kubectl apply -k github.com/apache/camel-k/install/overlays/kubernetes/descoped?ref=v2.4.0 --server-side --force-conflicts +``` + +[[operatorhub]] +== Upgrade via Operator Hub -[[helms]] +Upgrading via https://operatorhub.io/[Operator Hub] may be automatically done by the cluster if this option was set at installation time. If not, you need to follow the instructions in the https://operatorhub.io/operator/camel-k[Camel K Operator Hub] page. + +[[helm]] == Upgrade via Helm Generally, when upgrading a patch or a minor version, we may introduce slight non-breaking compatibility changes in CRDs. These changes should be onboard-ed with the installation procedure you're using (CLI, OLM, Kustomize). However, you may want to control the upgrade of CRDs (for instance, upgrading in Helm, which, does not support CRDs upgrade out of the box). In this case, before doing the upgrade, you'll need to manually upgrade the CRDs, in order to use the new parameters expected [...] @@ -29,20 +33,6 @@ $ kubectl replace -f camel-k/crds $ helm upgrade camel-k/camel-k --version x.y.z ``` -[[operatorhub]] -== Upgrade via Operator Hub - -Upgrading via https://operatorhub.io/[Operator Hub] may be automatically done by the cluster if this option was set at installation time. If not, you need to follow the instructions in the https://operatorhub.io/operator/camel-k[Camel K Operator Hub] page. - -[[kustomize]] -== Upgrade via Kustomize - -If you want to upgrade via https://kustomize.io[Kustomize] you'll need to execute the same installation procedure you did for the previous version and add the `--force-conflicts` flag which will take care to overwrite any conflicting configuration (ie, rewriting the CRDs). Here an example for a descoped (global) installation procedure: - -``` -$ kubectl apply -k github.com/apache/camel-k/install/overlays/kubernetes/descoped?ref=v2.4.0 --server-side --force-conflicts -``` - NOTE: you may need to perform more configuration to reflect the same customization configuration done in the previous version installation. [[refresh-integrations]] @@ -59,7 +49,7 @@ Since Camel K version 2, we're able to run any Camel K runtime version from the ---- kamel run /tmp/Test.java -t camel.runtime-version=1.17.0 -kamel install --force //ie, version 2.0.0 +kubectl apply -k github.com/apache/camel-k/install/overlays/kubernetes/descoped?ref=v2.4.0 --server-side --force-conflicts //ie, version 2.4.0 kamel rebuild test kamel logs test [1] 2023-04-13 13:38:43,648 INFO [org.apa.cam.k.Runtime] (main) Apache Camel K Runtime 1.17.0 diff --git a/docs/modules/ROOT/pages/observability/logging/operator.adoc b/docs/modules/ROOT/pages/observability/logging/operator.adoc index 691854426..e77493181 100644 --- a/docs/modules/ROOT/pages/observability/logging/operator.adoc +++ b/docs/modules/ROOT/pages/observability/logging/operator.adoc @@ -17,18 +17,8 @@ This may differ when running the operator locally, for development purposes, in [[operator-logging-level]] == Logging Level -The operator log level is controlled by an environment setting (`LOG_LEVEL`) on the operator deployment. You can set the log level on the kamel install command like this - -[source,bash] ----- -kamel install --log-level debug ----- - -This will set the log level to `debug`, so you can expect a more verbose operator output. The default level is `info`. +The operator log level is controlled by an environment setting (`LOG_LEVEL`) on the operator deployment. You can set the log level during installation procedure (see details in installation section). The default level is `info`. In general log levels are represented by numeric verbosity levels where `0` is the standard info log level and `1` is debug level. All values `2-10` represent different trace levels. You can set numeric values or one of the preset values `info`, `debug`, `error`. - -As an alternative to using the `--log-level` option on the kamel CLI you can add an environment variable (`LOG_LEVEL=debug`) directly to the Camel K operator deployment. -You may need to restart the operator pods controlled by the deployment to see the effect in the log output. diff --git a/pkg/cmd/install.go b/pkg/cmd/install.go index c1ca3d945..5cead9995 100644 --- a/pkg/cmd/install.go +++ b/pkg/cmd/install.go @@ -59,10 +59,11 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) (*cobra.Command, *installCmdO RootCmdOptions: rootCmdOptions, } cmd := cobra.Command{ - Use: installCommand, - Short: "Install Camel K on a Kubernetes cluster", - Long: `Install Camel K on a Kubernetes or OpenShift cluster.`, - PreRunE: options.decode, + Use: installCommand, + Short: "Install Camel K on a Kubernetes cluster", + Long: `Install Camel K on a Kubernetes or OpenShift cluster.`, + Deprecated: "consider using Kustomize, Helm or OLM (see https://camel.apache.org/camel-k/next/installation/installation.html)", + PreRunE: options.decode, RunE: func(cmd *cobra.Command, args []string) error { if err := options.validate(cmd, args); err != nil { return err diff --git a/pkg/cmd/reset.go b/pkg/cmd/reset.go index ec9416ff2..02a6f414e 100644 --- a/pkg/cmd/reset.go +++ b/pkg/cmd/reset.go @@ -171,7 +171,7 @@ func (o *resetCmdOptions) resetIntegrationPlatform(c client.Client) error { if len(list.Items) > 1 { return fmt.Errorf("expected 1 integration platform in the namespace, found: %d", len(list.Items)) } else if len(list.Items) == 0 { - return errors.New("no integration platforms found in the namespace: run \"kamel install\" to install the platform") + return errors.New("no integration platforms found in the namespace") } platform := list.Items[0] // Let's reset the status diff --git a/pkg/cmd/uninstall.go b/pkg/cmd/uninstall.go index b433dcf4c..736b13598 100644 --- a/pkg/cmd/uninstall.go +++ b/pkg/cmd/uninstall.go @@ -46,11 +46,12 @@ func newCmdUninstall(rootCmdOptions *RootCmdOptions) (*cobra.Command, *uninstall } cmd := cobra.Command{ - Use: "uninstall", - Short: "Uninstall Camel K from a Kubernetes cluster", - Long: `Uninstalls Camel K from a Kubernetes or OpenShift cluster.`, - PreRunE: options.decode, - RunE: options.uninstall, + Use: "uninstall", + Short: "Uninstall Camel K from a Kubernetes cluster", + Long: `Uninstalls Camel K from a Kubernetes or OpenShift cluster.`, + Deprecated: "consider using Kustomize, Helm or OLM (see https://camel.apache.org/camel-k/next/installation/uninstalling.html)", + PreRunE: options.decode, + RunE: options.uninstall, } cmd.Flags().Bool("skip-operator", false, "Do not uninstall the Camel K Operator in the current namespace") diff --git a/release.adoc b/release.adoc index a6c3a048a..c87a78d90 100644 --- a/release.adoc +++ b/release.adoc @@ -142,7 +142,8 @@ Camel K Client 2.0.0 If the version retrieved is the one expected you can run an installation procedure ``` -$ ./kamel install --operator-image=camelk/camel-k:$CAMEL_K_VERSION +CUSTOM_IMAGE=camelk/camel-k CUSTOM_VERSION=$CAMEL_K_VERSION make bundle +make install-k8s-global ``` Make some test and if all is in order, you can upload the sources and CLIs to the dist/dev repository in ASF the staged artifacts, in order to link them in the release vote communication. @@ -194,7 +195,7 @@ Wait for maven mirrors to sync the new artifacts. This can take more than 1 hour You can start a release from the tag created in the previous steps (ie, `v2.1.0`). You can use the automatic release note generator, making sure to select the previous stable release to generate the differences. You need to manually add the CLI files, the CRDs dependency and the sbom.json created in the previous steps. Select it as latest stable release and finalize the process. Before announcing the release, perform a simple test to verify that everything is in place (running a "Hello World" integration -after an installation done with a simple `kamel install`). Do a simple final test. +after an installation done with, as an example `kubectl apply -k github.com/apache/camel-k/install/overlays/openshift/descoped?ref=v2.1.0 --server-side`). Do a simple final test. The release can be now announced to [email protected] and [email protected] ideally accompanied by a blog post to explain what's new. A PMC member with access to the @ApacheCamel former Twitter account should announce the release on former Twitter as well.
