Skip to content

Commit

Permalink
[CHORE] adding eBPF helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Takashi <[email protected]>
  • Loading branch information
nicolastakashi committed Aug 17, 2023
1 parent 3cb40c3 commit 3d0070d
Show file tree
Hide file tree
Showing 37 changed files with 1,913 additions and 0 deletions.
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:
collector-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
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 @@
# Collector 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-collector`.

## 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 [Collector Core](https://github.com/open-telemetry/opentelemetry-collector/releases), [Collector Contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases), and [Collector Releases](https://github.com/open-telemetry/opentelemetry-collector-releases/releases). If any changes affect the helm charts, adjust the helm chart accordingly.
4. Run `make generate-examples CHARTS=opentelemetry-collector`.
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-collector
- https://github.com/open-telemetry/opentelemetry-collector-contrib
- https://github.com/open-telemetry/opentelemetry-ebpf
maintainers:
- name: dmitryax
icon: https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png
appVersion: 0.10.0
Empty file.
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: "0.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:
- image: "otel/opentelemetry-ebpf-cloud-collector:v0.10.0"
imagePullPolicy: IfNotPresent
name: cloud-collector
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: "0.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: "0.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: "0.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: "0.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: "0.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:
- image: "otel/opentelemetry-ebpf-k8s-watcher:v0.10.0"
imagePullPolicy: IfNotPresent
name: k8s-watcher
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.
- image: "otel/opentelemetry-ebpf-k8s-relay:v0.10.0"
imagePullPolicy: IfNotPresent
name: k8s-relay
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: "0.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: "0.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: "0.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

0 comments on commit 3d0070d

Please sign in to comment.