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/26 08:13:04 UTC

[camel] 01/04: Camel-Kubernetes: Add sample code for service accounts

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 d0057b6a1286932b3158178cec915a324be54ddc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Sep 26 10:10:37 2019 +0200

    Camel-Kubernetes: Add sample code for service accounts
---
 .../kubernetes-service-accounts-component.adoc     | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-service-accounts-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-service-accounts-component.adoc
index a0a6e3e..6671fe6 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-service-accounts-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-service-accounts-component.adoc
@@ -108,3 +108,35 @@ The component supports 2 options, which are listed below.
 - createServiceAccount
 - deleteServiceAccount
 
+== Kubernetes ServiceAccounts Produce Examples
+
+- listServiceAccounts: this operation list the sa on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:list").
+    toF("kubernetes-service-accounts:///?kubernetesClient=#kubernetesClient&operation=listServiceAccounts").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of servoces from your cluster
+
+- listServiceAccountsByLabels:  this operation list the sa 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_SERVICE_ACCOUNTS_LABELS, labels);
+            }
+        });
+    toF("kubernetes-service-accounts:///?kubernetesClient=#kubernetesClient&operation=listServiceAccountsByLabels").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Services from your cluster, using a label selector (with key1 and key2, with value value1 and value2)