Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

feat: refresh chart to use latest connect version #108

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: benthos
description: Benthos Helm chart for Kubernetes
name: connect
description: Redpanda Connect Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -21,4 +21,4 @@ version: 2.2.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "4.24.0"
appVersion: "4.38.0"
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# benthos-helm-chart
# Redpanda Connect Helm Chart Specification
<p align="center" style="text-align: center">
<img src="./assets/blob.png" width="30%"><br/>
Benthos Helm Chart. <br/>
Redpanda Connect Helm Chart. <br/>
</p>

Benthos is a high performance and resilient stream processor, able to connect various sources and sinks in a range of brokering patterns and perform hydration, enrichments, transformations and filters on payloads.
Redpanda Connect is a high performance and resilient stream processor, able to connect various sources and sinks in a range of brokering patterns and perform hydration, enrichments, transformations and filters on payloads.

This Helm Chart deploys a single Benthos instance in either streams mode or standalone.
This Helm Chart deploys a single Redpanda Connect instance in either streams mode or standalone.

## Installation
```bash
helm repo add benthos https://benthosdev.github.io/charts/
helm repo add redpanda https://benthosdev.github.io/charts/
mihaitodor marked this conversation as resolved.
Show resolved Hide resolved
helm repo update

helm install benthos/benthos
helm install redpanda/connect
```

## Configuration

The config parameter should contain the configuration as it would be parsed by the Benthos binary.
The config parameter should contain the configuration as it would be parsed by the Redpanda Connect binary.
```yaml
# values.yaml
config:
input:
label: "no_config_in"
generate:
mapping: root = "This Benthos instance is unconfigured!"
mapping: root = "This Redpanda Connect instance is unconfigured!"
interval: 1m
output:
label: "no_config_out"
stdout:
codec: lines
```

