Skip to content

Unable to specifying custom labels for the deployable components #629

Closed

Description

We are encountering an issue while creating a jaeger instance with custom labels specified for the allInOne and query components. When specified, the jaeger-operator 1.13.1 is unable to create the deployment object as the labels and selector do not match.

Here is a capture of the errors raised within the jaeger-operator:

Showing logs for nihilist-tortoise-jaeger-operator-fbbddb55b-mrwxn
time="2019-08-28T14:32:41Z" level=info msg=Versions arch=amd64 jaeger-operator=1.13.1 operator-sdk=v0.8.1 os=linux version=go1.12.5
time="2019-08-28T14:32:41Z" level=info msg="Auto-detected the platform" platform=kubernetes
time="2019-08-28T14:32:41Z" level=info msg="Automatically adjusted the 'es-provision' flag" es-provision=false
time="2019-08-28T14:33:00Z" level=error msg="failed to apply the changes" error="Deployment.apps \"jaeger-tracing\" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{\"app\":\"jaeger\", \"app.kubernetes.io/component\":\"all-in-one\", \"app.kubernetes.io/instance\":\"jaegerinstance-jaeger-ee5678e5\", \"app.kubernetes.io/managed-by\":\"jaeger-operator\", \"app.kubernetes.io/name\":\"jaegerinstance-jaeger-ee5678e5\", \"app.kubernetes.io/part-of\":\"tracingstack-e7754f6b-qe-e016f16c\"}: `selector` does not match template `labels`" execution="2019-08-28 14:32:59.827584072 +0000 UTC" instance=jaeger-tracing namespace=observability

The following Jaeger manifest will trigger the issue;

apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
  name: jaeger-tracing
  namespace: observability
spec:
  strategy: allInOne
  allInOne:
    image: docker.io/jaegertracing/all-in-one:1.13.1
    labels:
      app: jaeger
      app.kubernetes.io/instance: jaegerinstance-jaeger-ee5678e5
      app.kubernetes.io/managed-by: jaeger-operator
      app.kubernetes.io/name: jaegerinstance-jaeger-ee5678e5
      app.kubernetes.io/part-of: tracingstack-e7754f6b-qe-e016f16c
  storage:
    type: elasticsearch
    options:
      es:
        server-urls: https://es-tracing-elasticsearch-local-es-http.observability.svc:9200
        tls.ca: /etc/ssl/certs/tls.crt
    secretName: storage-secret
  ingress:
    enabled: false
  agent:
    image: jaegertracing/jaeger-agent:1.13.1
    strategy: sidecar

Within our platform, we require the usage of custom labels applied to the query and allInOne pods as we have our own service exposition mechanism with a IngressRule resource which must be given the selector labels for the target pods. Having the ability to specify the set of custom labels to be applied to the underlying components deployed by the jaeger-operator allows us to expose the service within our platform correctly.

The labels generated by our various controllers, one of which creates the jaeger instance, all use the set of common labels with a specific generation pattern. The error described above will occur specifically when one of the common labels is provided within the allInOne or query specification as this causes a conflict between the default labels used by the jaeger-operator.

Upon further investigation, the issue seems to be caused by the fact that the Deployment for the allInOne and query components are created with two different sets of labels, with the selector never taking into account the labels passed in the component specification:

  • The pod labels are created for a merge of the default labels and any labels from the global or component specification.
  • The deployment selector labels are created from the default labels only.

The issue can be found at the following location for the allInOne deployment.

I believe that to correctly support custom labels, including the common labels recommended by Kubernetes, the deployment selector should take into account any label passed within the specification and assume them as more specific than the default labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions