Skip to content

About

Helm chart for deploying Weir on Kubernetes, with Prometheus alerts and a Grafana dashboard.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Weir Helm charts

CI License: MIT

Helm chart that deploys Weir, a synchronous MongoDB and Search data plane, on Kubernetes.

Overview

Terms

Term Meaning
Store A named backend connection, declared in stores.
Search Elasticsearch or OpenSearch.
Store group One Helm release. A group can host several Stores and is released and scaled independently.
Replica One Pod running one Weir process. Every replica of a group hosts the same Stores. Replicas share nothing.

Responsibilities

Provided by Items
The chart Deployment, headless Service, ConfigMap, NetworkPolicy. Optional: metrics Service, ServiceMonitor, PrometheusRule, Grafana dashboard, PodDisruptionBudget, KEDA ScaledObject.
You Backends, collections, indices, credentials and backups.

Pinned versions

Item Version
Chart 0.23.0
Server source v0.4.2, commit 727f6003c4e0
Server image ghcr.io/batchstream/weir@sha256:885f052ba31943409a99b442ca74aa02a75665e439f98887684fcd2568c1ce05
Go SDK weir-go v0.24.1

Chart.yaml records the server source and values.yaml pins the image. Both the validation and release workflows install that exact source with go install.

Requirements

Item Requirement
Helm 3.17 or later. CI tests 3.17.0.
Kubernetes 1.30 or later
Cluster capacity Each Pod requests and limits 2 CPU and 3 GiB by default. A rollout runs one extra Pod.
MongoDB A nonsharded replica set with the client bulkWrite command (MongoDB 8.0 or later).
Search Elasticsearch or OpenSearch.
Collections and indices Must exist before typed reads and mutations.
Network The application port uses plaintext HTTP/2. Use an isolated network and a CNI that enforces NetworkPolicy.
Optional Prometheus Operator for monitoring. KEDA for autoscaling.
Development Go 1.27.4 and Python 3, to run the chart tests.

Quick start

This installs one Store group with one MongoDB Store in the namespace application.

Step 1. Get the chart.

git clone https://github.com/batchstream/weir-charts.git
cd weir-charts

Step 2. Check examples/mongo.yaml. It expects MongoDB in the namespace application, with its primary at mongo:27017 on Pods labeled app: mongo, and no authentication. Edit the file if yours differ. For authentication, see Credentials.

stores:
- name: mongo
  mongodb:
    uri: mongodb://mongo:27017/?directConnection=true
networkPolicy:
  egress:
  - to:
    - podSelector:
        matchLabels:
          app: mongo
    ports:
    - protocol: TCP
      port: 27017

This example uses MongoDB direct mode, which has no failover. For production, use a replica-set URI. See MongoDB connection modes.

Step 3. Install the release. Replace your-context with your cluster context.

helm upgrade --install mongo ./charts/weir --namespace application \
  --kube-context your-context -f examples/mongo.yaml --atomic --wait --timeout 5m

Helm reports STATUS: deployed and prints the SDK address. With --atomic, Helm removes a failed install after the timeout. Omit --atomic to keep the Pods for inspection.

Step 4. Allow your client Pods to connect. They must run in the same namespace and carry this label on the Pod template.

spec:
  template:
    metadata:
      labels:
        weir-client: "true"

Step 5. Connect with the SDK, using the address that Helm prints. Keep the trailing dot.

client, err := weir.New("mongo-weir.application.svc.cluster.local.:7447")

To try it, run the program from the Go SDK quick start in that Pod with this address. The program uses the collection weir_example.records, which must exist first.

Documentation

Guide Contents
Configuration Store groups, client connections, generated configuration and credentials
Monitoring Metrics, labels, alerts and the Grafana dashboard
Autoscaling KEDA and Prometheus setup
Operations Network, rolling updates, capacity, shutdown and probes
Development Chart tests, the rollout test and releases
Example Shows
mongo.yaml A group with a MongoDB Store
search.yaml A group with a Search Store
credential-files.yaml Backend credentials from a mounted Secret
three-replicas.yaml Three replicas spread across nodes. Update its selector for your release.
prometheus-alerts.yaml ServiceMonitor, alerts and dashboard
prometheus-autoscaling.yaml KEDA autoscaling on Weir's own CPU

Development

python3 -m venv .venv
.venv/bin/pip install -r requirements-dev.txt
GOBIN="$PWD/.bin" go install github.com/batchstream/weir/cmd/weir@SOURCE_REVISION
make test PYTHON=.venv/bin/python WEIR_BIN="$PWD/.bin/weir"

SOURCE_REVISION is the weir.batchstream.io/source-revision annotation in Chart.yaml. See Development for packaging and the rollout test.

Related repositories

Repository Purpose
weir Server
weir-go Go client SDK
weir-protocol Public gRPC schema and validation
weir-charts Helm chart (this repository)
weir-tests System tests and benchmarks

License

MIT. See LICENSE.

About

Helm chart for deploying Weir on Kubernetes, with Prometheus alerts and a Grafana dashboard.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages