deployment_java.yaml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: ob-server-java
  5. namespace: observe
  6. labels:
  7. app.kubernetes.io/name: ob-server-java
  8. spec:
  9. selector:
  10. matchLabels:
  11. app.kubernetes.io/name: ob-server-java
  12. replicas: 1
  13. template:
  14. metadata:
  15. labels:
  16. app.kubernetes.io/name: ob-server-java
  17. spec:
  18. shareProcessNamespace: true
  19. containers:
  20. - name: observe-server-java
  21. image: reg.cestong.com.cn/cecf/java-simple
  22. imagePullPolicy: Always
  23. command:
  24. - java
  25. - "-javaagent:opentelemetry-javaagent.jar"
  26. - -DAPP_NAME=javasimple
  27. - -jar
  28. - java-simple.jar
  29. ports:
  30. - name: web
  31. containerPort: 8080
  32. protocol: TCP
  33. env:
  34. # - name: JAVA_TOOL_OPTIONS
  35. # value: -javaagent:/usr/src/app/opentelemetry-javaagent.jar
  36. - name: OTEL_SERVICE_NAME
  37. value: java-simple-service
  38. - name: OTEL_EXPORTER_OTLP_ENDPOINT
  39. value: "http://otel-collector-opentelemetry-collector.observe.svc.cluster.local:4318"
  40. - name: OTEL_TRACES_EXPORTER
  41. value: otlp
  42. - name: OTEL_METRICS_EXPORTER
  43. value: none
  44. - name: OTEL_LOGS_EXPORTER
  45. value: none
  46. - name: OTEL_EXPORTER_OTLP_PROTOCOL
  47. value: http/protobuf
  48. - name: OTEL_RESOURCE_ATTRIBUTES
  49. value: app.name=javasimple,service.version=0.0.1