The full list of [available configuration for the Helm Chart can be found in the `values.yaml` file](./values.yaml). You should refer to the [upstream Benthos documentation](https://www.benthos.dev/docs/configuration/about) for the configuration of your pipeline.
The full list of [available configuration for the Helm Chart can be found in the `values.yaml` file](./values.yaml). You should refer to the [upstream Redpanda Connect documentation](https://docs.redpanda.com/redpanda-connect/configuration/about/) for the configuration of your pipeline.

## Streams mode

When running Benthos in [streams mode](https://www.benthos.dev/docs/guides/streams_mode/about), all individual stream configuration files should be combined and placed in a single Kubernetes `ConfigMap`, like so:
When running Redpanda Connect in [streams mode](https://docs.redpanda.com/redpanda-connect/guides/streams_mode/about/), all individual stream configuration files should be combined and placed in a single Kubernetes `ConfigMap`, like so:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: benthos-streams
name: connect-streams
data:
hello.yaml: |
input:
Expand All @@ -70,16 +70,16 @@ Then you can simply reference your `ConfigMap` and enable streams mode in your `
# values.yaml
streams:
enabled: true
streamsConfigMap: "benthos-streams"
streamsConfigMap: "connect-streams"
```

Currently the streams mode `ConfigMap` should be applied **separately from and before installation of** the helm chart; support for deploying additional `ConfigMap`'s within the chart may be implemented later.

### Global Configuration

When deploying Benthos in streams mode, you may want to configure global tracing, logging and http configuration which is shared across all of your pipelines.
When deploying Redpanda Connect in streams mode, you may want to configure global tracing, logging and http configuration which is shared across all of your pipelines.

This can be done by specifying configuration under the `metrics`, `logger` and `tracing` configuration sections in your `values.yaml` file. These all use their respective upstream Benthos configuration syntax.
This can be done by specifying configuration under the `metrics`, `logger` and `tracing` configuration sections in your `values.yaml` file. These all use their respective upstream Redpanda Connect configuration syntax.

```yaml
metrics:
Expand All @@ -94,5 +94,5 @@ tracing:
logger:
level: INFO
static_fields:
'@service': benthos
'@service': redpanda-connect
```
8 changes: 4 additions & 4 deletions templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "benthos.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "redpanda-connect.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "benthos.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "benthos.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "redpanda-connect.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "redpanda-connect.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "benthos.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "redpanda-connect.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
Expand Down
26 changes: 13 additions & 13 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "benthos.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- define "redpanda-connect.name" -}}
{{- default "redpanda-connect" .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 "benthos.fullname" -}}
{{- define "redpanda-connect.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- $name := default "redpanda-connect" .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "benthos.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- define "redpanda-connect.chart" -}}
{{- printf "%s-%s" "redpanda-connect" .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "benthos.labels" -}}
helm.sh/chart: {{ include "benthos.chart" . }}
{{ include "benthos.selectorLabels" . }}
{{- define "redpanda-connect.labels" -}}
helm.sh/chart: {{ include "redpanda-connect.chart" . }}
{{ include "redpanda-connect.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -48,17 +48,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "benthos.selectorLabels" -}}
app.kubernetes.io/name: {{ include "benthos.name" . }}
{{- define "redpanda-connect.selectorLabels" -}}
app.kubernetes.io/name: {{ include "redpanda-connect.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "benthos.serviceAccountName" -}}
{{- define "redpanda-connect.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "benthos.fullname" .) .Values.serviceAccount.name }}
{{- default (include "redpanda-connect.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
12 changes: 6 additions & 6 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "benthos.fullname" . }}-config
name: {{ template "redpanda-connect.fullname" . }}-config
namespace: {{ .Release.Namespace }}
labels:
{{- include "benthos.labels" . | nindent 4 }}
{{- include "redpanda-connect.labels" . | nindent 4 }}
data:
benthos.yaml: |
redpanda-connect.yaml: |
{{- with .Values.logger }}
logger:
{{- toYaml . | nindent 6}}
{{- toYaml . | nindent 6}}
{{- end }}
{{- with .Values.metrics }}
metrics:
{{- toYaml . | nindent 6}}
{{- toYaml . | nindent 6}}
{{- end }}
{{- with .Values.tracing }}
tracer:
Expand All @@ -38,7 +38,7 @@ data:
input:
label: "no_config_in"
generate:
mapping: root = "This Benthos instance is unconfigured!"
mapping: root = "This Redpanda Connect instance is unconfigured!"
interval: 1m
output:
label: "no_config_out"
Expand Down
18 changes: 9 additions & 9 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "benthos.fullname" . }}
name: {{ include "redpanda-connect.fullname" . }}
labels:
{{- include "benthos.labels" . | nindent 4 }}
{{- include "redpanda-connect.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.deployment.annotations | nindent 4 }}
spec:
Expand All @@ -12,7 +12,7 @@ spec:
{{- end }}
selector:
matchLabels:
{{- include "benthos.selectorLabels" . | nindent 6 }}
{{- include "redpanda-connect.selectorLabels" . | nindent 6 }}
{{- with .Values.updateStrategy }}
strategy:
{{- toYaml . | nindent 4 }}
Expand All @@ -27,7 +27,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "benthos.selectorLabels" . | nindent 8 }}
{{- include "redpanda-connect.selectorLabels" . | nindent 8 }}
{{- with .Values.deployment.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -36,7 +36,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "benthos.serviceAccountName" . }}
serviceAccountName: {{ include "redpanda-connect.serviceAccountName" . }}
restartPolicy: {{ .Values.deployment.restartPolicy }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
Expand All @@ -61,7 +61,7 @@ spec:
{{- else }}
args:
- "-c"
- "/benthos.yaml"
- "/redpanda-connect.yaml"
{{- if eq .Values.watch true}}
- -w
{{- end }}
Expand Down Expand Up @@ -99,8 +99,8 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: "/benthos.yaml"
subPath: "benthos.yaml"
mountPath: "/redpanda-connect.yaml"
subPath: "redpanda-connect.yaml"
readOnly: true
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
Expand Down Expand Up @@ -129,7 +129,7 @@ spec:
volumes:
- name: config
configMap:
name: {{ template "benthos.fullname" . }}-config
name: {{ template "redpanda-connect.fullname" . }}-config
{{- if .Values.extraVolumes }}
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "benthos.fullname" . }}
name: {{ include "redpanda-connect.fullname" . }}
labels:
{{- include "benthos.labels" . | nindent 4 }}
{{- include "redpanda-connect.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "benthos.fullname" . }}
name: {{ include "redpanda-connect.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
{{- with .Values.autoscaling.metrics }}
Expand Down
4 changes: 2 additions & 2 deletions templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if and (.Values.http.enabled) (.Values.ingress.enabled) -}}
{{- $fullName := include "benthos.fullname" . -}}
{{- $fullName := include "redpanda-connect.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
Expand All @@ -17,7 +17,7 @@ kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "benthos.labels" . | nindent 4 }}
{{- include "redpanda-connect.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
8 changes: 4 additions & 4 deletions templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "benthos.fullname" . }}
name: {{ template "redpanda-connect.fullname" . }}
labels:
{{- include "benthos.labels" . | nindent 4 }}
{{- include "redpanda-connect.labels" . | nindent 4 }}
spec:
{{- with .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ . }}
Expand All @@ -14,5 +14,5 @@ spec:
{{- end }}
selector:
matchLabels:
{{- include "benthos.selectorLabels" . | nindent 6 }}
{{- end }}
{{- include "redpanda-connect.selectorLabels" . | nindent 6 }}
{{- end }}
6 changes: 3 additions & 3 deletions templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "benthos.fullname" . }}
name: {{ include "redpanda-connect.fullname" . }}
labels:
{{- include "benthos.labels" . | nindent 4 }}
{{- include "redpanda-connect.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -17,5 +17,5 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
{{- include "benthos.selectorLabels" . | nindent 4 }}
{{- include "redpanda-connect.selectorLabels" . | nindent 4 }}
{{- end -}}
4 changes: 2 additions & 2 deletions templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "benthos.serviceAccountName" . }}
name: {{ include "redpanda-connect.serviceAccountName" . }}
labels:
{{- include "benthos.labels" . | nindent 4 }}
{{- include "redpanda-connect.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
6 changes: 3 additions & 3 deletions templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "benthos.fullname" . }}
name: {{ include "redpanda-connect.fullname" . }}
labels:
{{- include "benthos.labels" . | nindent 4 }}
{{- include "redpanda-connect.labels" . | nindent 4 }}
spec:
endpoints:
- interval: {{ .Values.serviceMonitor.interval}}
Expand All @@ -24,5 +24,5 @@ spec:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "benthos.selectorLabels" . | nindent 6 }}
{{- include "redpanda-connect.selectorLabels" . | nindent 6 }}
{{- end }}
Loading