Skip to content

Commit

Permalink
feat: Optional arbitrary init containers (#192)
Browse files Browse the repository at this point in the history
* feat: Optional arbitrary init containers

* Regen docs

* fix jobs pod
  • Loading branch information
jsirianni authored Dec 17, 2024
1 parent 73278e7 commit 3f3c2a8
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/bindplane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: bindplane
description: BindPlane OP is an observability pipeline.
type: application
# The chart's version
version: 1.23.1
version: 1.24.0
# The BindPlane OP tagged release. If the user does not
# set the `image.tag` values option, this version is used.
appVersion: 1.84.0
Expand Down
3 changes: 2 additions & 1 deletion charts/bindplane/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bindplane

![Version: 1.23.1](https://img.shields.io/badge/Version-1.23.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.84.0](https://img.shields.io/badge/AppVersion-1.84.0-informational?style=flat-square)
![Version: 1.24.0](https://img.shields.io/badge/Version-1.24.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.84.0](https://img.shields.io/badge/AppVersion-1.84.0-informational?style=flat-square)

BindPlane OP is an observability pipeline.

Expand Down Expand Up @@ -97,6 +97,7 @@ BindPlane OP is an observability pipeline.
| eventbus.pubsub.topic | string | `""` | |
| eventbus.type | string | `""` | |
| extraEnv | list | `[]` | Optional arbitrary environment variables to add to the BindPlane pod(s). |
| extraInitContainers | object | `{"bindplane":[],"jobs":[],"nats":[],"prometheus":[],"transform_agent":[]}` | Optional arbitrary init containers. |
| extraPodLabels | object | `{}` | Optional arbitrary labels to add to the BindPlane pod(s). |
| extraVolumeMounts | list | `[]` | Optional arbitrary volume mounts to add to the BindPlane pod(s). |
| extraVolumes | list | `[]` | Optional arbitrary volumes to add to the BindPlane pod(s). |
Expand Down
7 changes: 5 additions & 2 deletions charts/bindplane/templates/bindplane-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ spec:
topologySpreadConstraints:
{{- toYaml .Values.topologySpreadConstraints.jobs | nindent 8 }}
{{- end }}
{{- if .Values.backend.postgres.sslsecret.name }}
initContainers:
{{- if .Values.backend.postgres.sslsecret.name }}
- name: postgres-tls
image: {{ .Values.busybox_image }}
command:
Expand Down Expand Up @@ -88,7 +88,10 @@ spec:
subPath: {{ .Values.backend.postgres.sslsecret.sslkeySubPath }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.extraInitContainers.jobs }}
{{- toYaml .Values.extraInitContainers.jobs | nindent 8 }}
{{- end }}
containers:
- name: server
image: {{ include "bindplane.image" . }}:{{ include "bindplane.tag" . }}
Expand Down
4 changes: 4 additions & 0 deletions charts/bindplane/templates/bindplane-nats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ spec:
topologySpreadConstraints:
{{- toYaml .Values.topologySpreadConstraints.nats | nindent 8 }}
{{- end }}
initContainers:
{{- if .Values.extraInitContainers.nats }}
{{- toYaml .Values.extraInitContainers.nats | nindent 8 }}
{{- end }}
containers:
- name: server
image: {{ include "bindplane.image" . }}:{{ include "bindplane.tag" . }}
Expand Down
3 changes: 3 additions & 0 deletions charts/bindplane/templates/bindplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.extraInitContainers.bindplane }}
{{- toYaml .Values.extraInitContainers.bindplane | nindent 8 }}
{{- end }}
containers:
- name: server
image: {{ include "bindplane.image" . }}:{{ include "bindplane.tag" . }}
Expand Down
4 changes: 4 additions & 0 deletions charts/bindplane/templates/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ spec:
topologySpreadConstraints:
{{- toYaml .Values.topologySpreadConstraints.prometheus | nindent 8 }}
{{- end }}
initContainers:
{{- if .Values.extraInitContainers.prometheus }}
{{- toYaml .Values.extraInitContainers.prometheus | nindent 8 }}
{{- end }}
containers:
- name: prometheus
image: {{ .Values.prometheus.image.name }}:{{ .Values.prometheus.image.tag }}
Expand Down
4 changes: 4 additions & 0 deletions charts/bindplane/templates/transform-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
{{- if .Values.extraInitContainers.transform_agent }}
{{- toYaml .Values.extraInitContainers.transform_agent | nindent 8 }}
{{- end }}
containers:
- name: transform-agent
image: {{ include "bindplane.transform_agent" . }}:{{ include "bindplane.transform_agent_tag" . }}
Expand Down
8 changes: 8 additions & 0 deletions charts/bindplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -595,3 +595,11 @@ extraEnv: []

# -- The container image to use for the busybox init container.
busybox_image: busybox:latest

# -- Optional arbitrary init containers.
extraInitContainers:
bindplane: []
nats: []
jobs: []
prometheus: []
transform_agent: []
22 changes: 22 additions & 0 deletions test/cases/nats/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,25 @@ nats:

metrics:
type: prometheus

extraInitContainers:
bindplane:
- name: busy-box-test-bindplane
image: busybox:latest
command: ['sh', '-c', 'echo hello']
nats:
- name: busy-box-test-nats
image: busybox:latest
command: ['sh', '-c', 'echo hello']
jobs:
- name: busy-box-test-jobs
image: busybox:latest
command: ['sh', '-c', 'echo hello']
prometheus:
- name: busy-box-test-prometheus
image: busybox:latest
command: ['sh', '-c', 'echo hello']
transform_agent:
- name: busy-box-test-transform-agent
image: busybox:latest
command: ['sh', '-c', 'echo hello']

0 comments on commit 3f3c2a8

Please sign in to comment.