Skip to content

Commit

Permalink
feat(nats): Implement NATS eventbus (#122)
Browse files Browse the repository at this point in the history
* Deploy postgres to minikube for testing

* Add nats event bus

* Replace ingress test case w/ nats, which includes ingress

* set test max connections and get postgres logs

* make sure max con is more than default max concurrency

* skip waiting for postgres pod

* bring back the sleep

* use fqdn

* revert indent change

* fix nats service annotation indent

* remove extra space

* dedicated nats cluster

* use only headless svc

* use headless service for clients

* do not publish not ready pods for client service

* Revert min ready seconds

* Remove secret key

* revert postgres resources

* revert matrix

* NATS resources block

* fix nats secret key

* dump chart version

* reduce resources in test

* Use healthchecks inspired by NATS helm chart, query the nats http port

* configure startup probe to allow for NATS 60 second client connect timmeout

* fix indent

* fix chart version

* fix readme version
  • Loading branch information
jsirianni authored Jul 12, 2024
1 parent 02ef24f commit 74130a1
Show file tree
Hide file tree
Showing 9 changed files with 536 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- "ingress"
- "volume"
- "pubsub"
- "postgres"
- "nats"
k8s_version:
- v1.25.0
- v1.27.0
Expand Down
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.11.9
version: 1.12.0
# The BindPlane OP tagged release. If the user does not
# set the `image.tag` values option, this version is used.
appVersion: 1.63.1
Expand Down
8 changes: 6 additions & 2 deletions charts/bindplane/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bindplane

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

BindPlane OP is an observability pipeline.

Expand Down Expand Up @@ -105,7 +105,7 @@ BindPlane OP is an observability pipeline.
| extraVolumes | list | `[]` | Optional arbitrary volumes to add to the BindPlane pod(s). |
| health.livenessProbe | object | `{"httpGet":{"path":"/health","port":"http"}}` | Full configuration for livenessProbe. Supports all options documented here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/. |
| health.readinessProbe | object | `{"httpGet":{"path":"/health","port":"http"}}` | Full configuration for readinessProbe. Supports all options documented here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/. |
| health.startupProbe | object | `{"httpGet":{"path":"/health","port":"http"}}` | Full configuration for startupProbe. Supports all options documented here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/. |
| health.startupProbe | object | `{"failureThreshold":20,"httpGet":{"path":"/health","port":"http"},"initialDelaySeconds":0,"periodSeconds":5,"successThreshold":1,"timeoutSeconds":1}` | Full configuration for startupProbe. Supports all options documented here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/. |
| image.name | string | `""` | Image name to be used. Defaults to `ghcr.io/observiq/bindplane-ee`. |
| image.tag | string | `""` | Image tag to use. Defaults to the version defined in the Chart's release. |
| ingress.annotations | object | `{}` | Custom annotations which will be added to the ingress object. Useful for specifying things such as `cert-manager.io/cluster-issuer`. |
Expand All @@ -118,6 +118,10 @@ 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.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`. |
| nats.resources.requests.memory | string | `"1000Mi"` | Memory request for the NATs server pods, when event bus type is `nats`. |
| podSecurityContext | object | `{"fsGroup":65534}` | The Pod spec's securityContext: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod. |
| prometheus.auth.password | string | `""` | Prometheus basic authentication password. |
| prometheus.auth.type | string | `"none"` | Prometheus authentication. Supported options include `none` and `basic`. |
Expand Down
12 changes: 12 additions & 0 deletions charts/bindplane/templates/bindplane-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,18 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if eq .Values.eventbus.type "nats" }}
- name: BINDPLANE_EVENT_BUS_TYPE
value: nats
- name: BINDPLANE_NATS_CLIENT_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: BINDPLANE_NATS_CLIENT_ENDPOINT
value: nats://{{ include "bindplane.fullname" . }}-nats-client-headless.{{ .Release.Namespace }}.svc.cluster.local:4222
- name: BINDPLANE_NATS_CLIENT_SUBJECT
value: bindplane-event-bus
{{- end }}
{{- if eq (include "bindplane.auth.type" .) "ldap" }}
- name: BINDPLANE_AUTH_TYPE
value: {{ .Values.auth.type }}
Expand Down
Loading

0 comments on commit 74130a1

Please sign in to comment.