Skip to content

Commit

Permalink
Adding service mesh annotations (#120)
Browse files Browse the repository at this point in the history
Adding annotations to deployments to inject istio sidecar container when
the namespace is included in the service mesh

Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 authored Nov 30, 2023
1 parent 10fbdeb commit 541a662
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/k8s/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 541a662

Please sign in to comment.