Skip to content

Commit

Permalink
[elastic] customize for elasticsearch workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ty Bekiares authored and ty-elastic committed Nov 21, 2022
1 parent e322c86 commit d91ce4e
Show file tree
Hide file tree
Showing 14 changed files with 188 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ runs:
- name: Add Dependencies
shell: bash
run: |
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo add open-telemetry https://ty-elastic.github.io/opentelemetry-helm-charts
helm repo add prometheus https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
44 changes: 44 additions & 0 deletions .github/workflows/collector-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release Collector Charts

on:
push:
branches:
- ty-elastic/elastic

jobs:
collector-release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/[email protected]
with:
version: v3.4.1

- name: Remove File
uses: JesseTG/[email protected]
with:
path: charts/opentelemetry-demo

- name: Remove File
uses: JesseTG/[email protected]
with:
path: charts/opentelemetry-operator

- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
48 changes: 48 additions & 0 deletions .github/workflows/demo-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release Demo Charts

on:
push:
branches:
- ty-elastic/elastic

jobs:
demo-release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/[email protected]
with:
version: v3.4.1

- name: Add dependent repositories
run: |
helm repo add open-telemetry https://ty-elastic.github.io/opentelemetry-helm-charts
- name: Remove File
uses: JesseTG/[email protected]
with:
path: charts/opentelemetry-collector

- name: Remove File
uses: JesseTG/[email protected]
with:
path: charts/opentelemetry-operator

- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Lint Charts
on:
pull_request:
branches:
- main
- ty-elastic/elastic

jobs:
lint-test:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: Release Charts
on:
push:
branches:
- main
- ty-elastic/elastic

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -26,7 +28,7 @@ jobs:

- name: Add dependent repositories
run: |
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo add open-telemetry https://ty-elastic.github.io/opentelemetry-helm-charts
helm repo add prometheus https://prometheus-community.github.io/helm-charts
helm repo add grafana https://grafana.github.io/helm-charts
Expand Down
3 changes: 3 additions & 0 deletions charts/opentelemetry-collector/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rm -rf opentelemetry-collector-0.38.2.tgz
helm package .
curl -L --data-binary "@opentelemetry-collector-0.38.2.tgz" http://localhost:8080/api/charts
9 changes: 3 additions & 6 deletions charts/opentelemetry-collector/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ receivers:
processors:
k8sattributes:
passthrough: false
filter:
node_from_env_var: OTEL_K8S_NODE_NAME
pod_association:
- sources:
- from: resource_attribute
Expand All @@ -298,12 +300,7 @@ processors:
- from: connection
extract:
metadata:
- "k8s.namespace.name"
- "k8s.deployment.name"
- "k8s.statefulset.name"
- "k8s.daemonset.name"
- "k8s.cronjob.name"
- "k8s.job.name"
- "container.id"
{{- end }}
{{/* Build the list of port for deployment service */}}
Expand Down
9 changes: 9 additions & 0 deletions charts/opentelemetry-collector/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ containers:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: OTEL_K8S_NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: OTEL_K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
{{- if .Values.presets.hostMetrics.enabled }}
- name: HOST_PROC
value: /hostfs/proc
Expand Down
12 changes: 0 additions & 12 deletions charts/opentelemetry-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,9 @@ config:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
prometheus:
config:
scrape_configs:
- job_name: opentelemetry-collector
scrape_interval: 10s
static_configs:
- targets:
- ${MY_POD_IP}:8888
zipkin:
endpoint: 0.0.0.0:9411
service:
telemetry:
metrics:
address: 0.0.0.0:8888
extensions:
- health_check
- memory_ballast
Expand All @@ -119,7 +108,6 @@ config:
- batch
receivers:
- otlp
- prometheus
traces:
exporters:
- logging
Expand Down
2 changes: 1 addition & 1 deletion charts/opentelemetry-demo/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: opentelemetry-collector
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
repository: https://ty-elastic.github.io/opentelemetry-helm-charts
version: 0.39.1
- name: prometheus
repository: https://prometheus-community.github.io/helm-charts
Expand Down
4 changes: 2 additions & 2 deletions charts/opentelemetry-demo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: 0.12.3
description: opentelemetry demo helm chart
home: https://opentelemetry.io/
sources:
- https://github.com/open-telemetry/opentelemetry-demo
- https://github.com/ty-elastic/opentelemetry-helm-charts
maintainers:
- name: dmitryax
- name: puckpuck
Expand All @@ -15,7 +15,7 @@ appVersion: "1.1.0"
dependencies:
- name: opentelemetry-collector
version: 0.39.1
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
repository: https://ty-elastic.github.io/opentelemetry-helm-charts
condition: observability.otelcol.enabled
- name: prometheus
version: 15.16.1
Expand Down
4 changes: 4 additions & 0 deletions charts/opentelemetry-demo/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
helm dependency update
rm -rf opentelemetry-demo-0.11.1.tgz
helm package .
curl -L --data-binary "@opentelemetry-demo-0.11.1.tgz" http://localhost:8080/api/charts
Loading

0 comments on commit d91ce4e

Please sign in to comment.