Skip to content

Commit e1a8ccb

Browse files
authored
test: Add OTel engine via helm chart example in kind (#5474)
<!-- CONTRIBUTORS GUIDE: https://github.com/grafana/alloy/blob/main/docs/developer/contributing.md If this is your first PR or you have not contributed in a while, we recommend taking the time to review the guide. **NOTE** Your PR title must adhere to Conventional Commit style. For details on this, check out the Contributors Guide linked above. --> ### Brief description of Pull Request Adds the ability to deploy OpenTelemetry Collector helm chart using Alloy OTel Engine in `example/kind` local k8s cluster. <!-- Add a human-readable description of the PR that may be used as the commit body (i.e. "Extended description") when it gets merged. --> ### Pull Request Details <!-- Add a more detailed descripion of the Pull Request here, if needed. --> ### Issue(s) fixed by this Pull Request <!-- Uncomment the following line and fill in an issue number if you want a GitHub issue to be closed automatically when this PR gets merged. --> <!-- Fixes #issue_id --> ### Notes to the Reviewer <!-- Add any relevant notes for the reviewers and testers of this PR. --> ### PR Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] Documentation added - [x] Tests updated - [ ] Config converters updated
1 parent e64ebb6 commit e1a8ccb

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

example/kind/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,26 @@
77
- `kubectl`
88
- `helm`
99

10+
## Usage
11+
12+
The main command to get started with is:
13+
14+
```bash
15+
task help # list all available tasks
16+
```
17+
18+
Among other things, you can create a kind cluster, deploy the local Grafana Alloy helm chart, and open k9s with the local kind cluster.
19+
20+
```bash
21+
task cluster:create # create a kind cluster
22+
task deploy:alloy-helm # deploy the local Grafana Alloy helm chart
23+
k9s --kubeconfig ./build/kubeconfig.yaml # open k9s with the local kind cluster
24+
```
25+
1026
## Setup credentials
1127

28+
This is required if you want to deploy the Grafana Cloud Onboarding helm chart or other features that connect to Grafana Cloud.
29+
1230
Create a local `.env.credentials` from the provided template and fill in your values. This file is gitignored and is automatically loaded by Task via `dotenv` in `Taskfile.yml`.
1331

1432
```bash

example/kind/Taskfile.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ tasks:
6262
--set "grafanaCloud.fleetManagement.url={{.REMOTE_CFG_URL}}"
6363
--wait
6464

65+
deploy:otelcol:
66+
desc: Deploy OpenTelemetry Collector helm chart using Alloy OTel Engine
67+
deps: [cluster:create, update-helm-repos]
68+
vars:
69+
OTELCOL_VALUES_FILE: '{{.OTELCOL_VALUES_FILE | default "config/otelcol-helm/values.yaml"}}'
70+
preconditions:
71+
- test -f {{.OTELCOL_VALUES_FILE}}
72+
cmds:
73+
- helm --kubeconfig {{.KUBECONFIG}} upgrade --install otelcol
74+
-n monitoring --create-namespace
75+
open-telemetry/opentelemetry-collector
76+
-f {{.OTELCOL_VALUES_FILE}}
77+
--wait
78+
6579
remove:cloud-onboarding:local:
6680
desc: Remove Grafana Cloud Onboarding helm chart
6781
deps: [update-helm-repos]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
image:
2+
repository: grafana/alloy-dev
3+
tag: v1.13.2-devel-5bf4dcf # TODO: update to v1.14 once it's released
4+
5+
command:
6+
name: "bin/otelcol"
7+
8+
mode: deployment

0 commit comments

Comments
 (0)