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

refactor: move deployment configmap to helm values #68

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ Additionally, the OpenTelemetry Contrib collector has also been changed to the [
# !(when an older helm open-telemetry repo exists) update the open-telemetry helm repo
helm repo update open-telemetry

# deploy the configuration for the Elastic OpenTelemetry collector distribution
kubectl apply -f configmap-deployment.yaml

# deploy the demo through helm install
helm install -f deployment.yaml my-otel-demo open-telemetry/opentelemetry-demo
```
Expand Down
82 changes: 0 additions & 82 deletions kubernetes/elastic-helm/configmap-deployment.yaml

This file was deleted.

94 changes: 62 additions & 32 deletions kubernetes/elastic-helm/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,6 @@ default:
image:
repository: ghcr.io/elastic/opentelemetry-demo
tag: 1.11.3
envOverrides:
- name: OTEL_SERVICE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.labels['app.kubernetes.io/component']
- name: OTEL_K8S_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: OTEL_K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: OTEL_K8S_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: OTEL_K8S_POD_UID
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.uid
- name: OTEL_RESOURCE_ATTRIBUTES
value: 'service.name=$(OTEL_SERVICE_NAME),service.instance.id=$(OTEL_K8S_POD_UID),service.namespace=opentelemetry-demo,k8s.namespace.name=$(OTEL_K8S_NAMESPACE),k8s.node.name=$(OTEL_K8S_NODE_NAME),k8s.pod.name=$(OTEL_K8S_POD_NAME)'


opentelemetry-collector:
image:
Expand Down Expand Up @@ -59,9 +30,68 @@ opentelemetry-collector:
name: elastic-secret
key: elastic_apm_secret_token

configMap:
create: false
existingName: elastic-otelcol-agent
config:
receivers:
redis: null
exporters:
otlphttp/prometheus: null
opensearch: null
otlp: null
otlp/elastic:
endpoint: ${env:ELASTIC_APM_ENDPOINT}
compression: none
headers:
Authorization: Bearer ${env:ELASTIC_APM_SECRET_TOKEN}
processors:
k8sattributes:
extract:
metadata:
- k8s.namespace.name
- k8s.deployment.name
- k8s.statefulset.name
- k8s.daemonset.name
- k8s.cronjob.name
- k8s.job.name
- k8s.node.name
- k8s.pod.name
- k8s.pod.uid
- k8s.pod.start_time
- container.image.name
- container.image.tag
- k8s.container.name
passthrough: false
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: resource_attribute
name: k8s.pod.uid
- sources:
- from: connection
resource:
attributes:
- key: service.instance.id
from_attribute: k8s.pod.uid
action: insert
- key: deployment.environment
value: "opentelemetry-demo"
action: upsert

service:
pipelines:
traces:
receivers: [otlp]
processors: [k8sattributes, memory_limiter, transform, resource, batch]
exporters: [otlp/elastic, spanmetrics]
metrics:
receivers: [httpcheck/frontendproxy, otlp, spanmetrics]
processors: [k8sattributes, memory_limiter, resource, batch]
exporters: [otlp/elastic]
logs:
processors: [k8sattributes, memory_limiter, resource, batch]
exporters: [otlp/elastic]


opensearch:
enabled: false
Expand Down
Loading