odigos-io / opentelemetry-go-instrumentation

OpenTelemetry auto-instrumentation for Go applications
Apache License 2.0
292 stars 44 forks source link

Go service is stuck in crashloopbackoff after instrumentation. Am I doing something wrong? #57

Open mayanksingh2298 opened 1 year ago

mayanksingh2298 commented 1 year ago

Expected Behavior

kubectl get pods -n atlas
pod/go-service-8c86cf596-5rbpc                 2/2     Running

Actual Behavior

kubectl get pods -n atlas
pod/go-service-8c86cf596-5rbpc                 1/2     CrashLoopBackOff

Steps to Reproduce the Problem

Here's my manifest file relevant for go:

apiVersion: v1
kind: Service
metadata:
  labels:
    app: go-service
  name: go-service
  namespace: atlas
spec:
  ports:
  - port: 30002
    protocol: TCP
    targetPort: 30002
    # If you set the `spec.type` field to `NodePort` and you want a specific port number,
    # you can specify a value in the `spec.ports[*].nodePort` field.
    nodePort: 30002
  selector:
    app: go-service
  type: NodePort
status:
  loadBalancer: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: go-service
  name: go-service
  namespace: atlas
spec:
  replicas: 1
  selector:
    matchLabels:
      app: go-service
  strategy: {}
  template:
    metadata:
      labels:
        app: go-service
    spec:
      shareProcessNamespace: true
      initContainers:
        - name: copy-launcher
          image: keyval/launcher:v0.1
          command:
            - cp
            - -a
            - /kv-launcher/.
            - /odigos-launcher/
          volumeMounts:
            - name: launcherdir
              mountPath: /odigos-launcher
      containers:
        - args:
          - go-service
          image: dev0zklabs/atlas-demo-microservice:go-service
          name: go-service
          command:
            - /odigos-launcher/launch
            - /root/go-service
          volumeMounts:
            - mountPath: /odigos-launcher
              name: launcherdir
          ports:
          - containerPort: 30002
          imagePullPolicy: Always
          envFrom:
            - configMapRef:
                name: envs-config
          resources: {}
        - name: emojivoto-emoji-instrumentation
          image: keyval/otel-go-agent:v0.6.4
          env:
            - name: OTEL_TARGET_EXE
              value: /root/go-service
            - name: OTEL_EXPORTER_OTLP_ENDPOINT
              value: "jaeger:4317"
            - name: OTEL_SERVICE_NAME
              value: "go-service"
          securityContext:
            runAsUser: 0
            capabilities:
              add:
                - SYS_PTRACE
            privileged: true
          volumeMounts:
            - mountPath: /sys/kernel/debug
              name: kernel-debug
      volumes:
        - name: launcherdir
          emptyDir: {}
        - name: kernel-debug
          hostPath:
            path: /sys/kernel/debug
status: {}

Additional Info