Skip to content

Commit

Permalink
feat(nats): Support configuring NATS to run as a Deployment (#167)
Browse files Browse the repository at this point in the history
* Support configuring NATS to run as a Deployment

* bump chart version
  • Loading branch information
jsirianni authored Sep 20, 2024
1 parent fe798fb commit d59d5e4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 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.18.0
version: 1.19.0
# The BindPlane OP tagged release. If the user does not
# set the `image.tag` values option, this version is used.
appVersion: 1.73.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.18.0](https://img.shields.io/badge/Version-1.18.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.73.0](https://img.shields.io/badge/AppVersion-1.73.0-informational?style=flat-square)
![Version: 1.19.0](https://img.shields.io/badge/Version-1.19.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.73.0](https://img.shields.io/badge/AppVersion-1.73.0-informational?style=flat-square)

BindPlane OP is an observability pipeline.

Expand Down Expand Up @@ -108,6 +108,7 @@ BindPlane OP is an observability pipeline.
| jobs.resources.requests.cpu | string | `"1000m"` | CPU request. |
| jobs.resources.requests.memory | string | `"1000Mi"` | Memory request. |
| multiAccount | bool | `false` | Whether or not to enable multi account (tenant). |
| nats.deploymentType | string | `"StatefulSet"` | Deployment Type for NATs. Valid options include `StatefulSet` and `Deployment`, case sensitive. StatefulSet is recommended, and does not consume a volume mount. If your cluster is restricted to using Deployments, you can use that option instead. |
| nats.resources | object | `{"limits":{"memory":"1000Mi"},"requests":{"cpu":"1000m","memory":"1000Mi"}}` | NATs server resources request block, when event bus type is `nats`. |
| nats.resources.limits.memory | string | `"1000Mi"` | Memory limit for the NATs server pods, when event bus type is `nats`. |
| nats.resources.requests.cpu | string | `"1000m"` | CPU request for the NATs server pods, when event bus type is `nats`. |
Expand Down
9 changes: 8 additions & 1 deletion charts/bindplane/templates/bindplane-nats.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if eq .Values.eventbus.type "nats" }}
apiVersion: apps/v1
kind: StatefulSet
kind: {{ .Values.nats.deploymentType }}
metadata:
name: {{ include "bindplane.fullname" . }}-nats
namespace: {{ .Release.Namespace }}
Expand All @@ -12,8 +12,10 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: 3
{{ if eq .Values.nats.deploymentType "StatefulSet" }}
serviceName: {{ include "bindplane.fullname" . }}-nats-cluster-headless
podManagementPolicy: Parallel
{{ end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "bindplane.name" . }}
Expand Down Expand Up @@ -166,7 +168,12 @@ spec:
- name: BINDPLANE_NATS_SERVER_CLUSTER_PORT
value: "6222"
- name: BINDPLANE_NATS_SERVER_CLUSTER_ROUTES
{{ if eq .Values.nats.deploymentType "StatefulSet" }}
value: nats://{{ include "bindplane.fullname" . }}-nats-0.{{ include "bindplane.fullname" . }}-nats-cluster-headless.{{ .Release.Namespace }}.svc.cluster.local:6222,nats://{{ include "bindplane.fullname" . }}-nats-1.{{ include "bindplane.fullname" . }}-nats-cluster-headless.{{ .Release.Namespace }}.svc.cluster.local:6222,nats://{{ include "bindplane.fullname" . }}-nats-2.{{ include "bindplane.fullname" . }}-nats-cluster-headless.{{ .Release.Namespace }}.svc.cluster.local:6222
{{ end }}
{{ if eq .Values.nats.deploymentType "Deployment" }}
value: nats://{{ include "bindplane.fullname" . }}-nats-cluster-headless.{{ .Release.Namespace }}.svc.cluster.local:6222
{{ end }}
- name: BINDPLANE_NATS_CLIENT_NAME
valueFrom:
fieldRef:
Expand Down
19 changes: 19 additions & 0 deletions charts/bindplane/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"nats": {
"type": "object",
"properties": {
"deploymentType": {
"type": "string",
"enum": ["StatefulSet", "Deployment"],
"description": "The type of NATS deployment, either StatefulSet or Deployment."
}
},
"required": ["deploymentType"],
"additionalProperties": true
}
}
}

4 changes: 4 additions & 0 deletions charts/bindplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ resources:
# cpu: 1000m

nats:
# -- Deployment Type for NATs. Valid options include `StatefulSet` and `Deployment`, case sensitive.
# StatefulSet is recommended, and does not consume a volume mount. If your cluster is restricted to
# using Deployments, you can use that option instead.
deploymentType: StatefulSet
# -- NATs server resources request block, when event bus type is `nats`.
resources:
requests:
Expand Down

0 comments on commit d59d5e4

Please sign in to comment.