You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2020/07/15 21:19:11 UTC

[camel-k] branch master updated (2594fd4 -> 9d11a6b)

This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git.


    from 2594fd4  chore: Rebuild resources
     new cc3e7c7  chore(doc): Add examples back into the affinity trait documentation
     new 9d11a6b  chore: Rebuild traits metadata

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 deploy/traits.yaml                      | 448 +++++++++-----------------------
 docs/modules/traits/pages/affinity.adoc |  22 +-
 pkg/trait/affinity.go                   |   2 +-
 3 files changed, 142 insertions(+), 330 deletions(-)


[camel-k] 02/02: chore: Rebuild traits metadata

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 9d11a6b6636934ab57205879c147e8d35d17a01a
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Jul 15 17:55:52 2020 +0200

    chore: Rebuild traits metadata
---
 deploy/traits.yaml | 448 ++++++++++++++---------------------------------------
 1 file changed, 120 insertions(+), 328 deletions(-)

diff --git a/deploy/traits.yaml b/deploy/traits.yaml
index 837dc8b..509fe50 100755
--- a/deploy/traits.yaml
+++ b/deploy/traits.yaml
@@ -5,85 +5,65 @@ traits:
   - Kubernetes
   - Knative
   - OpenShift
-  description: Allows to constrain 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
-    tobuild and configure IntegrationKits.
+  description: The builder trait is internally used to determine the best strategy tobuild 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: ""
@@ -107,16 +87,13 @@ 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.
@@ -125,107 +102,70 @@ 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  [...]
   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-runtime-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-runtime-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 theintegration that the user wants to run.
+  description: The Dependencies trait is internally used to automatically add runtime dependencies based on theintegration that the user wants to run.
   properties: []
 - name: deployer
   platform: true
@@ -233,26 +173,21 @@ traits:
   - Kubernetes
   - Knative
   - OpenShift
-  description: The deployer trait can be used to explicitly select the kind of high
-    level resource thatwill deploy the integration.
+  description: The deployer trait can be used to explicitly select the kind of high level resource thatwill 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 surethe integration will run in the cluster.
+  description: The Deployment trait is responsible for generating the Kubernetes deployment that will make surethe integration will run in the cluster.
   properties: []
 - name: environment
   platform: true
@@ -260,13 +195,11 @@ 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: ""
@@ -276,119 +209,90 @@ traits:
   - 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 integrationto 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 integrationto 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:
@@ -399,23 +303,19 @@ 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
@@ -423,98 +323,65 @@ traits:
   platform: false
   profiles:
   - Knative
-  description: The Knative Service trait allows to configure options when running
-    the integration as Knative service instead ofa standard Kubernetes Deployment.Running
-    integrations as Knative Services adds auto-scaling (and scaling-to-zero) features,
-    but those featuresare 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 ofa standard Kubernetes Deployment.Running integrations as Knative Services adds auto-scaling (and scaling-to-zero) features, but those featuresare 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 therunning 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 therunning 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: auto
     type: bool
     description: Enable automatic discovery of all trait properties.
@@ -524,47 +391,33 @@ traits:
   - Kubernetes
   - Knative
   - OpenShift
-  description: 'The Master trait allows to configure the integration to automatically
-    leverage Kubernetes resources for doingleader 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 doingleader 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 accou [...]
   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 "<integration-name>-lock".
+    description: Name of the configmap that will be used to store the lock. Defaults to "<integration-name>-lock".
   - 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
@@ -572,14 +425,11 @@ traits:
   - Kubernetes
   - Knative
   - OpenShift
-  description: The Owner trait ensures that all created resources belong to the integration
-    being createdand 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 createdand 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
@@ -592,44 +442,28 @@ traits:
   - 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: 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.
-    It also exposes the integration with a `Service`and a `ServiceMonitor` resources,
-    so that the endpoint can be scraped automatically, when using the Prometheusoperator.The
-    metrics exposed vary depending on the configured runtime. With Quarkus, the metrics
-    are exposedusing MicroProfile Metrics. While with the default runtime, they are
-    exposed using the Prometheus JMX exporter.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.It''s
-    disabled by default.'
+  description: 'The Prometheus trait configures a Prometheus-compatible endpoint. It also exposes the integration with a `Service`and a `ServiceMonitor` resources, so that the endpoint can be scraped automatically, when using the Prometheusoperator.The metrics exposed vary depending on the configured runtime. With Quarkus, the metrics are exposedusing MicroProfile Metrics. While with the default runtime, they are exposed using the Prometheus JMX exporter.WARNING: The creation of the `Ser [...]
   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).
