Jaeger-operator: How to add volumes and volumeMounts

Created on 26 Oct 2018  路  9Comments  路  Source: jaegertracing/jaeger-operator

I want to this yaml file can be able to apply by jaeger-operator.

apiVersion: io.jaegertracing/v1alpha1
kind: Jaeger
metadata:
  name: istio-jaeger
spec:
  strategy: production
  collector:
    image: jaegertracing/jaeger-collector:latest
    volumeMounts:
    - mountPath: /usr/share/elasticsearch/config/tls
      name: certs
      readOnly: true
  query:
    image: jaegertracing/jaeger-query:latest
    volumeMounts:
    - mountPath: /usr/share/elasticsearch/config/tls
      name: certs
      readOnly: true
  volumes:
  - name: certs
    secret:
      defaultMode: 420
      secretName: es-certs
  storage:
    type: elasticsearch
    options:
      es:
        server-urls: http://elasticsearch:9200
        tls: true
        tls.cert: /usr/share/elasticsearch/config/tls/elasticsearch-router.crt
        tls.key: /usr/share/elasticsearch/config/tls/elasticsearch-router.key
        tls.ca: /usr/share/elasticsearch/config/tls/ca.crt

Check the source code and cannot find any struct defined for volumes and volumeMounts

enhancement help wanted

All 9 comments

We need this enhancement to enable jaeger-operator can be used in the Istio helm chart - istio/istio#9508

@jpkrohling Any comments or suggestions for this issue? This is a blocking issue for me to use jaeger-operator. Thanks.

This is a great feature request. I was out last week and I have some things to catch up, but this is certainly something we can fix one way or another. Besides the collector, the query and the all-in-one would need a similar feature.

I'm marking this as "help needed", in case someone wants to tackle this before I have the chance to work on it.

@jpkrohling how about this proposal:

diff --git a/pkg/apis/io/v1alpha1/types.go b/pkg/apis/io/v1alpha1/types.go
index 24a65f1..8711355 100644
--- a/pkg/apis/io/v1alpha1/types.go
+++ b/pkg/apis/io/v1alpha1/types.go
@@ -31,6 +31,7 @@ type JaegerSpec struct {
        Collector JaegerCollectorSpec `json:"collector"`
        Agent     JaegerAgentSpec     `json:"agent"`
        Storage   JaegerStorageSpec   `json:"storage"`
+       Volumes   JaegerVolumesSpec    `json:"volumes"`
 }

 // JaegerStatus defines what is to be returned from a status query
@@ -44,6 +45,7 @@ type JaegerQuerySpec struct {
        Size    int               `json:"size"`
        Image   string            `json:"image"`
        Options Options           `json:"options"`
+       VolumeMounts VolumeMounts `json:"volumeMounts"`
 }

 // JaegerIngressSpec defines the options to be used when deploying the query ingress
@@ -56,6 +58,7 @@ type JaegerAllInOneSpec struct {
        Ingress JaegerIngressSpec `json:"ingress"`
        Image   string            `json:"image"`
        Options Options           `json:"options"`
+       VolumeMounts VolumeMounts `json:"volumeMounts"`
 }

 // JaegerCollectorSpec defines the options to be used when deploying the collector
@@ -63,6 +66,7 @@ type JaegerCollectorSpec struct {
        Size    int     `json:"size"`
        Image   string  `json:"image"`
        Options Options `json:"options"`
+       VolumeMounts VolumeMounts `json:"volumeMounts"`
 }

 // JaegerAgentSpec defines the options to be used when deploying the agent

Wouldn't that also require a Volume spec to be present somewhere? Isn't a VolumeMount required to reference a Volume?

@jpkrohling Do we need to consider 3 cases?
Case 1: Allow define Volume & VolumeMount in JaegerSpec and apply to JaegerAllInOne JaegerQuery JaegerCollector JaegerAgent
Case 2: Allow define Volume in JaegerSpec as a global volume, each component can be able to refer to it.
Case 3: Allow define Volume & VolumeMount in JaegerAllInOneSpec JaegerQuerySpec JaegerCollectorSpec JaegerAgentSpec separately.

@jpkrohling please help to review my PR. Thanks for your suggestion.

Looks good! The cases you listed could be used as part of the unit tests :)

Was this page helpful?
0 / 5 - 0 ratings