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 committed Nov 9, 2022
1 parent d065b6b commit 94d72c9
Show file tree
Hide file tree
Showing 13 changed files with 193 additions and 144 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.37.1.tgz
helm package .
curl -L --data-binary "@opentelemetry-collector-0.37.1.tgz" http://localhost:8080/api/charts
3 changes: 3 additions & 0 deletions charts/opentelemetry-collector/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ receivers:
processors:
k8sattributes:
passthrough: false
filter:
node_from_env_var: OTEL_K8S_NODE_NAME
pod_association:
- sources:
- from: resource_attribute
Expand All @@ -298,6 +300,7 @@ processors:
- "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
14 changes: 4 additions & 10 deletions charts/opentelemetry-demo/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
dependencies:
- name: opentelemetry-collector
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
version: 0.38.0
- name: prometheus
repository: https://prometheus-community.github.io/helm-charts
version: 15.16.1
- name: grafana
repository: https://grafana.github.io/helm-charts
version: 6.42.2
digest: sha256:a053cc4c963d0e1e305a9719832073e000adfd2eccec3107e921067414e68c8a
generated: "2022-11-01T22:54:12.017808-04:00"
repository: https://ty-elastic.github.io/opentelemetry-helm-charts
version: 0.38.2
digest: sha256:ce682595c33367d9e36f80d67ae356a1b53c3a4746737e67131a6829fe3a100f
generated: "2022-11-09T10:55:24.552684-06:00"
16 changes: 4 additions & 12 deletions charts/opentelemetry-demo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: 0.11.1
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 @@ -14,14 +14,6 @@ icon: https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png
appVersion: "1.0.0"
dependencies:
- name: opentelemetry-collector
version: 0.38.0
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
condition: observability.otelcol.enabled
- name: prometheus
version: 15.16.1
repository: https://prometheus-community.github.io/helm-charts
condition: observability.prometheus.enabled
- name: grafana
version: 6.42.2
repository: https://grafana.github.io/helm-charts
condition: observability.grafana.enabled
version: 0.38.2
repository: https://ty-elastic.github.io/opentelemetry-helm-charts
condition: observability.otelcol.enabled
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 94d72c9

Please sign in to comment.