You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/09/24 08:39:22 UTC
[camel] branch master updated (3d8473a -> 975b3fa)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.
from 3d8473a Regen
new 97b7211 Camel-Kubernetes: Added samples code for pod component
new 975b3fa Regen docs
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:
.../src/main/docs/kubernetes-pods-component.adoc | 51 ++++++++++++++++++++++
.../ROOT/pages/kubernetes-pods-component.adoc | 51 ++++++++++++++++++++++
2 files changed, 102 insertions(+)
[camel] 01/02: Camel-Kubernetes: Added samples code for pod
component
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 97b721166d8281040d1ecfc3e087a637186550ad
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Sep 24 10:37:59 2019 +0200
Camel-Kubernetes: Added samples code for pod component
---
.../src/main/docs/kubernetes-pods-component.adoc | 51 ++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-pods-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-pods-component.adoc
index 63697ec..ba00bb8 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-pods-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-pods-component.adoc
@@ -118,3 +118,54 @@ The component supports 2 options, which are listed below.
- createPod
- deletePod
+== Kubernetes Pods Producer Examples
+
+- listPods: this operation list the pods on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:list").
+ toF("kubernetes-pods:///?kubernetesClient=#kubernetesClient&operation=listPods").
+ to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Pods from your cluster
+
+- listPodsByLabels: this operation list the pods by labels on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:listByLabels").process(new Processor() {
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Map<String, String> labels = new HashMap<>();
+ labels.put("key1", "value1");
+ labels.put("key2", "value2");
+ exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_PODS_LABELS, labels);
+ }
+ });
+ toF("kubernetes-pods:///?kubernetesClient=#kubernetesClient&operation=listPodsByLabels").
+ to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Pods from your cluster, using a label selector (with key1 and key2, with value value1 and value2)
+
+== Kubernetes Deployments Consumer Example
+
+[source,java]
+--------------------------------------------------------------------------------
+fromF("kubernetes-pods://%s?oauthToken=%s&namespace=default&resourceName=test", host, authToken).process(new KubernertesProcessor()).to("mock:result");
+
+ public class KubernertesProcessor implements Processor {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Message in = exchange.getIn();
+ Pod pod = exchange.getIn().getBody(Pod.class);
+ log.info("Got event with configmap name: " + pod.getMetadata().getName() + " and action " + in.getHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION));
+ }
+ }
+--------------------------------------------------------------------------------
+
+This consumer will return a list of events on the namespace default for the pod test.
+
[camel] 02/02: Regen docs
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 975b3fa3bea9339dd27f21aa32212f229498e3b7
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Sep 24 10:38:37 2019 +0200
Regen docs
---
.../ROOT/pages/kubernetes-pods-component.adoc | 51 ++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/docs/components/modules/ROOT/pages/kubernetes-pods-component.adoc b/docs/components/modules/ROOT/pages/kubernetes-pods-component.adoc
index ee5d08f..070f09d 100644
--- a/docs/components/modules/ROOT/pages/kubernetes-pods-component.adoc
+++ b/docs/components/modules/ROOT/pages/kubernetes-pods-component.adoc
@@ -119,3 +119,54 @@ The component supports 2 options, which are listed below.
- createPod
- deletePod
+== Kubernetes Pods Producer Examples
+
+- listPods: this operation list the pods on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:list").
+ toF("kubernetes-pods:///?kubernetesClient=#kubernetesClient&operation=listPods").
+ to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Pods from your cluster
+
+- listPodsByLabels: this operation list the pods by labels on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:listByLabels").process(new Processor() {
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Map<String, String> labels = new HashMap<>();
+ labels.put("key1", "value1");
+ labels.put("key2", "value2");
+ exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_PODS_LABELS, labels);
+ }
+ });
+ toF("kubernetes-pods:///?kubernetesClient=#kubernetesClient&operation=listPodsByLabels").
+ to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Pods from your cluster, using a label selector (with key1 and key2, with value value1 and value2)
+
+== Kubernetes Deployments Consumer Example
+
+[source,java]
+--------------------------------------------------------------------------------
+fromF("kubernetes-pods://%s?oauthToken=%s&namespace=default&resourceName=test", host, authToken).process(new KubernertesProcessor()).to("mock:result");
+
+ public class KubernertesProcessor implements Processor {
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ Message in = exchange.getIn();
+ Pod pod = exchange.getIn().getBody(Pod.class);
+ log.info("Got event with configmap name: " + pod.getMetadata().getName() + " and action " + in.getHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION));
+ }
+ }
+--------------------------------------------------------------------------------
+
+This consumer will return a list of events on the namespace default for the pod test.
+