diff --git a/pkg/deployment/agent.go b/pkg/deployment/agent.go index fcdd900ff..a22c2429d 100644 --- a/pkg/deployment/agent.go +++ b/pkg/deployment/agent.go @@ -64,15 +64,18 @@ func (a *Agent) Get() *appsv1.DaemonSet { baseCommonSpec := v1.JaegerCommonSpec{ Annotations: map[string]string{ - "prometheus.io/scrape": "true", - "prometheus.io/port": strconv.Itoa(int(adminPort)), - "sidecar.istio.io/inject": "false", - "linkerd.io/inject": "disabled", + "prometheus.io/scrape": "true", + "prometheus.io/port": strconv.Itoa(int(adminPort)), + "linkerd.io/inject": "disabled", }, Labels: labels, } commonSpec := util.Merge([]v1.JaegerCommonSpec{a.jaeger.Spec.Agent.JaegerCommonSpec, a.jaeger.Spec.JaegerCommonSpec, baseCommonSpec}) + _, ok := commonSpec.Annotations["sidecar.istio.io/inject"] + if !ok { + commonSpec.Annotations["sidecar.istio.io/inject"] = "false" + } ca.Update(a.jaeger, commonSpec) ca.AddServiceCA(a.jaeger, commonSpec) diff --git a/pkg/deployment/all_in_one.go b/pkg/deployment/all_in_one.go index a159f7dbc..7771912eb 100644 --- a/pkg/deployment/all_in_one.go +++ b/pkg/deployment/all_in_one.go @@ -50,15 +50,18 @@ func (a *AllInOne) Get() *appsv1.Deployment { baseCommonSpec := v1.JaegerCommonSpec{ Annotations: map[string]string{ - "prometheus.io/scrape": "true", - "prometheus.io/port": strconv.Itoa(int(adminPort)), - "sidecar.istio.io/inject": "false", - "linkerd.io/inject": "disabled", + "prometheus.io/scrape": "true", + "prometheus.io/port": strconv.Itoa(int(adminPort)), + "linkerd.io/inject": "disabled", }, Labels: a.labels(), } commonSpec := util.Merge([]v1.JaegerCommonSpec{a.jaeger.Spec.AllInOne.JaegerCommonSpec, a.jaeger.Spec.JaegerCommonSpec, baseCommonSpec}) + _, ok := commonSpec.Annotations["sidecar.istio.io/inject"] + if !ok { + commonSpec.Annotations["sidecar.istio.io/inject"] = "false" + } options := allArgs(a.jaeger.Spec.AllInOne.Options, a.jaeger.Spec.Storage.Options.Filter(a.jaeger.Spec.Storage.Type.OptionsPrefix())) @@ -119,7 +122,7 @@ func (a *AllInOne) Get() *appsv1.Deployment { Name: a.jaeger.Name, Namespace: a.jaeger.Namespace, Labels: commonSpec.Labels, - Annotations: commonSpec.Annotations, + Annotations: baseCommonSpec.Annotations, OwnerReferences: []metav1.OwnerReference{{ APIVersion: a.jaeger.APIVersion, Kind: a.jaeger.Kind, diff --git a/pkg/deployment/collector.go b/pkg/deployment/collector.go index 1f6d678a7..2952dbd9d 100644 --- a/pkg/deployment/collector.go +++ b/pkg/deployment/collector.go @@ -45,15 +45,18 @@ func (c *Collector) Get() *appsv1.Deployment { baseCommonSpec := v1.JaegerCommonSpec{ Annotations: map[string]string{ - "prometheus.io/scrape": "true", - "prometheus.io/port": strconv.Itoa(int(adminPort)), - "sidecar.istio.io/inject": "false", - "linkerd.io/inject": "disabled", + "prometheus.io/scrape": "true", + "prometheus.io/port": strconv.Itoa(int(adminPort)), + "linkerd.io/inject": "disabled", }, Labels: labels, } commonSpec := util.Merge([]v1.JaegerCommonSpec{c.jaeger.Spec.Collector.JaegerCommonSpec, c.jaeger.Spec.JaegerCommonSpec, baseCommonSpec}) + _, ok := commonSpec.Annotations["sidecar.istio.io/inject"] + if !ok { + commonSpec.Annotations["sidecar.istio.io/inject"] = "false" + } var envFromSource []corev1.EnvFromSource if len(c.jaeger.Spec.Storage.SecretName) > 0 { @@ -108,7 +111,7 @@ func (c *Collector) Get() *appsv1.Deployment { Name: c.name(), Namespace: c.jaeger.Namespace, Labels: commonSpec.Labels, - Annotations: commonSpec.Annotations, + Annotations: baseCommonSpec.Annotations, OwnerReferences: []metav1.OwnerReference{{ APIVersion: c.jaeger.APIVersion, Kind: c.jaeger.Kind, diff --git a/pkg/deployment/ingester.go b/pkg/deployment/ingester.go index 9b69ff120..1ec3c87aa 100644 --- a/pkg/deployment/ingester.go +++ b/pkg/deployment/ingester.go @@ -51,15 +51,18 @@ func (i *Ingester) Get() *appsv1.Deployment { baseCommonSpec := v1.JaegerCommonSpec{ Annotations: map[string]string{ - "prometheus.io/scrape": "true", - "prometheus.io/port": strconv.Itoa(int(adminPort)), - "sidecar.istio.io/inject": "false", - "linkerd.io/inject": "disabled", + "prometheus.io/scrape": "true", + "prometheus.io/port": strconv.Itoa(int(adminPort)), + "linkerd.io/inject": "disabled", }, Labels: labels, } commonSpec := util.Merge([]v1.JaegerCommonSpec{i.jaeger.Spec.Ingester.JaegerCommonSpec, i.jaeger.Spec.JaegerCommonSpec, baseCommonSpec}) + _, ok := commonSpec.Annotations["sidecar.istio.io/inject"] + if !ok { + commonSpec.Annotations["sidecar.istio.io/inject"] = "false" + } var envFromSource []corev1.EnvFromSource if len(i.jaeger.Spec.Storage.SecretName) > 0 { diff --git a/pkg/deployment/query.go b/pkg/deployment/query.go index a75c1104e..bedf919f6 100644 --- a/pkg/deployment/query.go +++ b/pkg/deployment/query.go @@ -42,10 +42,9 @@ func (q *Query) Get() *appsv1.Deployment { baseCommonSpec := v1.JaegerCommonSpec{ Annotations: map[string]string{ - "prometheus.io/scrape": "true", - "prometheus.io/port": strconv.Itoa(int(adminPort)), - "sidecar.istio.io/inject": "false", - "linkerd.io/inject": "disabled", + "prometheus.io/scrape": "true", + "prometheus.io/port": strconv.Itoa(int(adminPort)), + "linkerd.io/inject": "disabled", }, Labels: labels, } @@ -63,6 +62,10 @@ func (q *Query) Get() *appsv1.Deployment { } commonSpec := util.Merge([]v1.JaegerCommonSpec{q.jaeger.Spec.Query.JaegerCommonSpec, q.jaeger.Spec.JaegerCommonSpec, baseCommonSpec}) + _, ok := commonSpec.Annotations["sidecar.istio.io/inject"] + if !ok { + commonSpec.Annotations["sidecar.istio.io/inject"] = "false" + } options := allArgs(q.jaeger.Spec.Query.Options, q.jaeger.Spec.Storage.Options.Filter(q.jaeger.Spec.Storage.Type.OptionsPrefix())) @@ -105,7 +108,7 @@ func (q *Query) Get() *appsv1.Deployment { Name: fmt.Sprintf("%s-query", q.jaeger.Name), Namespace: q.jaeger.Namespace, Labels: commonSpec.Labels, - Annotations: commonSpec.Annotations, + Annotations: baseCommonSpec.Annotations, OwnerReferences: []metav1.OwnerReference{{ APIVersion: q.jaeger.APIVersion, Kind: q.jaeger.Kind,