GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add support for deploying pulsar as standalone by smbecker · Pull Request #674 · apache/pulsar-helm-chart

Conversation

@smbecker

@smbecker smbecker commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Motivation

We occasionally have uses for a much smaller footprint when installing Pulsar and being able to leverage the same Helm chart simplifies the installation scripts.

Modifications

This adds the ability to enable standalone mode on the helm chart that deploy Pulsar in standalone mode rather than splitting each of the components out. Most of the files in this PR are to disable the individual components when standalone is enabled.

I also had to add set -euo pipefail when creating the Kind cluster. I found that when running chart_test.sh locally and port 5000 was already blocked, creating the kind cluster would fail but not terminate the test. This resulting in attempting to run the test against a different kubernetes cluster.

Verifying this change

  • Make sure that the change passes the CI checks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
smbecker added 3 commits April 22, 2026 10:34
@smbecker
Add support for deploying pulsar as standalone
b7882b2
@smbecker
Adjust timeout and standalone readiness check in CI test
77e79c6
@smbecker
Remove standalone.functionsWorker and standalone.streamStorage settin…
f60aef0
…gs in favor of components.functions
@lhotari

lhotari commented Apr 22, 2026

Copy link
Copy Markdown
Member

Review assisted by Claude (Opus 4.7). Flagging structural concerns and a few smaller issues — feel free to push back on any of them.

Thanks for putting this together — the component-suppression approach is clean and the CI coverage is a nice touch. I have one structural concern and a few smaller issues worth addressing before merge.

1. Use a Deployment instead of a StatefulSet for standalone

Pulsar standalone embeds ZooKeeper + BookKeeper + Broker in one JVM. There's no sharding, no quorum, no peer gossip — scaling it beyond 1 produces N isolated Pulsar "clusters" with the same identity contending for the same ClusterIP and (on RWO PVC) the same volume.

StatefulSet gives you three things, none of which help here:

Feature Value for standalone
Stable per-pod DNS (pod-0.headless…) Irrelevant — one pod. Service DNS is enough.
OrderedReady rolling updates Meaningless at replicas: 1.
volumeClaimTemplates Trivially replaced by a plain PVC.

Costs it imposes:

  • Footgun. standalone.replicaCount is exposed with no enforcement. A user who sets 2 gets a silently broken deployment.
  • Immutable fields. serviceName, selector, volumeClaimTemplates, podManagementPolicy are all immutable — upgrades that touch them require deleting the workload.
  • Extra surface area. Headless service, ${HOSTNAME}.headless… advertised-address plumbing, OrderedReady all exist only because it's a StatefulSet.

Suggested replacement:

apiVersion: apps/v1
kind: Deployment
spec:
  replicas: 1                 # hardcoded; drop standalone.replicaCount from values.yaml
  strategy:
    type: Recreate            # releases RWO PVC before the new pod starts
  template:
    spec:
      hostname: standalone    # together with subdomain, makes hostname -f resolvable
      subdomain: "{{ template \"pulsar.standalone.service.headless\" . }}"
      containers:
        - args:
            - |
              ...
              # --advertised-address is REQUIRED: Pulsar no longer defaults this to
              # FQDN after apache/pulsar#25523 reverted apache/pulsar#25238. Without
              # it, client lookups return a non-resolvable address.
              exec bin/pulsar standalone --advertised-address "$(hostname -f)" ...
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    helm.sh/resource-policy: keep   # preserve data on helm uninstall
spec:
  accessModes: [ReadWriteOnce]
  resources: { requests: { storage: "{{ .Values.standalone.volumes.data.size }}" } }

Benefits: no replicaCount footgun, no immutable-field upgrade pain, PVC retention is explicit, and the model matches what standalone actually is — a single-pod app.

If keeping StatefulSet is preferred for chart consistency, at minimum: hardcode replicas: 1 (or fail on replicaCount > 1) and drop podManagementPolicy: OrderedReady.

2. --advertised-address is now mandatory — please comment why

apache/pulsar#25238 made standalone default its advertised address to the FQDN, but apache/pulsar#25523 reverted that with no replacement. Pulsar standalone will no longer derive an advertisable address on its own — omitting --advertised-address causes client lookups to return a non-resolvable hostname/IP and connections fail.

The PR correctly passes it, but the current helper:

{{- define "pulsar.standalone.hostname" -}}
${HOSTNAME}.{{ template "pulsar.standalone.service.headless" . }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}
{{- end -}}

…is exactly what hostname -f returns inside a pod with a headless serviceName/subdomain. Simplify and, critically, leave a comment so a future reader doesn't "clean up" the flag:

# --advertised-address is REQUIRED: Pulsar no longer defaults this to FQDN
# after apache/pulsar#25523 reverted apache/pulsar#25238. Without it,
# client lookups return a non-resolvable address and connections fail.
--advertised-address "$(hostname -f)"

