From be4ecf39fdb141b4707fc37d29b5846d472bbf21 Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Mon, 15 Mar 2021 11:55:39 +0100 Subject: [PATCH 1/5] test: Add toleration trait e2e tests --- e2e/common/traits/toleration_test.go | 128 ++++++++++++++++++--------- e2e/support/test_support.go | 19 ++++ 2 files changed, 107 insertions(+), 40 deletions(-) diff --git a/e2e/common/traits/toleration_test.go b/e2e/common/traits/toleration_test.go index b0469d4bb8..50a53866a8 100644 --- a/e2e/common/traits/toleration_test.go +++ b/e2e/common/traits/toleration_test.go @@ -25,8 +25,10 @@ import ( "testing" . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gstruct" v1 "k8s.io/api/core/v1" + "k8s.io/utils/pointer" . "github.com/apache/camel-k/e2e/support" camelv1 "github.com/apache/camel-k/pkg/apis/camel/v1" @@ -35,46 +37,92 @@ import ( func TestTolerationTrait(t *testing.T) { WithNewTestNamespace(t, func(ns string) { Expect(Kamel("install", "-n", ns).Execute()).To(Succeed()) - var wait int64 = 300 - - InvokeUserTestCode(t, ns, func(ns string) { - t.Run("Run Java with node toleration operation exists", func(t *testing.T) { - Expect(Kamel("run", "-n", ns, "files/Java.java", - "--name", "java1", - "-t", "toleration.enabled=true", - "-t", "toleration.taints=camel.apache.org/master:NoExecute:300").Execute()).To(Succeed()) - Eventually(IntegrationPodPhase(ns, "java1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) - Eventually(IntegrationCondition(ns, "java1", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue)) - Eventually(IntegrationLogs(ns, "java1"), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) - - pod := IntegrationPod(ns, "java1")() - Expect(pod.Spec.Tolerations).NotTo(BeNil()) - - Expect(pod.Spec.Tolerations).To(ContainElement(v1.Toleration{ - "camel.apache.org/master", v1.TolerationOpExists, "", v1.TaintEffectNoExecute, &wait, - })) - - Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed()) - }) - - t.Run("Run Java with node toleration operation equals", func(t *testing.T) { - Expect(Kamel("run", "-n", ns, "files/Java.java", - "--name", "java2", - "-t", "toleration.enabled=true", - "-t", "toleration.taints=camel.apache.org/master=test:NoExecute:300").Execute()).To(Succeed()) - Eventually(IntegrationPodPhase(ns, "java2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) - Eventually(IntegrationCondition(ns, "java2", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue)) - Eventually(IntegrationLogs(ns, "java2"), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) - - pod := IntegrationPod(ns, "java2")() - Expect(pod.Spec.Tolerations).NotTo(BeNil()) - - Expect(pod.Spec.Tolerations).To(ContainElement(v1.Toleration{ - "camel.apache.org/master", v1.TolerationOpEqual, "test", v1.TaintEffectNoExecute, &wait, - })) - - Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed()) - }) + + t.Run("Run Java with node toleration operation exists", func(t *testing.T) { + name := "java1" + Expect(Kamel("run", "-n", ns, "files/Java.java", + "--name", name, + "-t", "toleration.enabled=true", + "-t", "toleration.taints=camel.apache.org/master:NoExecute:300", + ).Execute()).To(Succeed()) + Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(v1.PodRunning)) + Eventually(IntegrationCondition(ns, name, camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue)) + Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) + + pod := IntegrationPod(ns, name)() + Expect(pod.Spec.Tolerations).NotTo(BeNil()) + + Expect(pod.Spec.Tolerations).To(ContainElement(v1.Toleration{ + Key: "camel.apache.org/master", + Operator: v1.TolerationOpExists, + Effect: v1.TaintEffectNoExecute, + TolerationSeconds: pointer.Int64Ptr(300), + })) + }) + + t.Run("Run Java with node toleration operation equals", func(t *testing.T) { + name := "java2" + Expect(Kamel("run", "-n", ns, "files/Java.java", + "--name", name, + "-t", "toleration.enabled=true", + "-t", "toleration.taints=camel.apache.org/master=test:NoExecute:300", + ).Execute()).To(Succeed()) + Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(v1.PodRunning)) + Eventually(IntegrationCondition(ns, name, camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue)) + Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) + + pod := IntegrationPod(ns, name)() + Expect(pod.Spec.Tolerations).NotTo(BeNil()) + + Expect(pod.Spec.Tolerations).To(ContainElement(v1.Toleration{ + Key: "camel.apache.org/master", + Operator: v1.TolerationOpEqual, + Value: "test", Effect: v1.TaintEffectNoExecute, + TolerationSeconds: pointer.Int64Ptr(300), + })) }) + + t.Run("Run Java with master node toleration", func(t *testing.T) { + name := "java3" + Expect(Kamel("install", "-n", ns).Execute()).To(Succeed()) + Expect(Kamel("run", "-n", ns, "files/Java.java", + "--name", name, + // Use the affinity trait to force the scheduling of the Integration pod onto a master node + "-t", "affinity.enabled=true", + "-t", "affinity.node-affinity-labels=node-role.kubernetes.io/master", + // And tolerate the corresponding taint + "-t", "toleration.enabled=true", + "-t", "toleration.taints=node-role.kubernetes.io/master:NoSchedule", + ).Execute()).To(Succeed()) + + Eventually(IntegrationPodPhase(ns, name), TestTimeoutMedium).Should(Equal(v1.PodRunning)) + Eventually(IntegrationCondition(ns, name, camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue)) + Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) + + pod := IntegrationPod(ns, name)() + Expect(pod).NotTo(BeNil()) + + // Check the Integration pod contains the toleration + Expect(pod.Spec.Tolerations).To(ContainElement(v1.Toleration{ + Key: "node-role.kubernetes.io/master", + Operator: v1.TolerationOpExists, + Effect: v1.TaintEffectNoSchedule, + })) + + // Check the Integration pod is running on a master node + node := Node(pod.Spec.NodeName)() + Expect(node).NotTo(BeNil()) + Expect(node).To(PointTo(MatchFields(IgnoreExtras, Fields{ + "Spec": MatchFields(IgnoreExtras, Fields{ + "Taints": ContainElement(v1.Taint{ + Key: "node-role.kubernetes.io/master", + Effect: v1.TaintEffectNoSchedule, + }), + }), + }))) + }) + + // Clean up + Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed()) }) } diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index 4431d0bac9..dd7365cf6d 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -382,6 +382,25 @@ func Lease(ns string, name string) func() *coordination.Lease { } } +func Node(name string) func() *corev1.Node { + return func() *corev1.Node { + node := &corev1.Node{ + TypeMeta: metav1.TypeMeta{ + Kind: "Node", + APIVersion: corev1.SchemeGroupVersion.String(), + }, + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + } + err := TestClient().Get(TestContext, ctrl.ObjectKeyFromObject(node), node) + if err != nil { + panic(err) + } + return node + } +} + func Service(ns string, name string) func() *corev1.Service { return func() *corev1.Service { svc := corev1.Service{} From 0aa85f4561525d714197f02184744e02ac11bf7b Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Mon, 15 Mar 2021 11:56:45 +0100 Subject: [PATCH 2/5] chore: Rename PodDisruptionBudget trait e2e test --- e2e/common/traits/pdb_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/common/traits/pdb_test.go b/e2e/common/traits/pdb_test.go index 591e90f3a3..fdb9691629 100644 --- a/e2e/common/traits/pdb_test.go +++ b/e2e/common/traits/pdb_test.go @@ -40,7 +40,7 @@ import ( camelv1 "github.com/apache/camel-k/pkg/apis/camel/v1" ) -func TestPodDisruptionBudget(t *testing.T) { +func TestPodDisruptionBudgetTrait(t *testing.T) { WithNewTestNamespace(t, func(ns string) { name := "java" Expect(Kamel("install", "-n", ns).Execute()).To(Succeed()) From e21a2955c32d0b43c4cec4d180baa51e43078f8a Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Mon, 15 Mar 2021 12:03:47 +0100 Subject: [PATCH 3/5] chore(doc): Polish toleration trait documentation --- docs/modules/traits/pages/toleration.adoc | 12 +++++++----- pkg/trait/toleration.go | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/modules/traits/pages/toleration.adoc b/docs/modules/traits/pages/toleration.adoc index 906745be02..07f8cb9f94 100755 --- a/docs/modules/traits/pages/toleration.adoc +++ b/docs/modules/traits/pages/toleration.adoc @@ -4,11 +4,13 @@ This trait sets Tolerations over Integration pods. Tolerations allow (but do not require) the pods to schedule onto nodes with matching taints. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ for more details. -The toleration should be expressed in a similar manner of taints *_Key[=Value]:Effect[:Seconds]_* where values in square brackets are optional. Examples: +The toleration should be expressed in a similar manner that of taints, i.e., `Key[=Value]:Effect[:Seconds]`, where values in square brackets are optional. -node-role.kubernetes.io/master:NoSchedule -node.kubernetes.io/network-unavailable:NoExecute:3000 -disktype=ssd:PreferNoSchedule +For examples: + +- `node-role.kubernetes.io/master:NoSchedule` +- `node.kubernetes.io/network-unavailable:NoExecute:3000` +- `disktype=ssd:PreferNoSchedule` It's disabled by default. @@ -36,7 +38,7 @@ The following configuration options are available: | toleration.taints | []string -| The taint to tolerate in the form Key[=Value]:Effect[:Seconds] +| The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]` |=== diff --git a/pkg/trait/toleration.go b/pkg/trait/toleration.go index 80dc69ed98..c62bb7aefe 100644 --- a/pkg/trait/toleration.go +++ b/pkg/trait/toleration.go @@ -31,18 +31,20 @@ import ( // This trait sets Tolerations over Integration pods. Tolerations allow (but do not require) the pods to schedule onto nodes with matching taints. // See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ for more details. // -// The toleration should be expressed in a similar manner of taints *_Key[=Value]:Effect[:Seconds]_* where values in square brackets are optional. Examples: +// The toleration should be expressed in a similar manner that of taints, i.e., `Key[=Value]:Effect[:Seconds]`, where values in square brackets are optional. // -// node-role.kubernetes.io/master:NoSchedule -// node.kubernetes.io/network-unavailable:NoExecute:3000 -// disktype=ssd:PreferNoSchedule +// For examples: +// +// - `node-role.kubernetes.io/master:NoSchedule` +// - `node.kubernetes.io/network-unavailable:NoExecute:3000` +// - `disktype=ssd:PreferNoSchedule` // // It's disabled by default. // // +camel-k:trait=toleration type tolerationTrait struct { BaseTrait `property:",squash"` - // The taint to tolerate in the form Key[=Value]:Effect[:Seconds] + // The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]` Taints []string `property:"taints" json:"taints,omitempty"` } From e649e74b13d57d40ff6f8306d35cd51e58097ebe Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Mon, 15 Mar 2021 12:05:05 +0100 Subject: [PATCH 4/5] chore: regen traits schema --- deploy/traits.yaml | 507 +++++++++++++++++++++++++++++++++------------ 1 file changed, 370 insertions(+), 137 deletions(-) diff --git a/deploy/traits.yaml b/deploy/traits.yaml index bbf8d9afbd..62288dc222 100755 --- a/deploy/traits.yaml +++ b/deploy/traits.yaml @@ -5,65 +5,85 @@ traits: - Kubernetes - Knative - OpenShift - description: Allows constraining which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node, or with inter-pod affinity and anti-affinity, based on labels on pods that are already running on the nodes. It's disabled by default. + description: Allows constraining which nodes the integration pod(s) are eligible + to be scheduled on, based on labels on the node, or with inter-pod affinity and + anti-affinity, based on labels on pods that are already running on the nodes. + It's disabled by default. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: pod-affinity type: bool - description: Always co-locates multiple replicas of the integration in the same node (default *false*). + description: Always co-locates multiple replicas of the integration in the same + node (default *false*). - name: pod-anti-affinity type: bool - description: Never co-locates multiple replicas of the integration in the same node (default *false*). + description: Never co-locates multiple replicas of the integration in the same + node (default *false*). - name: node-affinity-labels type: '[]string' - description: Defines a set of nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node. + description: Defines a set of nodes the integration pod(s) are eligible to be + scheduled on, based on labels on the node. - name: pod-affinity-labels type: '[]string' - description: Defines a set of pods (namely those matching the label selector, relative to the given namespace) that theintegration pod(s) should be co-located with. + description: Defines a set of pods (namely those matching the label selector, + relative to the given namespace) that theintegration pod(s) should be co-located + with. - name: pod-anti-affinity-labels type: '[]string' - description: Defines a set of pods (namely those matching the label selector, relative to the given namespace) that theintegration pod(s) should not be co-located with. + description: Defines a set of pods (namely those matching the label selector, + relative to the given namespace) that theintegration pod(s) should not be co-located + with. - name: builder platform: true profiles: - Kubernetes - Knative - OpenShift - description: The builder trait is internally used to determine the best strategy to build and configure IntegrationKits. + description: The builder trait is internally used to determine the best strategy + to build and configure IntegrationKits. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: verbose type: bool - description: Enable verbose logging on build components that support it (e.g. Kaniko build pod). + description: Enable verbose logging on build components that support it (e.g. + Kaniko build pod). - name: camel platform: true profiles: - Kubernetes - Knative - OpenShift - description: The Camel trait can be used to configure versions of Apache Camel K runtime and related libraries, it cannot be disabled. + description: The Camel trait can be used to configure versions of Apache Camel K + runtime and related libraries, it cannot be disabled. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: runtime-version type: string - description: The camel-k-runtime version to use for the integration. It overrides the default version set in the Integration Platform. + description: The camel-k-runtime version to use for the integration. It overrides + the default version set in the Integration Platform. - name: container platform: true profiles: - Kubernetes - Knative - OpenShift - description: The Container trait can be used to configure properties of the container where the integration will run. It also provides configuration for Services associated to the container. + description: The Container trait can be used to configure properties of the container + where the integration will run. It also provides configuration for Services associated + to the container. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: auto type: bool description: "" @@ -87,13 +107,16 @@ traits: description: To configure a different port exposed by the container (default `8080`). - name: port-name type: string - description: To configure a different port name for the port exposed by the container (default `http`). + description: To configure a different port name for the port exposed by the container + (default `http`). - name: service-port type: int - description: To configure under which service port the container port is to be exposed (default `80`). + description: To configure under which service port the container port is to be + exposed (default `80`). - name: service-port-name type: string - description: To configure under which service port name the container port is to be exposed (default `http`). + description: To configure under which service port name the container port is + to be exposed (default `http`). - name: name type: string description: The main container name. It's named `integration` by default. @@ -102,70 +125,107 @@ traits: description: ProbesEnabled enable/disable probes on the container (default `false`) - name: probe-path type: string - description: Path to access on the probe ( default `/health`). Note that this property is not supportedon quarkus runtime and setting it will result in the integration failing to start. + description: Path to access on the probe ( default `/health`). Note that this + property is not supportedon quarkus runtime and setting it will result in the + integration failing to start. - name: liveness-initial-delay type: int32 - description: Number of seconds after the container has started before liveness probes are initiated. + description: Number of seconds after the container has started before liveness + probes are initiated. - name: liveness-timeout type: int32 - description: Number of seconds after which the probe times out. Applies to the liveness probe. + description: Number of seconds after which the probe times out. Applies to the + liveness probe. - name: liveness-period type: int32 description: How often to perform the probe. Applies to the liveness probe. - name: liveness-success-threshold type: int32 - description: Minimum consecutive successes for the probe to be considered successful after having failed.Applies to the liveness probe. + description: Minimum consecutive successes for the probe to be considered successful + after having failed.Applies to the liveness probe. - name: liveness-failure-threshold type: int32 - description: Minimum consecutive failures for the probe to be considered failed after having succeeded.Applies to the liveness probe. + description: Minimum consecutive failures for the probe to be considered failed + after having succeeded.Applies to the liveness probe. - name: readiness-initial-delay type: int32 - description: Number of seconds after the container has started before readiness probes are initiated. + description: Number of seconds after the container has started before readiness + probes are initiated. - name: readiness-timeout type: int32 - description: Number of seconds after which the probe times out. Applies to the readiness probe. + description: Number of seconds after which the probe times out. Applies to the + readiness probe. - name: readiness-period type: int32 description: How often to perform the probe. Applies to the readiness probe. - name: readiness-success-threshold type: int32 - description: Minimum consecutive successes for the probe to be considered successful after having failed.Applies to the readiness probe. + description: Minimum consecutive successes for the probe to be considered successful + after having failed.Applies to the readiness probe. - name: readiness-failure-threshold type: int32 - description: Minimum consecutive failures for the probe to be considered failed after having succeeded.Applies to the readiness probe. + description: Minimum consecutive failures for the probe to be considered failed + after having succeeded.Applies to the readiness probe. - name: cron platform: false profiles: - Kubernetes - Knative - OpenShift - description: 'The Cron trait can be used to customize the behaviour of periodic timer/cron based integrations. While normally an integration requires a pod to be always up and running, some periodic tasks, such as batch jobs, require to be activated at specific hours of the day or with a periodic delay of minutes. For such tasks, the cron trait can materialize the integration as a Kubernetes CronJob instead of a standard deployment, in order to save resources when the integration does not need to be executed. Integrations that start from the following components are evaluated by the cron trait: `timer`, `cron`, `quartz`. The rules for using a Kubernetes CronJob are the following: - `timer`: when periods can be written as cron expressions. E.g. `timer:tick?period=60000`. - `cron`, `quartz`: when the cron expression does not contain seconds (or the "seconds" part is set to 0). E.g. `cron:tab?schedule=0/2${plus}*{plus}*{plus}*{plus}?` or `quartz:trigger?cron=0{plus}0/2{plus}*{plus}*{plus}*{plus}?`.' + description: 'The Cron trait can be used to customize the behaviour of periodic + timer/cron based integrations. While normally an integration requires a pod to + be always up and running, some periodic tasks, such as batch jobs, require to + be activated at specific hours of the day or with a periodic delay of minutes. + For such tasks, the cron trait can materialize the integration as a Kubernetes + CronJob instead of a standard deployment, in order to save resources when the + integration does not need to be executed. Integrations that start from the following + components are evaluated by the cron trait: `timer`, `cron`, `quartz`. The rules + for using a Kubernetes CronJob are the following: - `timer`: when periods can + be written as cron expressions. E.g. `timer:tick?period=60000`. - `cron`, `quartz`: + when the cron expression does not contain seconds (or the "seconds" part is set + to 0). E.g. `cron:tab?schedule=0/2${plus}*{plus}*{plus}*{plus}?` or `quartz:trigger?cron=0{plus}0/2{plus}*{plus}*{plus}*{plus}?`.' properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: schedule type: string - description: The CronJob schedule for the whole integration. If multiple routes are declared, they must have the same schedule for thismechanism to work correctly. + description: The CronJob schedule for the whole integration. If multiple routes + are declared, they must have the same schedule for thismechanism to work correctly. - name: components type: string - description: 'A comma separated list of the Camel components that need to be customized in order for them to work when the schedule is triggered externally by Kubernetes.A specific customizer is activated for each specified component. E.g. for the `timer` component, the `cron-timer` customizer isactivated (it''s present in the `org.apache.camel.k:camel-k-cron` library).Supported components are currently: `cron`, `timer` and `quartz`.' + description: 'A comma separated list of the Camel components that need to be customized + in order for them to work when the schedule is triggered externally by Kubernetes.A + specific customizer is activated for each specified component. E.g. for the + `timer` component, the `cron-timer` customizer isactivated (it''s present in + the `org.apache.camel.k:camel-k-cron` library).Supported components are currently: + `cron`, `timer` and `quartz`.' - name: fallback type: bool - description: Use the default Camel implementation of the `cron` endpoint (`quartz`) instead of trying to materialize the integrationas Kubernetes CronJob. + description: Use the default Camel implementation of the `cron` endpoint (`quartz`) + instead of trying to materialize the integrationas Kubernetes CronJob. - name: concurrency-policy type: string - description: 'Specifies how to treat concurrent executions of a Job.Valid values are:- "Allow": allows CronJobs to run concurrently;- "Forbid" (default): forbids concurrent runs, skipping next run if previous run hasn''t finished yet;- "Replace": cancels currently running job and replaces it with a new one' + description: 'Specifies how to treat concurrent executions of a Job.Valid values + are:- "Allow": allows CronJobs to run concurrently;- "Forbid" (default): forbids + concurrent runs, skipping next run if previous run hasn''t finished yet;- "Replace": + cancels currently running job and replaces it with a new one' - name: auto type: bool - description: Automatically deploy the integration as CronJob when all routes areeither starting from a periodic consumer (only `cron`, `timer` and `quartz` are supported) or a passive consumer (e.g. `direct` is a passive consumer).It's required that all periodic consumers have the same period and it can be expressed as cron schedule (e.g. `1m` can be expressed as `0/1 * * * *`,while `35m` or `50s` cannot). + description: Automatically deploy the integration as CronJob when all routes areeither + starting from a periodic consumer (only `cron`, `timer` and `quartz` are supported) + or a passive consumer (e.g. `direct` is a passive consumer).It's required that + all periodic consumers have the same period and it can be expressed as cron + schedule (e.g. `1m` can be expressed as `0/1 * * * *`,while `35m` or `50s` cannot). - name: dependencies platform: true profiles: - Kubernetes - Knative - OpenShift - description: The Dependencies trait is internally used to automatically add runtime dependencies based on the integration that the user wants to run. + description: The Dependencies trait is internally used to automatically add runtime + dependencies based on the integration that the user wants to run. properties: [] - name: deployer platform: true @@ -173,21 +233,26 @@ traits: - Kubernetes - Knative - OpenShift - description: The deployer trait can be used to explicitly select the kind of high level resource that will deploy the integration. + description: The deployer trait can be used to explicitly select the kind of high + level resource that will deploy the integration. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: kind type: string - description: Allows to explicitly select the desired deployment kind between `deployment`, `cron-job` or `knative-service` when creating the resources for running the integration. + description: Allows to explicitly select the desired deployment kind between `deployment`, + `cron-job` or `knative-service` when creating the resources for running the + integration. - name: deployment platform: true profiles: - Kubernetes - Knative - OpenShift - description: The Deployment trait is responsible for generating the Kubernetes deployment that will make sure the integration will run in the cluster. + description: The Deployment trait is responsible for generating the Kubernetes deployment + that will make sure the integration will run in the cluster. properties: [] - name: environment platform: true @@ -195,104 +260,136 @@ traits: - Kubernetes - Knative - OpenShift - description: The environment trait is used internally to inject standard environment variables in the integration container, such as `NAMESPACE`, `POD_NAME` and others. + description: The environment trait is used internally to inject standard environment + variables in the integration container, such as `NAMESPACE`, `POD_NAME` and others. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: container-meta type: bool - description: Enables injection of `NAMESPACE` and `POD_NAME` environment variables (default `true`) + description: Enables injection of `NAMESPACE` and `POD_NAME` environment variables + (default `true`) - name: gc platform: false profiles: - Kubernetes - Knative - OpenShift - description: The GC Trait garbage-collects all resources that are no longer necessary upon integration updates. + description: The GC Trait garbage-collects all resources that are no longer necessary + upon integration updates. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: discovery-cache type: ./pkg/trait.discoveryCacheType - description: Discovery client cache to be used, either `disabled`, `disk` or `memory` (default `memory`) + description: Discovery client cache to be used, either `disabled`, `disk` or `memory` + (default `memory`) - name: ingress platform: false profiles: - Kubernetes - description: The Ingress trait can be used to expose the service associated with the integration to the outside world with a Kubernetes Ingress. It's enabled by default whenever a Service is added to the integration (through the `service` trait). + description: The Ingress trait can be used to expose the service associated with + the integration to the outside world with a Kubernetes Ingress. It's enabled by + default whenever a Service is added to the integration (through the `service` + trait). properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: host type: string description: '**Required**. To configure the host exposed by the ingress.' - name: auto type: bool - description: To automatically add an ingress whenever the integration uses a HTTP endpoint consumer. + description: To automatically add an ingress whenever the integration uses a HTTP + endpoint consumer. - name: istio platform: false profiles: - Kubernetes - Knative - OpenShift - description: The Istio trait allows to configure properties related to the Istio service mesh, such as sidecar injection and outbound IP ranges. + description: The Istio trait allows to configure properties related to the Istio + service mesh, such as sidecar injection and outbound IP ranges. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: allow type: string - description: Configures a (comma-separated) list of CIDR subnets that should not be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16` by default). + description: Configures a (comma-separated) list of CIDR subnets that should not + be intercepted by the Istio proxy (`10.0.0.0/8,172.16.0.0/12,192.168.0.0/16` + by default). - name: inject type: bool - description: Forces the value for labels `sidecar.istio.io/inject`. By default the label is set to `true` on deployment and not set on Knative Service. + description: Forces the value for labels `sidecar.istio.io/inject`. By default + the label is set to `true` on deployment and not set on Knative Service. - name: jolokia platform: false profiles: - Kubernetes - Knative - OpenShift - description: The Jolokia trait activates and configures the Jolokia Java agent. See https://jolokia.org/reference/html/agents.html + description: The Jolokia trait activates and configures the Jolokia Java agent. + See https://jolokia.org/reference/html/agents.html properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: ca-cert type: string - description: The PEM encoded CA certification file path, used to verify client certificates,applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`(default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt` for OpenShift). + description: The PEM encoded CA certification file path, used to verify client + certificates,applicable when `protocol` is `https` and `use-ssl-client-authentication` + is `true`(default `/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt` + for OpenShift). - name: client-principal type: '[]string' - description: The principal(s) which must be given in a client certificate to allow access to the Jolokia endpoint,applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`(default `clientPrincipal=cn=system:master-proxy`, `cn=hawtio-online.hawtio.svc` and `cn=fuse-console.fuse.svc` for OpenShift). + description: The principal(s) which must be given in a client certificate to allow + access to the Jolokia endpoint,applicable when `protocol` is `https` and `use-ssl-client-authentication` + is `true`(default `clientPrincipal=cn=system:master-proxy`, `cn=hawtio-online.hawtio.svc` + and `cn=fuse-console.fuse.svc` for OpenShift). - name: discovery-enabled type: bool description: Listen for multicast requests (default `false`) - name: extended-client-check type: bool - description: Mandate the client certificate contains a client flag in the extended key usage section,applicable when `protocol` is `https` and `use-ssl-client-authentication` is `true`(default `true` for OpenShift). + description: Mandate the client certificate contains a client flag in the extended + key usage section,applicable when `protocol` is `https` and `use-ssl-client-authentication` + is `true`(default `true` for OpenShift). - name: host type: string - description: The Host address to which the Jolokia agent should bind to. If `"\*"` or `"0.0.0.0"` is given,the servers binds to every network interface (default `"*"`). + description: The Host address to which the Jolokia agent should bind to. If `"\*"` + or `"0.0.0.0"` is given,the servers binds to every network interface (default + `"*"`). - name: password type: string - description: The password used for authentication, applicable when the `user` option is set. + description: The password used for authentication, applicable when the `user` + option is set. - name: port type: int description: The Jolokia endpoint port (default `8778`). - name: protocol type: string - description: The protocol to use, either `http` or `https` (default `https` for OpenShift) + description: The protocol to use, either `http` or `https` (default `https` for + OpenShift) - name: user type: string description: The user to be used for authentication - name: use-ssl-client-authentication type: bool - description: Whether client certificates should be used for authentication (default `true` for OpenShift). + description: Whether client certificates should be used for authentication (default + `true` for OpenShift). - name: options type: '[]string' - description: A list of additional Jolokia options as definedin https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM agent configuration options] + description: A list of additional Jolokia options as definedin https://jolokia.org/reference/html/agents.html#agent-jvm-config[JVM + agent configuration options] - name: jvm platform: true profiles: @@ -303,19 +400,23 @@ traits: properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: debug type: bool - description: Activates remote debugging, so that a debugger can be attached to the JVM, e.g., using port-forwarding + description: Activates remote debugging, so that a debugger can be attached to + the JVM, e.g., using port-forwarding - name: debug-suspend type: bool description: Suspends the target JVM immediately before the main class is loaded - name: print-command type: bool - description: Prints the command used the start the JVM in the container logs (default `true`) + description: Prints the command used the start the JVM in the container logs (default + `true`) - name: debug-address type: string - description: Transport address at which to listen for the newly launched JVM (default `*:5005`) + description: Transport address at which to listen for the newly launched JVM (default + `*:5005`) - name: options type: '[]string' description: A list of JVM options @@ -325,14 +426,17 @@ traits: - Kubernetes - Knative - OpenShift - description: The kamelets trait is a platform trait used to inject Kamelets into the integration runtime. + description: The kamelets trait is a platform trait used to inject Kamelets into + the integration runtime. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: auto type: bool - description: Automatically inject all referenced Kamelets and their default configuration (enabled by default) + description: Automatically inject all referenced Kamelets and their default configuration + (enabled by default) - name: list type: string description: Comma separated list of Kamelet names to load into the current integration @@ -340,68 +444,105 @@ traits: platform: false profiles: - Knative - description: The Knative Service trait allows to configure options when running the integration as Knative service instead of a standard Kubernetes Deployment. Running integrations as Knative Services adds auto-scaling (and scaling-to-zero) features, but those features are only meaningful when the routes use a HTTP endpoint consumer. + description: The Knative Service trait allows to configure options when running + the integration as Knative service instead of a standard Kubernetes Deployment. + Running integrations as Knative Services adds auto-scaling (and scaling-to-zero) + features, but those features are only meaningful when the routes use a HTTP endpoint + consumer. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: autoscaling-class type: string - description: Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev` autoscaling).Refer to the Knative documentation for more information. + description: Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` + or `kpa.autoscaling.knative.dev` autoscaling).Refer to the Knative documentation + for more information. - name: autoscaling-metric type: string - description: Configures the Knative autoscaling metric property (e.g. to set `concurrency` based or `cpu` based autoscaling).Refer to the Knative documentation for more information. + description: Configures the Knative autoscaling metric property (e.g. to set `concurrency` + based or `cpu` based autoscaling).Refer to the Knative documentation for more + information. - name: autoscaling-target type: int - description: Sets the allowed concurrency level or CPU percentage (depending on the autoscaling metric) for each Pod.Refer to the Knative documentation for more information. + description: Sets the allowed concurrency level or CPU percentage (depending on + the autoscaling metric) for each Pod.Refer to the Knative documentation for + more information. - name: min-scale type: int - description: The minimum number of Pods that should be running at any time for the integration. It's **zero** by default, meaning thatthe integration is scaled down to zero when not used for a configured amount of time.Refer to the Knative documentation for more information. + description: The minimum number of Pods that should be running at any time for + the integration. It's **zero** by default, meaning thatthe integration is scaled + down to zero when not used for a configured amount of time.Refer to the Knative + documentation for more information. - name: max-scale type: int - description: An upper bound for the number of Pods that can be running in parallel for the integration.Knative has its own cap value that depends on the installation.Refer to the Knative documentation for more information. + description: An upper bound for the number of Pods that can be running in parallel + for the integration.Knative has its own cap value that depends on the installation.Refer + to the Knative documentation for more information. - name: auto type: bool - description: Automatically deploy the integration as Knative service when all conditions hold:* Integration is using the Knative profile* All routes are either starting from a HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer) + description: Automatically deploy the integration as Knative service when all + conditions hold:* Integration is using the Knative profile* All routes are either + starting from a HTTP based consumer or a passive consumer (e.g. `direct` is + a passive consumer) - name: knative platform: false profiles: - Knative - description: The Knative trait automatically discovers addresses of Knative resources and inject them into the running integration. The full Knative configuration is injected in the CAMEL_KNATIVE_CONFIGURATION in JSON format. The Camel Knative component will then use the full configuration to configure the routes. The trait is enabled by default when the Knative profile is active. + description: The Knative trait automatically discovers addresses of Knative resources + and inject them into the running integration. The full Knative configuration is + injected in the CAMEL_KNATIVE_CONFIGURATION in JSON format. The Camel Knative + component will then use the full configuration to configure the routes. The trait + is enabled by default when the Knative profile is active. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: configuration type: string description: Can be used to inject a Knative complete configuration in JSON format. - name: channel-sources type: '[]string' - description: List of channels used as source of integration routes.Can contain simple channel names or full Camel URIs. + description: List of channels used as source of integration routes.Can contain + simple channel names or full Camel URIs. - name: channel-sinks type: '[]string' - description: List of channels used as destination of integration routes.Can contain simple channel names or full Camel URIs. + description: List of channels used as destination of integration routes.Can contain + simple channel names or full Camel URIs. - name: endpoint-sources type: '[]string' description: List of channels used as source of integration routes. - name: endpoint-sinks type: '[]string' - description: List of endpoints used as destination of integration routes.Can contain simple endpoint names or full Camel URIs. + description: List of endpoints used as destination of integration routes.Can contain + simple endpoint names or full Camel URIs. - name: event-sources type: '[]string' - description: List of event types that the integration will be subscribed to.Can contain simple event types or full Camel URIs (to use a specific broker different from "default"). + description: List of event types that the integration will be subscribed to.Can + contain simple event types or full Camel URIs (to use a specific broker different + from "default"). - name: event-sinks type: '[]string' - description: List of event types that the integration will produce.Can contain simple event types or full Camel URIs (to use a specific broker). + description: List of event types that the integration will produce.Can contain + simple event types or full Camel URIs (to use a specific broker). - name: filter-source-channels type: bool - description: Enables filtering on events based on the header "ce-knativehistory". Since this is an experimental headerthat can be removed in a future version of Knative, filtering is enabled only when the integration islistening from more than 1 channel. + description: Enables filtering on events based on the header "ce-knativehistory". + Since this is an experimental headerthat can be removed in a future version + of Knative, filtering is enabled only when the integration islistening from + more than 1 channel. - name: camel-source-compat type: bool - description: Enables Knative CamelSource pre 0.15 compatibility fixes (will be removed in future versions). + description: Enables Knative CamelSource pre 0.15 compatibility fixes (will be + removed in future versions). - name: sink-binding type: bool - description: Allows binding the integration to a sink via a Knative SinkBinding resource.This can be used when the integration targets a single sink.It's enabled by default when the integration targets a single sink(except when the integration is owned by a Knative source). + description: Allows binding the integration to a sink via a Knative SinkBinding + resource.This can be used when the integration targets a single sink.It's enabled + by default when the integration targets a single sink(except when the integration + is owned by a Knative source). - name: auto type: bool description: Enable automatic discovery of all trait properties. @@ -411,39 +552,55 @@ traits: - Kubernetes - Knative - OpenShift - description: 'The Master trait allows to configure the integration to automatically leverage Kubernetes resources for doing leader election and starting *master* routes only on certain instances. It''s activated automatically when using the master endpoint in a route, e.g. `from("master:lockname:telegram:bots")...`. NOTE: this trait adds special permissions to the integration service account in order to read/write configmaps and read pods. It''s recommended to use a different service account than "default" when running the integration.' + description: 'The Master trait allows to configure the integration to automatically + leverage Kubernetes resources for doing leader election and starting *master* + routes only on certain instances. It''s activated automatically when using the + master endpoint in a route, e.g. `from("master:lockname:telegram:bots")...`. NOTE: + this trait adds special permissions to the integration service account in order + to read/write configmaps and read pods. It''s recommended to use a different service + account than "default" when running the integration.' properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: auto type: bool description: Enables automatic configuration of the trait. - name: include-delegate-dependencies type: bool - description: When this flag is active, the operator analyzes the source code to add dependencies required by delegate endpoints.E.g. when using `master:lockname:timer`, then `camel:timer` is automatically added to the set of dependencies.It's enabled by default. + description: When this flag is active, the operator analyzes the source code to + add dependencies required by delegate endpoints.E.g. when using `master:lockname:timer`, + then `camel:timer` is automatically added to the set of dependencies.It's enabled + by default. - name: configmap type: string - description: 'Name of the configmap that will be used to store the lock. Defaults to "-lock".Deprecated: replaced by "resource-name".' + description: 'Name of the configmap that will be used to store the lock. Defaults + to "-lock".Deprecated: replaced by "resource-name".' - name: resource-name type: string - description: Name of the configmap/lease resource that will be used to store the lock. Defaults to "-lock". + description: Name of the configmap/lease resource that will be used to store the + lock. Defaults to "-lock". - name: resource-type type: string - description: Type of Kubernetes resource to use for locking ("ConfigMap" or "Lease"). Defaults to "Lease". + description: Type of Kubernetes resource to use for locking ("ConfigMap" or "Lease"). + Defaults to "Lease". - name: label-key type: string - description: Label that will be used to identify all pods contending the lock. Defaults to "camel.apache.org/integration". + description: Label that will be used to identify all pods contending the lock. + Defaults to "camel.apache.org/integration". - name: label-value type: string - description: Label value that will be used to identify all pods contending the lock. Defaults to the integration name. + description: Label value that will be used to identify all pods contending the + lock. Defaults to the integration name. - name: openapi platform: true profiles: - Kubernetes - Knative - OpenShift - description: The OpenAPI DSL trait is internally used to allow creating integrations from a OpenAPI specs. + description: The OpenAPI DSL trait is internally used to allow creating integrations + from a OpenAPI specs. properties: [] - name: owner platform: true @@ -451,11 +608,14 @@ traits: - Kubernetes - Knative - OpenShift - description: The Owner trait ensures that all created resources belong to the integration being created and transfers annotations and labels on the integration onto these owned resources. + description: The Owner trait ensures that all created resources belong to the integration + being created and transfers annotations and labels on the integration onto these + owned resources. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: target-annotations type: '[]string' description: The set of annotations to be transferred @@ -468,48 +628,70 @@ traits: - Kubernetes - Knative - OpenShift - description: The PDB trait allows to configure the PodDisruptionBudget resource for the Integration pods. + description: The PDB trait allows to configure the PodDisruptionBudget resource + for the Integration pods. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: min-available type: string - description: The number of pods for the Integration that must still be available after an eviction.It can be either an absolute number or a percentage.Only one of `min-available` and `max-unavailable` can be specified. + description: The number of pods for the Integration that must still be available + after an eviction.It can be either an absolute number or a percentage.Only one + of `min-available` and `max-unavailable` can be specified. - name: max-unavailable type: string - description: The number of pods for the Integration that can be unavailable after an eviction.It can be either an absolute number or a percentage (default `1` if `min-available` is also not set).Only one of `max-unavailable` and `min-available` can be specified. + description: The number of pods for the Integration that can be unavailable after + an eviction.It can be either an absolute number or a percentage (default `1` + if `min-available` is also not set).Only one of `max-unavailable` and `min-available` + can be specified. - name: platform platform: true profiles: - Kubernetes - Knative - OpenShift - description: The platform trait is a base trait that is used to assign an integration platform to an integration. In case the platform is missing, the trait is allowed to create a default platform. This feature is especially useful in contexts where there's no need to provide a custom configuration for the platform (e.g. on OpenShift the default settings work, since there's an embedded container image registry). + description: The platform trait is a base trait that is used to assign an integration + platform to an integration. In case the platform is missing, the trait is allowed + to create a default platform. This feature is especially useful in contexts where + there's no need to provide a custom configuration for the platform (e.g. on OpenShift + the default settings work, since there's an embedded container image registry). properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: create-default type: bool description: To create a default (empty) platform when the platform is missing. - name: global type: bool - description: Indicates if the platform should be created globally in the case of global operator (default true). + description: Indicates if the platform should be created globally in the case + of global operator (default true). - name: auto type: bool - description: To automatically detect from the environment if a default platform can be created (it will be created on OpenShift only). + description: To automatically detect from the environment if a default platform + can be created (it will be created on OpenShift only). - name: prometheus platform: false profiles: - Kubernetes - Knative - OpenShift - description: 'The Prometheus trait configures a Prometheus-compatible endpoint. This trait also exposes the integration with `Service` and `ServiceMonitor` resources, so that the endpoint can be scraped automatically, when using the Prometheus Operator. The metrics are exposed using MicroProfile Metrics. WARNING: The creation of the `ServiceMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus Operator] custom resource definition to be installed. You can set `service-monitor` to `false` for the Prometheus trait to work without the Prometheus Operator. The Prometheus trait is disabled by default.' + description: 'The Prometheus trait configures a Prometheus-compatible endpoint. + This trait also exposes the integration with `Service` and `ServiceMonitor` resources, + so that the endpoint can be scraped automatically, when using the Prometheus Operator. + The metrics are exposed using MicroProfile Metrics. WARNING: The creation of the + `ServiceMonitor` resource requires the https://github.com/coreos/prometheus-operator[Prometheus + Operator] custom resource definition to be installed. You can set `service-monitor` + to `false` for the Prometheus trait to work without the Prometheus Operator. The + Prometheus trait is disabled by default.' properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: port type: int description: The Prometheus endpoint port (default `9779`, or `8080` with Quarkus). @@ -518,27 +700,40 @@ traits: description: Whether a `ServiceMonitor` resource is created (default `true`). - name: service-monitor-labels type: '[]string' - description: The `ServiceMonitor` resource labels, applicable when `service-monitor` is `true`. + description: The `ServiceMonitor` resource labels, applicable when `service-monitor` + is `true`. - name: pull-secret platform: false profiles: - Kubernetes - Knative - OpenShift - description: The Pull Secret trait sets a pull secret on the pod, to allow Kubernetes to retrieve the container image from an external registry. The pull secret can be specified manually or, in case you've configured authentication for an external container registry on the `IntegrationPlatform`, the same secret is used to pull images. It's enabled by default whenever you configure authentication for an external container registry, so it assumes that external registries are private. If your registry does not need authentication for pulling images, you can disable this trait. + description: The Pull Secret trait sets a pull secret on the pod, to allow Kubernetes + to retrieve the container image from an external registry. The pull secret can + be specified manually or, in case you've configured authentication for an external + container registry on the `IntegrationPlatform`, the same secret is used to pull + images. It's enabled by default whenever you configure authentication for an external + container registry, so it assumes that external registries are private. If your + registry does not need authentication for pulling images, you can disable this + trait. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: secret-name type: string - description: The pull secret name to set on the Pod. If left empty this is automatically taken from the `IntegrationPlatform` registry configuration. + description: The pull secret name to set on the Pod. If left empty this is automatically + taken from the `IntegrationPlatform` registry configuration. - name: image-puller-delegation type: bool - description: When using a global operator with a shared platform, this enables delegation of the `system:image-puller` cluster role on the operator namespace to the integration service account. + description: When using a global operator with a shared platform, this enables + delegation of the `system:image-puller` cluster role on the operator namespace + to the integration service account. - name: auto type: bool - description: Automatically configures the platform registry secret on the pod if it is of type `kubernetes.io/dockerconfigjson`. + description: Automatically configures the platform registry secret on the pod + if it is of type `kubernetes.io/dockerconfigjson`. - name: quarkus platform: true profiles: @@ -549,7 +744,8 @@ traits: properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: native type: bool description: The Quarkus runtime type (reserved for future use) @@ -557,43 +753,59 @@ traits: platform: false profiles: - OpenShift - description: The Route trait can be used to configure the creation of OpenShift routes for the integration. + description: The Route trait can be used to configure the creation of OpenShift + routes for the integration. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: host type: string description: To configure the host exposed by the route. - name: tls-termination type: string - description: The TLS termination type, like `edge`, `passthrough` or `reencrypt`.Refer to the OpenShift documentation for additional information. + description: The TLS termination type, like `edge`, `passthrough` or `reencrypt`.Refer + to the OpenShift documentation for additional information. - name: tls-certificate type: string - description: The TLS certificate contents.Refer to the OpenShift documentation for additional information. + description: The TLS certificate contents.Refer to the OpenShift documentation + for additional information. - name: tls-key type: string - description: The TLS certificate key contents.Refer to the OpenShift documentation for additional information. + description: The TLS certificate key contents.Refer to the OpenShift documentation + for additional information. - name: tls-ca-certificate type: string - description: The TLS cert authority certificate contents.Refer to the OpenShift documentation for additional information. + description: The TLS cert authority certificate contents.Refer to the OpenShift + documentation for additional information. - name: tls-destination-ca-certificate type: string - description: The destination CA certificate provides the contents of the ca certificate of the final destination. When using reencrypttermination this file should be provided in order to have routers use it for health checks on the secure connection.If this field is not specified, the router may provide its own destination CA and perform hostname validation usingthe short service name (service.namespace.svc), which allows infrastructure generated certificates to automaticallyverify.Refer to the OpenShift documentation for additional information. + description: The destination CA certificate provides the contents of the ca certificate + of the final destination. When using reencrypttermination this file should + be provided in order to have routers use it for health checks on the secure + connection.If this field is not specified, the router may provide its own destination + CA and perform hostname validation usingthe short service name (service.namespace.svc), + which allows infrastructure generated certificates to automaticallyverify.Refer + to the OpenShift documentation for additional information. - name: tls-insecure-edge-termination-policy type: string - description: To configure how to deal with insecure traffic, e.g. `Allow`, `Disable` or `Redirect` traffic.Refer to the OpenShift documentation for additional information. + description: To configure how to deal with insecure traffic, e.g. `Allow`, `Disable` + or `Redirect` traffic.Refer to the OpenShift documentation for additional information. - name: service-binding platform: false profiles: - Kubernetes - Knative - OpenShift - description: 'The Service Binding trait allows users to connect to Provisioned Services and ServiceBindings in Kubernetes: https://github.com/k8s-service-bindings/spec#service-binding As the specification is still evolving this is subject to change' + description: 'The Service Binding trait allows users to connect to Provisioned Services + and ServiceBindings in Kubernetes: https://github.com/k8s-service-bindings/spec#service-binding + As the specification is still evolving this is subject to change' properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: service-bindings type: '[]string' description: List of Provisioned Services and ServiceBindings in the form KIND.VERSION.GROUP/NAME[/NAMESPACE] @@ -602,11 +814,15 @@ traits: profiles: - Kubernetes - OpenShift - description: The Service trait exposes the integration with a Service resource so that it can be accessed by other applications (or integrations) in the same namespace. It's enabled by default if the integration depends on a Camel component that can expose a HTTP endpoint. + description: The Service trait exposes the integration with a Service resource so + that it can be accessed by other applications (or integrations) in the same namespace. + It's enabled by default if the integration depends on a Camel component that can + expose a HTTP endpoint. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: auto type: bool description: To automatically detect from the code if a Service needs to be created. @@ -619,11 +835,14 @@ traits: - Kubernetes - Knative - OpenShift - description: The 3scale trait can be used to automatically create annotations that allow 3scale to discover the generated service and make it available for API management. The 3scale trait is disabled by default. + description: The 3scale trait can be used to automatically create annotations that + allow 3scale to discover the generated service and make it available for API management. + The 3scale trait is disabled by default. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: auto type: bool description: Enables automatic configuration of the trait. @@ -645,34 +864,48 @@ traits: - Kubernetes - Knative - OpenShift - description: 'This trait sets Tolerations over Integration pods. Tolerations allow (but do not require) the pods to schedule onto nodes with matching taints. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ for more details. The toleration should be expressed in a similar manner of taints *_Key[=Value]:Effect[:Seconds]_* where values in square brackets are optional. Examples: node-role.kubernetes.io/master:NoSchedule node.kubernetes.io/network-unavailable:NoExecute:3000 disktype=ssd:PreferNoSchedule It''s disabled by default.' + description: 'This trait sets Tolerations over Integration pods. Tolerations allow + (but do not require) the pods to schedule onto nodes with matching taints. See + https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ + for more details. The toleration should be expressed in a similar manner that + of taints, i.e., `Key[=Value]:Effect[:Seconds]`, where values in square brackets + are optional. For examples: - `node-role.kubernetes.io/master:NoSchedule` - `node.kubernetes.io/network-unavailable:NoExecute:3000` + - `disktype=ssd:PreferNoSchedule` It''s disabled by default.' properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: taints type: '[]string' - description: The taint to tolerate in the form Key[=Value]:Effect[:Seconds] + description: The list of taints to tolerate, in the form `Key[=Value]:Effect[:Seconds]` - name: tracing platform: false profiles: - Kubernetes - Knative - OpenShift - description: The Tracing trait can be used to automatically publish tracing information to an OpenTracing compatible collector. The trait is able to automatically discover the tracing endpoint available in the namespace (supports **Jaeger**). The Tracing trait is disabled by default. + description: The Tracing trait can be used to automatically publish tracing information + to an OpenTracing compatible collector. The trait is able to automatically discover + the tracing endpoint available in the namespace (supports **Jaeger**). The Tracing + trait is disabled by default. properties: - name: enabled type: bool - description: Can be used to enable or disable a trait. All traits share this common property. + description: Can be used to enable or disable a trait. All traits share this common + property. - name: auto type: bool - description: Enables automatic configuration of the trait, including automatic discovery of the tracing endpoint. + description: Enables automatic configuration of the trait, including automatic + discovery of the tracing endpoint. - name: service-name type: string - description: The name of the service that publishes tracing data (defaults to the integration name) + description: The name of the service that publishes tracing data (defaults to + the integration name) - name: endpoint type: string - description: The target endpoint of the OpenTracing service (automatically discovered by default) + description: The target endpoint of the OpenTracing service (automatically discovered + by default) - name: sampler-type type: string description: The sampler type (default "const") From b2f7a97a6e18f552b6ab205b5a2d4a47ab46a79c Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Fri, 19 Mar 2021 09:50:13 +0100 Subject: [PATCH 5/5] test: Only run node toleration e2e test on multi-nodes cluster --- e2e/common/traits/toleration_test.go | 14 ++++++++------ e2e/support/test_support.go | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/e2e/common/traits/toleration_test.go b/e2e/common/traits/toleration_test.go index 50a53866a8..0dafc015bb 100644 --- a/e2e/common/traits/toleration_test.go +++ b/e2e/common/traits/toleration_test.go @@ -45,7 +45,7 @@ func TestTolerationTrait(t *testing.T) { "-t", "toleration.enabled=true", "-t", "toleration.taints=camel.apache.org/master:NoExecute:300", ).Execute()).To(Succeed()) - Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(v1.PodRunning)) + Eventually(IntegrationPodPhase(ns, name), TestTimeoutMedium).Should(Equal(v1.PodRunning)) Eventually(IntegrationCondition(ns, name, camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue)) Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) @@ -67,7 +67,7 @@ func TestTolerationTrait(t *testing.T) { "-t", "toleration.enabled=true", "-t", "toleration.taints=camel.apache.org/master=test:NoExecute:300", ).Execute()).To(Succeed()) - Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(v1.PodRunning)) + Eventually(IntegrationPodPhase(ns, name), TestTimeoutMedium).Should(Equal(v1.PodRunning)) Eventually(IntegrationCondition(ns, name, camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue)) Eventually(IntegrationLogs(ns, name), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) @@ -83,8 +83,11 @@ func TestTolerationTrait(t *testing.T) { }) t.Run("Run Java with master node toleration", func(t *testing.T) { + if len(Nodes()()) == 1 { + t.Skip("Skip master node toleration test on single-node cluster") + } + name := "java3" - Expect(Kamel("install", "-n", ns).Execute()).To(Succeed()) Expect(Kamel("run", "-n", ns, "files/Java.java", "--name", name, // Use the affinity trait to force the scheduling of the Integration pod onto a master node @@ -110,9 +113,8 @@ func TestTolerationTrait(t *testing.T) { })) // Check the Integration pod is running on a master node - node := Node(pod.Spec.NodeName)() - Expect(node).NotTo(BeNil()) - Expect(node).To(PointTo(MatchFields(IgnoreExtras, Fields{ + Expect(Node(pod.Spec.NodeName)).NotTo(BeNil()) + Expect(Node(pod.Spec.NodeName)).To(PointTo(MatchFields(IgnoreExtras, Fields{ "Spec": MatchFields(IgnoreExtras, Fields{ "Taints": ContainElement(v1.Taint{ Key: "node-role.kubernetes.io/master", diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index dd7365cf6d..b296beca09 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -382,6 +382,22 @@ func Lease(ns string, name string) func() *coordination.Lease { } } +func Nodes() func() []corev1.Node { + return func() []corev1.Node { + nodes := &corev1.NodeList{ + TypeMeta: metav1.TypeMeta{ + Kind: "NodeList", + APIVersion: corev1.SchemeGroupVersion.String(), + }, + } + err := TestClient().List(TestContext, nodes) + if err != nil { + panic(err) + } + return nodes.Items + } +} + func Node(name string) func() *corev1.Node { return func() *corev1.Node { node := &corev1.Node{