You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2019/11/26 09:54:12 UTC

[camel-k] branch master updated: fix(doc): Add affinity trait examples back

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c763829  fix(doc): Add affinity trait examples back
c763829 is described below

commit c763829d1bbf507a1d37032c4d7dfbb082fe7a0b
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Tue Nov 26 10:22:18 2019 +0100

    fix(doc): Add affinity trait examples back
---
 docs/modules/ROOT/pages/traits/affinity.adoc | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/docs/modules/ROOT/pages/traits/affinity.adoc b/docs/modules/ROOT/pages/traits/affinity.adoc
index def4a7b..6562fba 100755
--- a/docs/modules/ROOT/pages/traits/affinity.adoc
+++ b/docs/modules/ROOT/pages/traits/affinity.adoc
@@ -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].