You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2022/09/14 08:35:10 UTC
[camel] 01/02: camel-kubernetes: Update instructions for running integration tests with Kind
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit e2810b8645bf5c85be938fb36218e8dae5808478
Author: James Netherton <ja...@gmail.com>
AuthorDate: Tue Sep 13 13:07:17 2022 +0100
camel-kubernetes: Update instructions for running integration tests with Kind
---
components/camel-kubernetes/README.md | 32 ++++++++++++++++++++++++++++----
1 file changed, 28 insertions(+), 4 deletions(-)
diff --git a/components/camel-kubernetes/README.md b/components/camel-kubernetes/README.md
index 59670dd2689..7e4eab9a719 100644
--- a/components/camel-kubernetes/README.md
+++ b/components/camel-kubernetes/README.md
@@ -14,20 +14,44 @@ It is possible to run the integration tests using Kind. To do so, follow these s
kind create cluster
```
-2. Get the auth token:
+2. Set the default namespace to work with (optional):
```
-export KUBE_TOKEN=$(kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='default')].data.token}"|base64 --decode)
+kubectl config set-context --current --namespace=default
```
-4. Get the host:
+3. Create a ServiceAccount and Secret:
+
+```
+kubectl create serviceaccount camel
+```
+
+```
+cat <<EOF | kubectl apply -f -
+apiVersion: v1
+kind: Secret
+metadata:
+ name: camel-token
+ annotations:
+ kubernetes.io/service-account.name: camel
+type: kubernetes.io/service-account-token
+EOF
+```
+
+4. Get the auth token:
+
+```
+export KUBE_TOKEN=$(kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='camel')].data.token}"|base64 --decode)
+```
+
+5. Get the host:
```
export KIND_PORT=$(docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}}{{(index $conf 0).HostPort}}{{end}}' kind-control-plane)
export KUBE_HOST=https://localhost:$KIND_PORT
```
-5. Run the test:
+6. Run the test:
```
mvn -Dkubernetes.test.auth="$KUBE_TOKEN" -Dkubernetes.test.host=$KUBE_HOST -Dkubernetes.test.host.k8s=true clean verify
```