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

[CHORE] adding eBPF helm chart #855

Merged
merged 13 commits into from
Nov 20, 2023
37 changes: 37 additions & 0 deletions .github/workflows/ebpf-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test eBPF Chart

on:
pull_request:
paths:
- "charts/opentelemetry-ebpf/**"
branches:
- main

jobs:
ebpf-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
with:
create-kind-cluster: "true"

- name: Run chart-testing (install)
run: ct install --charts charts/opentelemetry-ebpf

- name: Run daemonset and deployment install test
run: |
kubectl apply -f ./charts/opentelemetry-collector/examples/daemonset-and-deployment/rendered

kubectl rollout status deployment example-opentelemetry-collector --timeout=30s

kubectl apply -f ./charts/opentelemetry-ebpf/examples/cloud-collector/rendered

kubectl rollout status daemonset example-opentelemetry-ebpf-kernel-collector --timeout=30s
kubectl rollout status deployment example-opentelemetry-ebpf-cloud-collector --timeout=30s
kubectl rollout status deployment example-opentelemetry-ebpf-k8s-collector --timeout=30s
kubectl rollout status deployment example-opentelemetry-ebpf-reducer --timeout=30s
nicolastakashi marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TMP_DIRECTORY = ./tmp
CHARTS ?= opentelemetry-collector opentelemetry-operator opentelemetry-demo
CHARTS ?= opentelemetry-collector opentelemetry-operator opentelemetry-demo opentelemetry-ebpf

.PHONY: generate-examples
generate-examples:
Expand Down
23 changes: 23 additions & 0 deletions charts/opentelemetry-ebpf/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
12 changes: 12 additions & 0 deletions charts/opentelemetry-ebpf/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OpenTelemetry eBPF Chart Contributing Guide

