From bbb7763a848c8cd4b6465019e54504b6fc946b1f Mon Sep 17 00:00:00 2001 From: Stefan Prisca Date: Wed, 13 May 2020 11:10:19 +0200 Subject: [PATCH] add full collector config --- .../otel-collector/otel-collector-config.yaml | 27 ---- example/otel-collector/otel-collector.yaml | 117 ++++++++++++++++++ 2 files changed, 117 insertions(+), 27 deletions(-) delete mode 100644 example/otel-collector/otel-collector-config.yaml create mode 100644 example/otel-collector/otel-collector.yaml diff --git a/example/otel-collector/otel-collector-config.yaml b/example/otel-collector/otel-collector-config.yaml deleted file mode 100644 index 278fc32c3..000000000 --- a/example/otel-collector/otel-collector-config.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: otel-collector-conf - labels: - app: opentelemetry - component: otel-collector-conf -data: - otel-collector-config: | - receivers: - # Make sure to add the otlp receiver. - # This will use the default configuration, and open up the receiver on port 55680 - otlp: {} - processors: - extensions: - health_check: {} - exporters: - jaeger: - # Replace with a real endpoint. - endpoint: "simplest-collector.default.svc.cluster.local:14250" - service: - extensions: [health_check] - pipelines: - traces/2: - receivers: [otlp] - processors: [] - exporters: [jaeger] \ No newline at end of file diff --git a/example/otel-collector/otel-collector.yaml b/example/otel-collector/otel-collector.yaml new file mode 100644 index 000000000..005a4477a --- /dev/null +++ b/example/otel-collector/otel-collector.yaml @@ -0,0 +1,117 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: otel-collector-conf + labels: + app: opentelemetry + component: otel-collector-conf +data: + otel-collector-config: | + receivers: + # Make sure to add the otlp receiver. + # This will use the default configuration, and open up the receiver on port 55680 + otlp: {} + processors: + extensions: + health_check: {} + exporters: + jaeger: + # Replace with a real endpoint. + endpoint: "simplest-collector.default.svc.cluster.local:14250" + service: + extensions: [health_check] + pipelines: + traces/2: + receivers: [otlp] + processors: [] + exporters: [jaeger] +--- +apiVersion: v1 +kind: Service +metadata: + name: otel-collector + labels: + app: opencensus + component: otel-collector +spec: + ports: + - name: otlp # Default endpoint for Opencensus receiver. + port: 55680 + protocol: TCP + targetPort: 55680 + selector: + component: otel-collector +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: otel-collector + labels: + app: opentelemetry + component: otel-collector +spec: + selector: + matchLabels: + app: opentelemetry + component: otel-collector + minReadySeconds: 5 + progressDeadlineSeconds: 120 + replicas: 1 #TODO - adjust this to your own requirements + template: + metadata: + annotations: + prometheus.io/path: "/metrics" + prometheus.io/port: "8888" + prometheus.io/scrape: "true" + labels: + app: opentelemetry + component: otel-collector + spec: + containers: + - command: + - "/otelcol" + - "--config=/conf/otel-collector-config.yaml" +# Memory Ballast size should be max 1/3 to 1/2 of memory. + - "--mem-ballast-size-mib=683" + env: + - name: GOGC + value: "80" + image: otel/opentelemetry-collector-dev:latest + name: otel-collector + resources: + limits: + cpu: 1 + memory: 2Gi + requests: + cpu: 200m + memory: 400Mi + ports: + - containerPort: 55680 # Default endpoint for otlp receiver. + - containerPort: 8888 # Default endpoint for querying metrics. + volumeMounts: + - name: otel-collector-config-vol + mountPath: /conf +# - name: otel-collector-secrets +# mountPath: /secrets + livenessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + readinessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + volumes: + - configMap: + name: otel-collector-conf + items: + - key: otel-collector-config + path: otel-collector-config.yaml + name: otel-collector-config-vol +# - secret: +# name: otel-collector-secrets +# items: +# - key: cert.pem +# path: cert.pem +# - key: key.pem +# path: key.pem \ No newline at end of file