3. Don't force-disable the proxy when standalone is enabled

Every proxy-*.yaml gained (not .Values.standalone.enabled), which hard-disables Pulsar Proxy whenever standalone is on. That's overly restrictive — Proxy in front of standalone is a valid and useful topology (TLS termination at the edge, single stable ingress endpoint, not exposing broker listeners directly).

toolset-configmap.yaml already demonstrates the right pattern:

{{- if .Values.standalone.enabled }}
  webServiceUrl: "http://{{ template "pulsar.standalone.service" . }}:..."
  brokerServiceUrl: "pulsar://{{ template "pulsar.standalone.service" . }}:..."
{{- else if ... }}

Please:

  1. Drop (not .Values.standalone.enabled) from the proxy templates — keep the gate on .Values.components.proxy only.
  2. Mirror the toolset pattern in proxy-configmap.yaml: when standalone.enabled, point brokerServiceURL / brokerWebServiceURL (+ TLS variants) at the standalone service.
  3. Re-check proxy RBAC / service-account guards so they come along.
  4. Show the combination in examples/values-standalone.yaml with a commented components.proxy: true block.

Also avoids the silent regression where flipping standalone.enabled: true makes an existing components.proxy: true simply disappear from the rendered manifest.

Smaller issues

  • tls.standalone.cert_name defaults to tls-proxy (values.yaml) — collides with the proxy cert name and becomes a real clash if Publish chart index to gh-pages branch #3 above is adopted. Change to tls-standalone.
  • Plain HTTP leaks with TLS enabled. standalone-service.yaml always publishes port 8080, and standalone-configmap.yaml only sets PULSAR_PREFIX_webServicePortTls / PULSAR_PREFIX_brokerServicePortTls — it doesn't null the non-TLS webServicePort / brokerServicePort. Both listeners end up active. Either set PULSAR_PREFIX_webServicePort: "" / PULSAR_PREFIX_brokerServicePort: "" when TLS is on, or gate the Service ports on tls.enabled (the way the broker templates do).
  • Functions + standalone has no RBAC. broker-rbac.yaml is gated on not .Values.standalone.enabled, but the standalone start script enables the functions worker when components.functions: true. The K8s runtime will hit RBAC failures. Either emit the functions RBAC bound to the standalone SA in that combination, or fail on it.
  • CI --timeout bump applies globally. .ci/helm.sh raises the install timeout from 6m → 10m for every job, not just standalone. If standalone specifically needs more time, scope the bump; otherwise document why the blanket increase is needed.
  • set -euo pipefail in kind-cluster-build.sh is a good drive-by fix but unrelated — worth calling out in the PR body (already done — thanks).

Happy to look at a follow-up commit once you've had a chance to triage these.

smbecker reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@smbecker
Code review feedback
12a3918
@smbecker

smbecker commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review. The latest commit should cover all of the items. One thing to call out, I followed the broker's pattern (keep non-TLS webServicePort open for metrics/prometheus, clear only the Pulsar wire-protocol listener) rather than clearing both because the podMonitor/prometheus.io/port scrape is still HTTP.

lhotari reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@smbecker
Fix proxy initContainers when standalone is enabled
d6fc35d
@smbecker

smbecker commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

I saw that the tests failed once proxy to re-enabled. The wait-for-* hooks in the initContainers were still relying on the presence of zookeeper and broker. I pushed a fix and verified that the tests pass (at least locally).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lhotari
lhotari reviewed Apr 24, 2026
View reviewed changes
Comment thread examples/values-standalone.yaml Resolved

Uh oh!

There was an error while loading. Please reload this page.

lhotari
lhotari reviewed Apr 24, 2026
View reviewed changes
Comment thread charts/pulsar/templates/standalone-configmap.yaml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@lhotari
lhotari merged commit f18d020 into apache:master Apr 24, 2026
39 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@lhotari

lhotari commented Apr 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

One detail that I noticed after merging is that it could be beneficial to default to PULSAR_STANDALONE_USE_ZOOKEEPER: "1" in the configmap for standalone. The default metadata store is RocksDB for Pulsar standalone. The benefit of using Zookeeper (embedded in Pulsar standalone) is that it would be easier to perform a migration from a standalone cluster to an ordinary cluster when using Zookeeper for the metadata store.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@smbecker
smbecker deleted the sb-standalone branch April 24, 2026 14:48
@smbecker smbecker mentioned this pull request Apr 24, 2026
Update standalone defaults to use zookeeper #675
Merged
1 task
@smbecker

smbecker commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Added #675 to address the default.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lhotari lhotari lhotari left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@smbecker @lhotari
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.