From 465c268e1f0847ad9105e403c1bacf0b1c82e74e Mon Sep 17 00:00:00 2001 From: Huamin Chen Date: Thu, 9 Aug 2018 16:07:23 -0400 Subject: [PATCH] don't inject istio sidecar in feed controller job Signed-off-by: Huamin Chen --- pkg/controller/feed/resources/job.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/controller/feed/resources/job.go b/pkg/controller/feed/resources/job.go index f3022ba8a37..c2dcfb0a443 100644 --- a/pkg/controller/feed/resources/job.go +++ b/pkg/controller/feed/resources/job.go @@ -38,6 +38,8 @@ const ( OperationStartFeed Operation = "START" // OperationStopFeed specifies a feed should be stopped OperationStopFeed = "STOP" + // istio side car injection annotation + sidecarIstioInjectAnnotation = "sidecar.istio.io/inject" ) // EnvVar specifies the names of the environment variables passed to the @@ -183,6 +185,11 @@ func makePodTemplate(feed *feedsv1alpha1.Feed, source *feedsv1alpha1.EventSource } return &corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + // don't inject Istio sidecar + // so if the feed can to access external services during StartFeed/StopFeed + Annotations: map[string]string{sidecarIstioInjectAnnotation: "false"}, + }, Spec: corev1.PodSpec{ ServiceAccountName: feed.Spec.ServiceAccountName, RestartPolicy: corev1.RestartPolicyNever,