From 9955ee6642a266a3b95dd3c0bd635b7fd8bb51ba Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Fri, 19 Apr 2024 11:08:20 +0200 Subject: [PATCH 1/9] Grafana Beyla helm chart Signed-off-by: Mario Macias --- charts/beyla/.helmignore | 24 ++ charts/beyla/Chart.yaml | 14 ++ charts/beyla/README.md | 64 ++++++ charts/beyla/templates/_helpers.tpl | 95 ++++++++ .../beyla/templates/cluster-role-binding.yaml | 20 ++ charts/beyla/templates/cluster-role.yaml | 26 +++ charts/beyla/templates/configmap.yaml | 32 +++ charts/beyla/templates/daemon-set.yml | 86 ++++++++ charts/beyla/templates/service.yaml | 58 +++++ charts/beyla/templates/serviceaccount.yaml | 17 ++ charts/beyla/values.yaml | 205 ++++++++++++++++++ 11 files changed, 641 insertions(+) create mode 100644 charts/beyla/.helmignore create mode 100644 charts/beyla/Chart.yaml create mode 100644 charts/beyla/README.md create mode 100644 charts/beyla/templates/_helpers.tpl create mode 100644 charts/beyla/templates/cluster-role-binding.yaml create mode 100644 charts/beyla/templates/cluster-role.yaml create mode 100644 charts/beyla/templates/configmap.yaml create mode 100644 charts/beyla/templates/daemon-set.yml create mode 100644 charts/beyla/templates/service.yaml create mode 100644 charts/beyla/templates/serviceaccount.yaml create mode 100644 charts/beyla/values.yaml diff --git a/charts/beyla/.helmignore b/charts/beyla/.helmignore new file mode 100644 index 0000000000..63cec64363 --- /dev/null +++ b/charts/beyla/.helmignore @@ -0,0 +1,24 @@ +# 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/ +.github diff --git a/charts/beyla/Chart.yaml b/charts/beyla/Chart.yaml new file mode 100644 index 0000000000..65a178bd7e --- /dev/null +++ b/charts/beyla/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +name: beyla +version: 1.0.0 +appVersion: 1.5.0 +description: eBPF-based autoinstrumentation HTTP, HTTP2 and gRPC services, as well as network metrics. +home: https://grafana.com/oss/beyla-ebpf/ +icon: https://grafana.com/static/img/logos/beyla-logo.svg +sources: + - https://github.com/grafana/beyla +type: application +keywords: + - observability + - autoinstrumentation + - eBPF-based \ No newline at end of file diff --git a/charts/beyla/README.md b/charts/beyla/README.md new file mode 100644 index 0000000000..f43191318a --- /dev/null +++ b/charts/beyla/README.md @@ -0,0 +1,64 @@ +# beyla + +![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.0](https://img.shields.io/badge/AppVersion-1.5.0-informational?style=flat-square) + +eBPF-based autoinstrumentation HTTP, HTTP2 and gRPC services, as well as network metrics. + +**Homepage:** + +## Source Code + +* + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | used for scheduling of pods based on affinity rules | +| config.create | bool | `true` | set to true, to use the below default configurations | +| config.data | object | `{"attributes":{"kubernetes":{"enable":true}},"prometheus_export":{"path":"/metrics","port":9090}}` | default value of beyla configuration | +| config.name | string | `""` | | +| env | object | `{}` | extra environment variables | +| envValueFrom | object | `{}` | extra environment variables to be set from resources such as k8s configMaps/secrets | +| fullnameOverride | string | `""` | Overrides the chart's computed fullname. | +| global.image.pullSecrets | list | `[]` | Optional set of global image pull secrets. | +| global.image.registry | string | `""` | Global image registry to use if it needs to be overridden for some specific use cases (e.g local registries, custom images, ...) | +| image.digest | string | `nil` | Beyla image's SHA256 digest (either in format "sha256:XYZ" or "XYZ"). When set, will override `image.tag`. | +| image.pullPolicy | string | `"IfNotPresent"` | Beyla image pull policy. | +| image.pullSecrets | list | `[]` | Optional set of image pull secrets. | +| image.registry | string | `"docker.io"` | Beyla image registry (defaults to docker.io) | +| image.repository | string | `"grafana/beyla"` | Beyla image repository. | +| image.tag | string | `nil` | Beyla image tag. When empty, the Chart's appVersion is used. | +| nameOverride | string | `""` | Overrides the chart's name | +| namespaceOverride | string | `""` | Override the deployment namespace | +| nodeSelector | object | `{}` | The nodeSelector field allows user to constrain which nodes your DaemonSet pods are scheduled to based on labels on the node | +| podAnnotations | object | `{}` | Adds custom annotations to the Beyla Pods. | +| podLabels | object | `{}` | Adds custom labels to the Beyla Pods. | +| podSecurityContext | object | `{}` | | +| preset | string | `"application"` | Preconfigures some default properties for network or application observability. Accepted values are "network" or "application". | +| rbac.create | bool | `true` | Whether to create RBAC resources for Belya | +| rbac.extraClusterRoleRules | list | `[]` | Extra custer roles to be created for Belya | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.annotations | object | `{}` | Service annotations. | +| service.appProtocol | string | `""` | Adds the appProtocol field to the service. This allows to work with istio protocol selection. Ex: "http" or "tcp" | +| service.clusterIP | string | `""` | cluster IP | +| service.enabled | bool | `false` | whether to create a service for internal metrics | +| service.labels | object | `{}` | Service labels. | +| service.loadBalancerClass | string | `""` | loadbalancer class name | +| service.loadBalancerIP | string | `""` | loadbalancer IP | +| service.loadBalancerSourceRanges | list | `[]` | source ranges for loadbalancer | +| service.port | int | `80` | service port | +| service.portName | string | `"service"` | name of the port for internal metrics service. | +| service.targetPort | int | `9090` | targetPort has to be configured based on the values of `BEYLA_INTERNAL_METRICS_PROMETHEUS_PORT` environment variable or the value of `prometheus_export.port` from beyla configuration file. see more at https://grafana.com/docs/beyla/latest/configure/options/#internal-metrics-reporter | +| service.type | string | `"ClusterIP"` | type of the service | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.labels | object | `{}` | ServiceAccount labels. | +| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | +| tolerations | list | `[]` | Tolerations allow pods to be scheduled on nodes with specific taints | +| updateStrategy.type | string | `"RollingUpdate"` | update strategy type | +| volumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition. | +| volumes | list | `[]` | Additional volumes on the output daemonset definition. | + diff --git a/charts/beyla/templates/_helpers.tpl b/charts/beyla/templates/_helpers.tpl new file mode 100644 index 0000000000..d35c4bf804 --- /dev/null +++ b/charts/beyla/templates/_helpers.tpl @@ -0,0 +1,95 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "beyla.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "beyla.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Allow the release namespace to be overridden for multi-namespace deployments in combined charts +*/}} +{{- define "beyla.namespace" -}} +{{- if .Values.namespaceOverride }} +{{- .Values.namespaceOverride }} +{{- else }} +{{- .Release.Namespace }} +{{- end }} +{{- end }} + + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "beyla.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "beyla.labels" -}} +helm.sh/chart: {{ include "beyla.chart" . }} +{{ include "beyla.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector (pod) labels +*/}} +{{- define "beyla.selectorLabels" -}} +app.kubernetes.io/name: {{ include "beyla.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- with .Values.podLabels }} +{{ toYaml . }} +{{- end }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "beyla.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "beyla.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + + +{{/* +Calculate name of image ID to use for "beyla". +*/}} +{{- define "beyla.imageId" -}} +{{- if .Values.image.digest }} +{{- $digest := .Values.image.digest }} +{{- if not (hasPrefix "sha256:" $digest) }} +{{- $digest = printf "sha256:%s" $digest }} +{{- end }} +{{- printf "@%s" $digest }} +{{- else if .Values.image.tag }} +{{- printf ":%s" .Values.image.tag }} +{{- else }} +{{- printf ":%s" .Chart.AppVersion }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/beyla/templates/cluster-role-binding.yaml b/charts/beyla/templates/cluster-role-binding.yaml new file mode 100644 index 0000000000..41ada6d012 --- /dev/null +++ b/charts/beyla/templates/cluster-role-binding.yaml @@ -0,0 +1,20 @@ +{{- if .Values.rbac.create }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "beyla.fullname" . }} + labels: + {{- include "beyla.labels" . | nindent 4 }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +subjects: + - kind: ServiceAccount + name: {{ include "beyla.serviceAccountName" . }} + namespace: {{ include "beyla.namespace" .}} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "beyla.fullname" . }} +{{- end }} diff --git a/charts/beyla/templates/cluster-role.yaml b/charts/beyla/templates/cluster-role.yaml new file mode 100644 index 0000000000..0c573e78cd --- /dev/null +++ b/charts/beyla/templates/cluster-role.yaml @@ -0,0 +1,26 @@ +{{- if .Values.rbac.create }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "beyla.fullname" . }} + labels: + {{- include "beyla.labels" . | nindent 4 }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +rules: + - apiGroups: [ "apps" ] + resources: [ "replicasets" ] + verbs: [ "list", "watch" ] + - apiGroups: [ "" ] + {{- if eq .Values.preset "network" }} + resources: [ "pods", "services", "nodes" ] + {{- else }} + resources: [ "pods" ] + {{- end }} + verbs: [ "list", "watch" ] + {{- with .Values.rbac.extraClusterRoleRules }} + {{- toYaml . | nindent 2 }} + {{- end}} +{{- end }} diff --git a/charts/beyla/templates/configmap.yaml b/charts/beyla/templates/configmap.yaml new file mode 100644 index 0000000000..c7e9439727 --- /dev/null +++ b/charts/beyla/templates/configmap.yaml @@ -0,0 +1,32 @@ +{{- if and (not .Values.config.create) (eq .Values.config.name "") }} + {{- fail "if .Values.config.name is not set, then .Values.config.create should be set to true to use default configuration" }} +{{- end }} +{{- if and (.Values.config.create) (eq .Values.config.name "") }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "beyla.fullname" . }} + namespace: {{ include "beyla.namespace" . }} + labels: + {{- include "beyla.labels" . | nindent 4 }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +data: + beyla-config.yml: | + {{- if eq .Values.preset "network" }} + {{- if not .Values.config.data.network }} + network: + enable: true + {{- end }} + {{- end }} + {{- if eq .Values.preset "application" }} + {{- if not .Values.config.data.discovery }} + discovery: + services: + - k8s_namespace: . + {{- end }} + {{- end }} + {{- toYaml .Values.config.data | nindent 4}} +{{- end }} diff --git a/charts/beyla/templates/daemon-set.yml b/charts/beyla/templates/daemon-set.yml new file mode 100644 index 0000000000..02bea3dd2f --- /dev/null +++ b/charts/beyla/templates/daemon-set.yml @@ -0,0 +1,86 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ include "beyla.fullname" . }} + namespace: {{ include "beyla.namespace" .}} + labels: + {{- include "beyla.labels" . | nindent 4 }} + {{- with .Values.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: +{{ include "beyla.selectorLabels" . | indent 6 }} + {{- with .Values.updateStrategy }} + updateStrategy: + {{- toYaml . | trim | nindent 4 }} + {{- end }} + template: + metadata: + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: +{{ include "beyla.selectorLabels" . | indent 8 }} + spec: + {{- if .Values.serviceAccount.create }} + serviceAccountName: {{ include "beyla.serviceAccountName" . }} + {{- end }} + {{- if eq .Values.preset "application" }} + hostPID: true + {{- end }} + {{- if eq .Values.preset "network" }} + hostNetwork: true + {{- end }} + containers: + - name: beyla + image: {{ .Values.global.image.registry | default .Values.image.registry }}/{{ .Values.image.repository }}{{ include "beyla.imageId" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + securityContext: + privileged: true + ports: + - containerPort: {{ .Values.service.targetPort }} + protocol: TCP + env: + - name: BEYLA_CONFIG_PATH + value: "/etc/beyla/config/beyla-config.yml" + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: "{{ $value }}" + {{- end }} + {{- range $key, $value := .Values.envValueFrom }} + - name: {{ $key | quote }} + valueFrom: + {{- tpl (toYaml $value) $ | nindent 16 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- tpl (toYaml .) $ | nindent 12 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 12 }} + {{- end }} + volumeMounts: + - mountPath: /etc/beyla/config + name: beyla-config + {{- if or .Values.global.image.pullSecrets .Values.image.pullSecrets }} + imagePullSecrets: + {{- if .Values.global.image.pullSecrets }} + {{- toYaml .Values.global.image.pullSecrets | nindent 4 }} + {{- else }} + {{- toYaml .Values.image.pullSecrets | nindent 4 }} + {{- end }} + {{- end }} + volumes: + - name: beyla-config + configMap: + name: {{ default (include "beyla.fullname" .) .Values.config.name }} \ No newline at end of file diff --git a/charts/beyla/templates/service.yaml b/charts/beyla/templates/service.yaml new file mode 100644 index 0000000000..a3e252068c --- /dev/null +++ b/charts/beyla/templates/service.yaml @@ -0,0 +1,58 @@ +{{- if .Values.service.enabled }} +{{- $root := . }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "beyla.fullname" . }} + namespace: {{ include "beyla.namespace" .}} + labels: + {{- include "beyla.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.service.annotations }} + annotations: + {{- tpl (toYaml . | nindent 4) $root }} + {{- end }} +spec: + {{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }} + type: ClusterIP + {{- with .Values.service.clusterIP }} + clusterIP: {{ . }} + {{- end }} + {{- else if eq .Values.service.type "LoadBalancer" }} + type: LoadBalancer + {{- with .Values.service.loadBalancerIP }} + loadBalancerIP: {{ . }} + {{- end }} + {{- with .Values.service.loadBalancerClass }} + loadBalancerClass: {{ . }} + {{- end }} + {{- with .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- else }} + type: {{ .Values.service.type }} + {{- end }} + {{- with .Values.service.externalIPs }} + externalIPs: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.service.externalTrafficPolicy }} + externalTrafficPolicy: {{ . }} + {{- end }} + ports: + - name: {{ .Values.service.portName }} + port: {{ .Values.service.port }} + protocol: TCP + targetPort: {{ .Values.service.targetPort }} + {{- with .Values.service.appProtocol }} + appProtocol: {{ . }} + {{- end }} + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} + selector: + {{- include "beyla.selectorLabels" . | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/charts/beyla/templates/serviceaccount.yaml b/charts/beyla/templates/serviceaccount.yaml new file mode 100644 index 0000000000..54c876a29b --- /dev/null +++ b/charts/beyla/templates/serviceaccount.yaml @@ -0,0 +1,17 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "beyla.serviceAccountName" . }} + namespace: {{ include "beyla.namespace" .}} + labels: + {{- include "beyla.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/charts/beyla/values.yaml b/charts/beyla/values.yaml new file mode 100644 index 0000000000..dbab3bc5ff --- /dev/null +++ b/charts/beyla/values.yaml @@ -0,0 +1,205 @@ +## Global properties for image pulling override the values defined under `image.registry`. +## If you want to override only one image registry, use the specific fields but if you want to override them all, use `global.image.registry` +global: + image: + # -- Global image registry to use if it needs to be overridden for some specific use cases (e.g local registries, custom images, ...) + registry: "" + + # -- Optional set of global image pull secrets. + pullSecrets: [] + +image: + # -- Beyla image registry (defaults to docker.io) + registry: "docker.io" + # -- Beyla image repository. + repository: grafana/beyla + # -- (string) Beyla image tag. When empty, the Chart's appVersion is + # used. + tag: null + # -- Beyla image's SHA256 digest (either in format "sha256:XYZ" or "XYZ"). When set, will override `image.tag`. + digest: null + # -- Beyla image pull policy. + pullPolicy: IfNotPresent + # -- Optional set of image pull secrets. + pullSecrets: [] + +# -- Overrides the chart's name +nameOverride: "" + +# -- Overrides the chart's computed fullname. +fullnameOverride: "" + +# -- Override the deployment namespace +namespaceOverride: "" + +## DaemonSet annotations +# annotations: {} + +rbac: + # -- Whether to create RBAC resources for Belya + create: true + # -- Extra custer roles to be created for Belya + extraClusterRoleRules: [] + # - apiGroups: [] + # resources: [] + +serviceAccount: + # -- Specifies whether a service account should be created + create: true + # -- Automatically mount a ServiceAccount's API credentials? + automount: true + # -- ServiceAccount labels. + labels: {} + # -- Annotations to add to the service account + annotations: {} + # -- The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +## -- Expose the beyla internal metrics service to be accessed from outside the cluster (LoadBalancer service). +## or access it from within the cluster (ClusterIP service). Set the service type and the port to serve it. +## ref: http://kubernetes.io/docs/user-guide/services/ +## +service: + # -- whether to create a service for internal metrics + enabled: false + # -- type of the service + type: ClusterIP + # -- cluster IP + clusterIP: "" + # -- loadbalancer IP + loadBalancerIP: "" + # -- loadbalancer class name + loadBalancerClass: "" + # -- source ranges for loadbalancer + loadBalancerSourceRanges: [] + # -- service port + port: 80 + # -- targetPort has to be configured based on the values of `BEYLA_INTERNAL_METRICS_PROMETHEUS_PORT` environment variable + # or the value of `prometheus_export.port` from beyla configuration file. + # see more at https://grafana.com/docs/beyla/latest/configure/options/#internal-metrics-reporter + targetPort: 9090 + # -- Service annotations. + annotations: {} + # -- Service labels. + labels: {} + # -- name of the port for internal metrics service. + portName: service + # -- Adds the appProtocol field to the service. This allows to work with istio protocol selection. Ex: "http" or "tcp" + appProtocol: "" + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + + +## -- See `kubectl explain daemonset.spec.updateStrategy` for more +## ref: https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#daemonset-update-strategy +updateStrategy: + # -- update strategy type + type: RollingUpdate + + +# -- Additional volumes on the output daemonset definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# -- Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +# -- The nodeSelector field allows user to constrain which nodes your DaemonSet pods are scheduled to based on labels on the node +nodeSelector: {} + +# -- Tolerations allow pods to be scheduled on nodes with specific taints +tolerations: [] + +# -- used for scheduling of pods based on affinity rules +affinity: {} + +# -- Adds custom annotations to the Beyla Pods. +podAnnotations: {} + +# -- Adds custom labels to the Beyla Pods. +podLabels: {} + +## More configuration options available at https://grafana.com/docs/beyla/latest/configure/options/ +## The below default configuration +## 1. looks for ALL the services in the host +## 2. export metrics as prometheus metrics by default at 9090 port +## 3. enables kubernetes attribute +## Note: The default configuration is used if config.create=true and config.name="" +config: + # -- set to true, to use the below default configurations + create: true + ## -- Provide the name of the external configmap containing the beyla configuration. + ## To create configmap from configuration file, user can use the below command. Note: The name 'beyla-config.yaml' is important. + ## `kubectl create cm --from-file=beyla-config.yaml= -n ` + ## If empty, default configuration below is used. + name: "" + # -- default value of beyla configuration + data: + # open_port: 8443 + # routes: + # unmatched: heuristic + # log_level: info + # otel_traces_export: + # endpoint: http://grafana-agent:4318 + ## or alternatively use + # grafana: + # otlp: + # cloud_zone: prod-eu-west-0 + # cloud_instance_id: 123456 + # cloud_api_key: + attributes: + kubernetes: + enable: true + ## internal metrics reporting. Refer: https://grafana.com/docs/beyla/latest/configure/options/#internal-metrics-reporter + ## If set, user can expose the metrics endpoint via k8s service by configuring .Values.service section + prometheus_export: + port: 9090 + path: /metrics + +## Env variables that will override configmap values +## For example: +## BEYLA_INTERNAL_METRICS_PROMETHEUS_PORT: 9090 +# -- extra environment variables +env: {} + #BEYLA_INTERNAL_METRICS_PROMETHEUS_PORT: 9090 + #BEYLA_PRINT_TRACES: "true" + +# -- extra environment variables to be set from resources such as k8s configMaps/secrets +envValueFrom: {} + # ENV_NAME: + # secretKeyRef: + # name: secret-name + # key: value_key + +# -- Preconfigures some default properties for network or application observability. +# Accepted values are "network" or "application". +preset: application \ No newline at end of file From 024bb8f7fd3c3c445d133d85b6650d945ac4c108 Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Fri, 19 Apr 2024 11:13:44 +0200 Subject: [PATCH 2/9] Fixed helm-docs Signed-off-by: Mario Macias --- charts/beyla/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/beyla/README.md b/charts/beyla/README.md index f43191318a..90079db634 100644 --- a/charts/beyla/README.md +++ b/charts/beyla/README.md @@ -62,3 +62,5 @@ eBPF-based autoinstrumentation HTTP, HTTP2 and gRPC services, as well as network | volumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition. | | volumes | list | `[]` | Additional volumes on the output daemonset definition. | +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.8.1](https://github.com/norwoodj/helm-docs/releases/v1.8.1) From 60defdaeb202a13eda0f78f83b307534c0ca7ea1 Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Fri, 19 Apr 2024 11:16:34 +0200 Subject: [PATCH 3/9] Adding newlines at the end of files Signed-off-by: Mario Macias --- charts/beyla/Chart.yaml | 2 +- charts/beyla/templates/_helpers.tpl | 2 +- charts/beyla/templates/daemon-set.yml | 2 +- charts/beyla/templates/service.yaml | 2 +- charts/beyla/values.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/beyla/Chart.yaml b/charts/beyla/Chart.yaml index 65a178bd7e..fec451b04e 100644 --- a/charts/beyla/Chart.yaml +++ b/charts/beyla/Chart.yaml @@ -11,4 +11,4 @@ type: application keywords: - observability - autoinstrumentation - - eBPF-based \ No newline at end of file + - eBPF-based diff --git a/charts/beyla/templates/_helpers.tpl b/charts/beyla/templates/_helpers.tpl index d35c4bf804..93a2f52085 100644 --- a/charts/beyla/templates/_helpers.tpl +++ b/charts/beyla/templates/_helpers.tpl @@ -92,4 +92,4 @@ Calculate name of image ID to use for "beyla". {{- else }} {{- printf ":%s" .Chart.AppVersion }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/beyla/templates/daemon-set.yml b/charts/beyla/templates/daemon-set.yml index 02bea3dd2f..dbad1b9772 100644 --- a/charts/beyla/templates/daemon-set.yml +++ b/charts/beyla/templates/daemon-set.yml @@ -83,4 +83,4 @@ spec: volumes: - name: beyla-config configMap: - name: {{ default (include "beyla.fullname" .) .Values.config.name }} \ No newline at end of file + name: {{ default (include "beyla.fullname" .) .Values.config.name }} diff --git a/charts/beyla/templates/service.yaml b/charts/beyla/templates/service.yaml index a3e252068c..05a10cf1db 100644 --- a/charts/beyla/templates/service.yaml +++ b/charts/beyla/templates/service.yaml @@ -55,4 +55,4 @@ spec: {{- end }} selector: {{- include "beyla.selectorLabels" . | nindent 4 }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/beyla/values.yaml b/charts/beyla/values.yaml index dbab3bc5ff..c0caf50e75 100644 --- a/charts/beyla/values.yaml +++ b/charts/beyla/values.yaml @@ -202,4 +202,4 @@ envValueFrom: {} # -- Preconfigures some default properties for network or application observability. # Accepted values are "network" or "application". -preset: application \ No newline at end of file +preset: application From 9ec50f85b3ce945b64655d8e20c55b3e6ecf5364 Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Fri, 19 Apr 2024 11:21:19 +0200 Subject: [PATCH 4/9] try to do linter happy Signed-off-by: Mario Macias --- charts/beyla/templates/_helpers.tpl | 2 -- charts/beyla/values.yaml | 4 ---- 2 files changed, 6 deletions(-) diff --git a/charts/beyla/templates/_helpers.tpl b/charts/beyla/templates/_helpers.tpl index 93a2f52085..d0cb9e9018 100644 --- a/charts/beyla/templates/_helpers.tpl +++ b/charts/beyla/templates/_helpers.tpl @@ -34,7 +34,6 @@ Allow the release namespace to be overridden for multi-namespace deployments in {{- end }} {{- end }} - {{/* Create chart name and version as used by the chart label. */}} @@ -76,7 +75,6 @@ Create the name of the service account to use {{- end }} {{- end }} - {{/* Calculate name of image ID to use for "beyla". */}} diff --git a/charts/beyla/values.yaml b/charts/beyla/values.yaml index c0caf50e75..d5b8d762d9 100644 --- a/charts/beyla/values.yaml +++ b/charts/beyla/values.yaml @@ -4,7 +4,6 @@ global: image: # -- Global image registry to use if it needs to be overridden for some specific use cases (e.g local registries, custom images, ...) registry: "" - # -- Optional set of global image pull secrets. pullSecrets: [] @@ -111,15 +110,12 @@ resources: {} # cpu: 100m # memory: 128Mi - - ## -- See `kubectl explain daemonset.spec.updateStrategy` for more ## ref: https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#daemonset-update-strategy updateStrategy: # -- update strategy type type: RollingUpdate - # -- Additional volumes on the output daemonset definition. volumes: [] # - name: foo From 0d5c7367a700188b99f9062649bba51826280f15 Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Fri, 19 Apr 2024 11:39:41 +0200 Subject: [PATCH 5/9] linter-test happy now at least locally Signed-off-by: Mario Macias --- charts/beyla/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/beyla/values.yaml b/charts/beyla/values.yaml index d5b8d762d9..6a072b1b18 100644 --- a/charts/beyla/values.yaml +++ b/charts/beyla/values.yaml @@ -41,7 +41,7 @@ rbac: extraClusterRoleRules: [] # - apiGroups: [] # resources: [] - + serviceAccount: # -- Specifies whether a service account should be created create: true @@ -170,7 +170,7 @@ config: # grafana: # otlp: # cloud_zone: prod-eu-west-0 - # cloud_instance_id: 123456 + # cloud_instance_id: 123456 # cloud_api_key: attributes: kubernetes: @@ -186,8 +186,8 @@ config: ## BEYLA_INTERNAL_METRICS_PROMETHEUS_PORT: 9090 # -- extra environment variables env: {} - #BEYLA_INTERNAL_METRICS_PROMETHEUS_PORT: 9090 - #BEYLA_PRINT_TRACES: "true" + # BEYLA_INTERNAL_METRICS_PROMETHEUS_PORT: 9090 + # BEYLA_PRINT_TRACES: "true" # -- extra environment variables to be set from resources such as k8s configMaps/secrets envValueFrom: {} From 118f1bb24dc3731c3134f12ba4de59a3ccdc058c Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Fri, 19 Apr 2024 15:45:27 +0200 Subject: [PATCH 6/9] Fix network configuration Signed-off-by: Mario Macias --- charts/beyla/templates/cluster-role.yaml | 2 +- charts/beyla/templates/daemon-set.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/beyla/templates/cluster-role.yaml b/charts/beyla/templates/cluster-role.yaml index 0c573e78cd..cd6e1723c8 100644 --- a/charts/beyla/templates/cluster-role.yaml +++ b/charts/beyla/templates/cluster-role.yaml @@ -14,7 +14,7 @@ rules: resources: [ "replicasets" ] verbs: [ "list", "watch" ] - apiGroups: [ "" ] - {{- if eq .Values.preset "network" }} + {{- if or (eq .Values.preset "network") .Values.config.data.network }} resources: [ "pods", "services", "nodes" ] {{- else }} resources: [ "pods" ] diff --git a/charts/beyla/templates/daemon-set.yml b/charts/beyla/templates/daemon-set.yml index dbad1b9772..27be19e45e 100644 --- a/charts/beyla/templates/daemon-set.yml +++ b/charts/beyla/templates/daemon-set.yml @@ -33,7 +33,7 @@ spec: {{- if eq .Values.preset "application" }} hostPID: true {{- end }} - {{- if eq .Values.preset "network" }} + {{- if or (eq .Values.preset "network") .Values.config.data.network }} hostNetwork: true {{- end }} containers: From 46bef2e01bea2ff91f7a881fa36e5f37cf0319f6 Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Mon, 22 Apr 2024 12:25:47 +0200 Subject: [PATCH 7/9] updated Beyla app version Signed-off-by: Mario Macias --- charts/beyla/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/beyla/Chart.yaml b/charts/beyla/Chart.yaml index fec451b04e..ca870e1662 100644 --- a/charts/beyla/Chart.yaml +++ b/charts/beyla/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: beyla version: 1.0.0 -appVersion: 1.5.0 +appVersion: 1.5.1 description: eBPF-based autoinstrumentation HTTP, HTTP2 and gRPC services, as well as network metrics. home: https://grafana.com/oss/beyla-ebpf/ icon: https://grafana.com/static/img/logos/beyla-logo.svg From eade888c352f7b2c49f5f1f66b60655ad0efbc5a Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Mon, 22 Apr 2024 12:38:22 +0200 Subject: [PATCH 8/9] fixed helm docs Signed-off-by: Mario Macias --- charts/beyla/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/beyla/README.md b/charts/beyla/README.md index 90079db634..4cbfd459fe 100644 --- a/charts/beyla/README.md +++ b/charts/beyla/README.md @@ -1,6 +1,6 @@ # beyla -![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.0](https://img.shields.io/badge/AppVersion-1.5.0-informational?style=flat-square) +![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.1](https://img.shields.io/badge/AppVersion-1.5.1-informational?style=flat-square) eBPF-based autoinstrumentation HTTP, HTTP2 and gRPC services, as well as network metrics. From ce85a08e59e789859fe977f40a31be34c3ab67db Mon Sep 17 00:00:00 2001 From: Mario Macias Date: Tue, 23 Apr 2024 16:55:31 +0200 Subject: [PATCH 9/9] Update beyla version Signed-off-by: Mario Macias --- charts/beyla/Chart.yaml | 2 +- charts/beyla/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/beyla/Chart.yaml b/charts/beyla/Chart.yaml index ca870e1662..8d3132395d 100644 --- a/charts/beyla/Chart.yaml +++ b/charts/beyla/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: beyla version: 1.0.0 -appVersion: 1.5.1 +appVersion: 1.5.2 description: eBPF-based autoinstrumentation HTTP, HTTP2 and gRPC services, as well as network metrics. home: https://grafana.com/oss/beyla-ebpf/ icon: https://grafana.com/static/img/logos/beyla-logo.svg diff --git a/charts/beyla/README.md b/charts/beyla/README.md index 4cbfd459fe..172a327a8b 100644 --- a/charts/beyla/README.md +++ b/charts/beyla/README.md @@ -1,6 +1,6 @@ # beyla -![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.1](https://img.shields.io/badge/AppVersion-1.5.1-informational?style=flat-square) +![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5.2](https://img.shields.io/badge/AppVersion-1.5.2-informational?style=flat-square) eBPF-based autoinstrumentation HTTP, HTTP2 and gRPC services, as well as network metrics.