From 541a662e128f9e6760c09a6985b72b5bb2427396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Sevilla?= Date: Thu, 30 Nov 2023 22:37:41 +0100 Subject: [PATCH] Adding service mesh annotations (#120) Adding annotations to deployments to inject istio sidecar container when the namespace is included in the service mesh Signed-off-by: Raul Sevilla --- pkg/k8s/kubernetes.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/k8s/kubernetes.go b/pkg/k8s/kubernetes.go index 0e778233..61b30b83 100644 --- a/pkg/k8s/kubernetes.go +++ b/pkg/k8s/kubernetes.go @@ -177,7 +177,7 @@ func BuildSUT(client *kubernetes.Clientset, s *config.PerfScenarios) error { } s.IperfService, err = CreateService(iperfSVC, client) if err != nil { - return fmt.Errorf("😥 Unable to create iperf service") + return fmt.Errorf("😥 Unable to create iperf service: %v", err) } // Create netperf service @@ -463,6 +463,9 @@ func CreateDeployment(dp DeploymentParams, client *kubernetes.Clientset) (*appsv Template: apiv1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: dp.Labels, + Annotations: map[string]string{ + "sidecar.istio.io/inject": "true", + }, }, Spec: apiv1.PodSpec{ ServiceAccountName: sa,