@@ -638,41 +472,27 @@ 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: configmap
     type: string
-    description: To use a custom ConfigMap containing the Prometheus JMX exporter
-      configuration (under the `content` ConfigMap key).When this property is left
-      empty (default), Camel K generates a standard Prometheus configuration for the
-      integration.It is not applicable when using Quarkus.
+    description: To use a custom ConfigMap containing the Prometheus JMX exporter configuration (under the `content` ConfigMap key).When this property is left empty (default), Camel K generates a standard Prometheus configuration for the integration.It is not applicable when using Quarkus.
 - 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 registryon 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 registryon 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 r [...]
   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: 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: false
   profiles:
@@ -683,8 +503,7 @@ 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)
@@ -692,59 +511,42 @@ 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. [...]
   - 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
   platform: false
   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.
@@ -757,14 +559,11 @@ traits:
   - Kubernetes
   - Knative
   - OpenShift
-  description: The 3scale trait can be used to automatically create annotations that
-    allow3scale 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 allow3scale 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.
@@ -786,27 +585,20 @@ traits:
   - Kubernetes
   - Knative
   - OpenShift
-  description: The Tracing trait can be used to automatically publish tracing information
-    to anOpenTracing 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 anOpenTracing 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")


[camel-k] 01/02: chore(doc): Add examples back into the affinity trait documentation

Posted by as...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit cc3e7c785e7eafacb3438014032db782d04b796b
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Jul 15 17:54:38 2020 +0200

    chore(doc): Add examples back into the affinity trait documentation
---
 docs/modules/traits/pages/affinity.adoc | 22 +++++++++++++++++++++-
 pkg/trait/affinity.go                   |  2 +-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/docs/modules/traits/pages/affinity.adoc b/docs/modules/traits/pages/affinity.adoc
index e43cf92..61a8c1a 100755
--- a/docs/modules/traits/pages/affinity.adoc
+++ b/docs/modules/traits/pages/affinity.adoc
@@ -1,7 +1,7 @@
 = Affinity Trait
 
 // Start of autogenerated code - DO NOT EDIT! (description)
-Allows to constrain which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node,
+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.
@@ -52,3 +52,23 @@ integration pod(s) should not be co-located with.
 |===
 
 // End of autogenerated code - DO NOT EDIT! (configuration)
+
+== Examples
+
+* To schedule the integration pod(s) on a specific node using the https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels[built-in node label] `kubernetes.io/hostname`:
+[source,shell]
+$ kamel run -t affinity.node-affinity-labels="kubernetes.io/hostname in(node-66-50.hosted.k8s.tld)" ...
+
+* To schedule a single integration pod per node (using the `Exists` operator):
+[source,shell]
+$ kamel run -t affinity.pod-anti-affinity-labels="camel.apache.org/integration" ...
+
+* To co-locate the integration pod(s) with other integration pod(s):
+[source,shell]
+$ kamel run -t affinity.pod-affinity-labels="camel.apache.org/integration in(it1, it2)" ...
+
+ The labels options follow the requirements from https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors[Label selectors]. They can be multi-valuated, then the requirements list is ANDed, e.g., to schedule a single integration pod per node AND not co-located with the Camel K operator pod(s):
+ [source,shell]
+ $ kamel run -t affinity.pod-anti-affinity-labels="camel.apache.org/integration" -t affinity.pod-anti-affinity-labels="camel.apache.org/component=operator" ...
+
+ More information can be found in the official Kubernetes documentation about https://kubernetes.io/docs/concepts/configuration/assign-pod-node/[Assigning Pods to Nodes].
diff --git a/pkg/trait/affinity.go b/pkg/trait/affinity.go
index 795166f..b90a990 100644
--- a/pkg/trait/affinity.go
+++ b/pkg/trait/affinity.go
@@ -30,7 +30,7 @@ import (
 	v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
 )
 
-// Allows to constrain which nodes the integration pod(s) are eligible to be scheduled on, based on labels on the node,
+// 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.