All changes to the chart require a bump to the version in `chart.yaml`. See the [Contributing Guide](https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/CONTRIBUTING.md#versioning) for our versioning requirements.

Once the chart version is bumped, the examples must be regenerated. You can regenerate examples by running `make generate-examples CHARTS=opentelemetry-ebpf`.

## Bumping Default Collector Version

1. Increase the minor version of the chart by one and set the patch version to zero.
2. Update the chart's `appVersion` to match the new collector version. This version will be used as the image tag by default.
3. Review the corresponding release notes in [Opentelemetry eBPF](https://github.com/open-telemetry/opentelemetry-ebpf/releases). If any changes affect the helm charts, adjust the helm chart accordingly.
4. Run `make generate-examples CHARTS=opentelemetry-ebpf`.
14 changes: 14 additions & 0 deletions charts/opentelemetry-ebpf/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v2
name: opentelemetry-ebpf
version: 0.1.0
description: OpenTelemetry eBPF Helm chart for Kubernetes
type: application
home: https://opentelemetry.io/
sources:
- https://github.com/open-telemetry/opentelemetry-ebpf
maintainers:
- name: dmitryax
nicolastakashi marked this conversation as resolved.
Show resolved Hide resolved
- name: TylerHelmuth
nicolastakashi marked this conversation as resolved.
Show resolved Hide resolved
- name: nicolastakashi
icon: https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png
appVersion: v0.10.0
30 changes: 30 additions & 0 deletions charts/opentelemetry-ebpf/README.md
nicolastakashi marked this conversation as resolved.
Show resolved Hide resolved
nicolastakashi marked this conversation as resolved.
Show resolved Hide resolved
nicolastakashi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# OpenTelemetry Collector eBPF Helm Chart

The helm chart installs [OpenTelemetry eBPF](https://github.com/open-telemetry/opentelemetry-ebpf)
in kubernetes cluster.

## Prerequisites

- Kubernetes 1.24+
- Helm 3.9+

## Installing the Chart

Add OpenTelemetry Helm repository:

```console
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
```

To install the chart with the release name my-opentelemetry-ebpf, run the following command:

```console
helm install my-opentelemetry-ebpf open-telemetry/opentelemetry-ebpf
```

### Other configuration options

The [values.yaml](./values.yaml) file contains information about all other configuration
options for this chart.

For more examples see [Examples](examples).
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# Source: opentelemetry-ebpf/templates/cloud-collector-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-opentelemetry-ebpf-cloud-collector
labels:
helm.sh/chart: opentelemetry-ebpf-0.1.0
app.kubernetes.io/name: opentelemetry-ebpf
app.kubernetes.io/instance: example
app.kubernetes.io/version: "v0.10.0"
app.kubernetes.io/managed-by: Helm
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/name: example-opentelemetry-ebpf-cloud-collector
app.kubernetes.io/instance: example
strategy:
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: example-opentelemetry-ebpf-cloud-collector
app.kubernetes.io/instance: example
spec:
containers:
- name: cloud-collector
image: "otel/opentelemetry-ebpf-cloud-collector:v0.10.0"
imagePullPolicy: IfNotPresent
args:
- --warning
env:
- name: "EBPF_NET_CLUSTER_NAME"
value: ""
- name: "EBPF_NET_INTAKE_HOST"
value: example-opentelemetry-ebpf-reducer
- name: "EBPF_NET_INTAKE_PORT"
value: "7000"
terminationGracePeriodSeconds: 30
securityContext: {}
serviceAccountName: example-opentelemetry-ebpf-cloud-collector
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Source: opentelemetry-ebpf/templates/cloud-collector-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: example-opentelemetry-ebpf-cloud-collector
labels:
helm.sh/chart: opentelemetry-ebpf-0.1.0
app.kubernetes.io/name: opentelemetry-ebpf
app.kubernetes.io/instance: example
app.kubernetes.io/version: "v0.10.0"
app.kubernetes.io/managed-by: Helm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# Source: opentelemetry-ebpf/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: example-opentelemetry-ebpf-config
labels:
helm.sh/chart: opentelemetry-ebpf-0.1.0
app.kubernetes.io/name: opentelemetry-ebpf
app.kubernetes.io/instance: example
app.kubernetes.io/version: "v0.10.0"
app.kubernetes.io/managed-by: Helm
data:
config.yaml: |
labels:
environment: ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# Source: opentelemetry-ebpf/templates/k8s-collector-clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: example-opentelemetry-ebpf-k8s-collector
labels:
helm.sh/chart: opentelemetry-ebpf-0.1.0
app.kubernetes.io/name: opentelemetry-ebpf
app.kubernetes.io/instance: example
app.kubernetes.io/version: "v0.10.0"
app.kubernetes.io/managed-by: Helm
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- replicasets
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# Source: opentelemetry-ebpf/templates/k8s-collector-clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: example-opentelemetry-ebpf-k8s-collector
labels:
helm.sh/chart: opentelemetry-ebpf-0.1.0
app.kubernetes.io/name: opentelemetry-ebpf
app.kubernetes.io/instance: example
app.kubernetes.io/version: "v0.10.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: example-opentelemetry-ebpf-k8s-collector
subjects:
- kind: ServiceAccount
name: example-opentelemetry-ebpf-k8s-collector
namespace: default
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
# Source: opentelemetry-ebpf/templates/k8s-collector-deployment.yaml
# The k8s-collector consists of two services:
# 1) k8s-watcher: talks to the Kubernetes API server to determine the current state of
# the cluster; sets up watches to be notified of subsequent changes to pods, services
# and other resources.
# 2) k8s-relay: relays the information collected by k8s-watcher to the reducer.
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-opentelemetry-ebpf-k8s-collector
labels:
helm.sh/chart: opentelemetry-ebpf-0.1.0
app.kubernetes.io/name: opentelemetry-ebpf
app.kubernetes.io/instance: example
app.kubernetes.io/version: "v0.10.0"
app.kubernetes.io/managed-by: Helm
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app.kubernetes.io/name: example-opentelemetry-ebpf-k8s-collector
app.kubernetes.io/instance: example
strategy:
type: RollingUpdate
template:
metadata:
annotations:
# This is here to allow us to do "zero-downtime" updates without an image change.
rollingUpdateVersion: "1"
charts.flowmill.com/version: 0.1.0
labels:
app.kubernetes.io/name: example-opentelemetry-ebpf-k8s-collector
app.kubernetes.io/instance: example
spec:
containers:
- name: k8s-watcher
image: "otel/opentelemetry-ebpf-k8s-watcher:v0.10.0"
imagePullPolicy: IfNotPresent
args:
- --log-console
- --log-level=warning
# k8s-relay, which is a service that the k8s-watcher talks to.
# Currently not configurable, has to be reachable on localhost:8172, so must
# share a pod with the k8s-watcher above.
- name: k8s-relay
image: "otel/opentelemetry-ebpf-k8s-relay:v0.10.0"
imagePullPolicy: IfNotPresent
args:
- --config-file=/etc/network-explorer/config.yaml
- --warning
env:
- name: "EBPF_NET_CLUSTER_NAME"
value: ""
- name: "EBPF_NET_INTAKE_HOST"
value: example-opentelemetry-ebpf-reducer
- name: "EBPF_NET_INTAKE_PORT"
value: "7000"
volumeMounts:
- mountPath: /etc/network-explorer
name: k8s-relay-config
terminationGracePeriodSeconds: 30
volumes:
- name: k8s-relay-config
projected:
sources:
- configMap:
name: example-opentelemetry-ebpf-config
items:
- key: config.yaml
path: config.yaml
securityContext: {}
serviceAccountName: example-opentelemetry-ebpf-k8s-collector
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Source: opentelemetry-ebpf/templates/k8s-collector-serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: example-opentelemetry-ebpf-k8s-collector
labels:
helm.sh/chart: opentelemetry-ebpf-0.1.0
app.kubernetes.io/name: opentelemetry-ebpf
app.kubernetes.io/instance: example
app.kubernetes.io/version: "v0.10.0"
app.kubernetes.io/managed-by: Helm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# Source: opentelemetry-ebpf/templates/kernel-collector-clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: example-opentelemetry-ebpf-kernel-collector
labels:
helm.sh/chart: opentelemetry-ebpf-0.1.0
app.kubernetes.io/name: opentelemetry-ebpf
app.kubernetes.io/instance: example
app.kubernetes.io/version: "v0.10.0"
app.kubernetes.io/managed-by: Helm
rules:
- apiGroups:
- policy
resourceNames:
- example-opentelemetry-ebpf-kernel-collector
resources:
- podsecuritypolicies
verbs:
- use
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# Source: opentelemetry-ebpf/templates/kernel-collector-clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: example-opentelemetry-ebpf-kernel-collector
labels:
helm.sh/chart: opentelemetry-ebpf-0.1.0
app.kubernetes.io/name: opentelemetry-ebpf
app.kubernetes.io/instance: example
app.kubernetes.io/version: "v0.10.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: example-opentelemetry-ebpf-kernel-collector
subjects:
- kind: ServiceAccount
name: example-opentelemetry-ebpf-kernel-collector
namespace: default
Loading