honeycombio / helm-charts

Helm repository and charts for Honeycomb
Apache License 2.0
30 stars 39 forks source link

OpenTelemetry charts can't run deploy otel/opentelemetry-collector images #108

Closed cbenjemaa closed 2 years ago

cbenjemaa commented 2 years ago

Versions

Chart: opentelemetry-collector-1.0.0 Helm: v3.7.1 Kubernetes cluster: 1.20.12-gke.1500

Steps to reproduce

  1. Set the following in values.yaml
    image:
    repository: otel/opentelemetry-collector
    tag: "0.41.0"

Additional context

helm get manifest otel-collector

---
# Source: opentelemetry-collector/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: otel-collector
  labels:
    helm.sh/chart: opentelemetry-collector-1.0.0
    app.kubernetes.io/name: opentelemetry-collector
    app.kubernetes.io/instance: otel-collector
    app.kubernetes.io/version: "0.36.0"
    app.kubernetes.io/managed-by: Helm
---
# Source: opentelemetry-collector/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: otel-collector
  labels:
    helm.sh/chart: opentelemetry-collector-1.0.0
    app.kubernetes.io/name: opentelemetry-collector
    app.kubernetes.io/instance: otel-collector
    app.kubernetes.io/version: "0.36.0"
    app.kubernetes.io/managed-by: Helm
data:
  opentelemetry-collector-config: |
    receivers:
      jaeger:
        protocols:
          grpc: null
          thrift_binary: null
          thrift_compact: null
          thrift_http: null
      otlp:
        protocols:
          http:
            cors:
              allowed_origins:
              - https://*.domain.com
              max_age: 7200
      zipkin: null

      batch: null
      memory_limiter:
        check_interval: 5s
        limit_mib: 1500
        limit_percentage: 75
        spike_limit_mib: 512
        spike_limit_percentage: 25

    exporters:
      otlp:
        endpoint: api.honeycomb.io:443
        headers:
          "x-honeycomb-team": "${HONEYCOMB_API_KEY}"
          "x-honeycomb-dataset": "dataset"

    extensions:
      health_check:
        port: 13133
      memory_ballast:
        size_in_percentage: 35
        size_mib: 683

    service:
      extensions:
      - health_check
      - memory_ballast
      pipelines:
        traces:
          exporters:
          - otlp
---
# Source: opentelemetry-collector/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: otel-collector
  labels:
    helm.sh/chart: opentelemetry-collector-1.0.0
    app.kubernetes.io/name: opentelemetry-collector
    app.kubernetes.io/instance: otel-collector
    app.kubernetes.io/version: "0.36.0"
    app.kubernetes.io/managed-by: Helm
spec:
  type: ClusterIP
  ports:
    - name: jaeger-binary
      port: 6832
      targetPort: jaeger-binary
      protocol: UDP
    - name: jaeger-compact
      port: 6831
      targetPort: jaeger-compact
      protocol: UDP
    - name: jaeger-grpc
      port: 14250
      targetPort: jaeger-grpc
      protocol: TCP
    - name: jaeger-http
      port: 14268
      targetPort: jaeger-http
      protocol: TCP
    - name: otlp-grpc
      port: 4317
      targetPort: otlp-grpc
      protocol: TCP
    - name: otlp-http
      port: 4318
      targetPort: otlp-http
      protocol: TCP
    - name: zipkin
      port: 9411
      targetPort: zipkin
      protocol: TCP
  selector:
    app.kubernetes.io/name: opentelemetry-collector
    app.kubernetes.io/instance: otel-collector
---
# Source: opentelemetry-collector/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: otel-collector
  labels:
    helm.sh/chart: opentelemetry-collector-1.0.0
    app.kubernetes.io/name: opentelemetry-collector
    app.kubernetes.io/instance: otel-collector
    app.kubernetes.io/version: "0.36.0"
    app.kubernetes.io/managed-by: Helm
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: opentelemetry-collector
      app.kubernetes.io/instance: otel-collector
  template:
    metadata:
      annotations:
        checksum/config: a91e3987fb1fdcc78aeab88c55c33a190e7e5f7a27a19b594064d8d147673151
      labels:
        app.kubernetes.io/name: opentelemetry-collector
        app.kubernetes.io/instance: otel-collector
    spec:
      serviceAccountName: otel-collector
      securityContext:
        {}
      containers:
        - name: opentelemetry-collector
          securityContext:
            {}
          image: "otel/opentelemetry-collector:0.41.0"
          imagePullPolicy: IfNotPresent
          command:
            - "/otelcontribcol"
            - "--config=/conf/opentelemetry-collector-config.yaml"
          env:
            - name: HONEYCOMB_API_KEY
              valueFrom:
                secretKeyRef:
                  name: honeycomb-api
                  key: api-key
          ports:
            - name: jaeger-binary
              containerPort: 6832
              protocol: UDP
            - name: jaeger-compact
              containerPort: 6831
              protocol: UDP
            - name: jaeger-grpc
              containerPort: 14250
              protocol: TCP
            - name: jaeger-http
              containerPort: 14268
              protocol: TCP
            - name: otlp-grpc
              containerPort: 4317
              protocol: TCP
            - name: otlp-http
              containerPort: 4318
              protocol: TCP
            - name: zipkin
              containerPort: 9411
              protocol: TCP
          volumeMounts:
            - name: opentelemetry-collector-config
              mountPath: /conf
          livenessProbe:
            httpGet:
              path: /
              port: 13133
          readinessProbe:
            httpGet:
              path: /
              port: 13133
          resources:
            limits:
              cpu: 1000m
              memory: 2Gi
            requests:
              cpu: 200m
              memory: 400Mi
      volumes:
        - name: opentelemetry-collector-config
          configMap:
            name: otel-collector
            items:
              - key: opentelemetry-collector-config
                path: opentelemetry-collector-config.yaml

The otel chart v1.0.0 is release with opentelemetry-collector-contrib:0.36.0 but I wanted to try opentelemetry-collector:0.41.0

But the containers fails to run because opentelemetry-collector-contrib docker container uses /otelcontribcol command and opentelemetry-collector docker container uses /otelcorecol.

Unfortunately the're no way with the current chart to set the command in deployment.yaml.

PS: If you confirm this bug I'd like to work on a fix

MikeGoldsmith commented 2 years ago

Hey @cbenjemaa - thanks for creating the issue.

We're about to release a new version of the opentelemetry collector chart that switches from using command to args when starting the image. Using args means the image's command is not overwritten and so allows swapping between the core and contrib images.

I've just been through and tested replacing repository in values.yml to "otel/opentelemetry-collector" and the pod started up as expected.

Linked to #107

cbenjemaa commented 2 years ago

Is the fix already pushed ?

MikeGoldsmith commented 2 years ago

@cbenjemaa not yet, it should be ready soon. I'll post back here when available.

JamieDanielson commented 2 years ago

@cbenjemaa , the new chart v1.1.0 is now published and available for use!