Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not auto-create service account if an existing one is specified #1224

Closed
csquire opened this issue Nov 4, 2022 · 2 comments · Fixed by #1246
Closed

Do not auto-create service account if an existing one is specified #1224

csquire opened this issue Nov 4, 2022 · 2 comments · Fixed by #1246
Labels
area:collector Issues for deploying collector help wanted Extra attention is needed

Comments

@csquire
Copy link
Contributor

csquire commented Nov 4, 2022

Problem:
When serviceAccount is set on an OpenTelemetryCollector, a service account based on the collector name still gets created even though it's unused. The extra serviceAccount is just noise and should not be created. From looking at the code, it appears a targetAllocator serviceAccount will also be auto-created by the operator when an existing serviceAccount is specified.

Expected:
No service accounts are auto-created when an existing serviceAccount is specified

Actual:
Service accounts are auto-created even if an existing one is specified

To Reproduce:
Create a service account, in my case I made an opentelemetry-collector SA
Apply a collector with a serviceAccount, I used the simplest collector below as a test

apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
  name: simplest
  namespace: opentelemetry
spec:
  mode: deployment
  config: |
    receivers:
      otlp:
        protocols:
          grpc:
          http:
    processors:
      memory_limiter:
        check_interval: 1s
        limit_percentage: 75
        spike_limit_percentage: 15
      batch:
        send_batch_size: 10000
        timeout: 10s

    exporters:
      logging:

    service:
      pipelines:
        traces:
          receivers: [otlp]
          processors: []
          exporters: [logging]
      telemetry:
        logs:
          level: info
          initial_fields:
            app: otel-collector
        metrics:
          level: detailed
          address: 0.0.0.0:8888

  resources:
    limits:
      memory: 500Mi
    requests:
      memory: 200Mi
      cpu: 200m
  serviceAccount: opentelemetry-collector
@csquire csquire changed the title Do not auto-create service account if one an existing one is specified Do not auto-create service account if an existing one is specified Nov 4, 2022
@pavolloffay pavolloffay added help wanted Extra attention is needed area:collector Issues for deploying collector labels Nov 7, 2022
@pavolloffay
Copy link
Member

+1 @csquire would you like to submit a fix?

@csquire
Copy link
Contributor Author

csquire commented Nov 8, 2022

sure, I can have a look soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:collector Issues for deploying collector help wanted Extra attention is needed
Projects
None yet
2 participants