Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Fix helm chart agent.enabled by routing through main pulse image

rcourtmanab62b46c1f65
diff --git a/Dockerfile b/Dockerfile
index 7bac52f613..f01fb6ec3f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -331,3 +331,17 @@ RUN ln -s pulse-agent-windows-amd64.exe /opt/pulse/bin/pulse-agent-windows-amd64
ln -s pulse-agent-windows-arm64.exe /opt/pulse/bin/pulse-agent-windows-arm64 && \
ln -s pulse-agent-windows-386.exe /opt/pulse/bin/pulse-agent-windows-386 && \
chown -R pulse:pulse /opt/pulse
+
+# Arch-resolved /usr/local/bin/pulse-agent so the helm chart's agent workload
+# and `docker run rcourtman/pulse --entrypoint /usr/local/bin/pulse-agent`
+# can invoke the right unified-agent binary without juggling arch suffixes.
+# The chart's agent.enabled=true previously defaulted to a separate
+# ghcr.io/rcourtman/pulse-agent image that is no longer published; pointing it
+# at this image plus this symlink restores agent.enabled to a working state.
+RUN if [ "$TARGETARCH" = "arm64" ]; then \
+ ln -s /opt/pulse/bin/pulse-agent-linux-arm64 /usr/local/bin/pulse-agent; \
+ elif [ "$TARGETARCH" = "arm" ]; then \
+ ln -s /opt/pulse/bin/pulse-agent-linux-armv7 /usr/local/bin/pulse-agent; \
+ else \
+ ln -s /opt/pulse/bin/pulse-agent-linux-amd64 /usr/local/bin/pulse-agent; \
+ fi
diff --git a/deploy/helm/pulse/templates/agent.yaml b/deploy/helm/pulse/templates/agent.yaml
index 92a53eb3a8..c8bcffb0fd 100644
--- a/deploy/helm/pulse/templates/agent.yaml
+++ b/deploy/helm/pulse/templates/agent.yaml
@@ -44,6 +44,10 @@ spec:
- name: pulse-agent
image: "{{ .Values.agent.image.repository }}:{{ default .Chart.AppVersion .Values.agent.image.tag }}"
imagePullPolicy: {{ .Values.agent.image.pullPolicy }}
+ {{- if .Values.agent.command }}
+ command:
+ {{- toYaml .Values.agent.command | nindent 12 }}
+ {{- end }}
{{- if .Values.agent.args }}
args:
{{- toYaml .Values.agent.args | nindent 12 }}
diff --git a/deploy/helm/pulse/values.yaml b/deploy/helm/pulse/values.yaml
index d9a8f1bd66..8d66227a18 100644
--- a/deploy/helm/pulse/values.yaml
+++ b/deploy/helm/pulse/values.yaml
@@ -113,9 +113,19 @@ agent:
name: ""
annotations: {}
image:
- repository: ghcr.io/rcourtman/pulse-agent
+ # Defaults to the main Pulse image; the runtime stage now ships an arch-
+ # resolved /usr/local/bin/pulse-agent symlink so the same image can serve
+ # both server and agent workloads. The previous default
+ # (ghcr.io/rcourtman/pulse-agent) was an image that was never published.
+ repository: rcourtman/pulse
tag: ""
pullPolicy: IfNotPresent
+ # Override the main image's server ENTRYPOINT so this pod runs as a unified
+ # agent. /usr/local/bin/pulse-agent is the arch-resolved symlink baked into
+ # the runtime stage. Override `agent.command` if you ship a custom image
+ # with a different agent binary path.
+ command:
+ - /usr/local/bin/pulse-agent
env:
- name: PULSE_URL
value: http://pulse:7655
diff --git a/docs/KUBERNETES.md b/docs/KUBERNETES.md
index 0c3de61bb6..11cd7797bc 100644
--- a/docs/KUBERNETES.md
+++ b/docs/KUBERNETES.md
@@ -92,7 +92,10 @@ spec:
containers:
- name: pulse-agent
image: rcourtman/pulse:latest
- command: ["/opt/pulse/bin/pulse-agent-linux-amd64"]
+ # /usr/local/bin/pulse-agent is an arch-resolved symlink in the
+ # main Pulse image, so this manifest works on both amd64 and
+ # arm64 nodes without changes.
+ command: ["/usr/local/bin/pulse-agent"]
args:
- --enable-kubernetes
env:
diff --git a/docs/release-control/v6/internal/subsystems/deployment-installability.md b/docs/release-control/v6/internal/subsystems/deployment-installability.md
index e51f5166e7..cdbde45ff3 100644
--- a/docs/release-control/v6/internal/subsystems/deployment-installability.md
+++ b/docs/release-control/v6/internal/subsystems/deployment-installability.md
@@ -305,6 +305,18 @@ server-side update execution surfaces.
chart metadata, default values, templates, and generated chart docs must
stay on the validated release line rather than mutating `main` or packaging
from whatever branch GitHub happened to check out.
+ The chart's `agent.enabled=true` workload must point at an image that is
+ actually published. The default `agent.image.repository` must be the main
+ `rcourtman/pulse` image (which is the only image `publish-docker.yml`
+ pushes); the agent template must override the server ENTRYPOINT via
+ `agent.command` so the pod runs as a unified agent; and the runtime stage
+ of `Dockerfile` must ship an arch-resolved `/usr/local/bin/pulse-agent`
+ symlink that picks `pulse-agent-linux-{amd64,arm64,armv7}` per `TARGETARCH`
+ so a single command default works across multi-arch nodes. The
+ never-published `ghcr.io/rcourtman/pulse-agent` is forbidden as a chart
+ default. `scripts/validate-release.sh` must assert the
+ `/usr/local/bin/pulse-agent` symlink exists, points at one of the
+ supported Linux arch binaries, and is executable in the published image.
Generated chart docs are part of the packaged release artifact, not a
disposable byproduct: when the stable candidate version changes, the checked
in `deploy/helm/pulse/README.md` output must be regenerated from the same
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index d4a3928452..208d5b005d 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -2796,6 +2796,7 @@
"allow_same_subsystem_tests": false,
"test_prefixes": [],
"exact_files": [
+ "scripts/installtests/build_release_assets_test.go",
"scripts/release_control/subsystem_lookup_test.py"
]
},
diff --git a/scripts/installtests/build_release_assets_test.go b/scripts/installtests/build_release_assets_test.go
index 98e9f28d28..727d5ddfc0 100644
--- a/scripts/installtests/build_release_assets_test.go
+++ b/scripts/installtests/build_release_assets_test.go
@@ -940,6 +940,81 @@ func TestInstallShSmokeWorkflowPresent(t *testing.T) {
}
}
+func TestHelmAgentRuntimePointsAtRealImage(t *testing.T) {
+ // The helm chart's agent.enabled=true workload used to default to
+ // ghcr.io/rcourtman/pulse-agent — an image that was never published.
+ // The chart now points at the main rcourtman/pulse image and uses an
+ // arch-resolved /usr/local/bin/pulse-agent symlink baked into the
+ // runtime stage. This test pins:
+ // 1. values.yaml uses the main image
+ // 2. values.yaml has the command override
+ // 3. the agent template renders the command
+ // 4. the Dockerfile creates the symlink for every supported arch
+ // 5. validate-release.sh asserts the symlink exists in the published image
+ // Reverting any one of these unwires the chart back to ImagePullBackOff.
+
+ valuesBytes, err := os.ReadFile(repoFile("deploy", "helm", "pulse", "values.yaml"))
+ if err != nil {
+ t.Fatalf("read values.yaml: %v", err)
+ }
+ values := string(valuesBytes)
+ if !strings.Contains(values, "repository: rcourtman/pulse\n") {
+ t.Fatal("agent.image.repository must default to rcourtman/pulse (single-image agent + server)")
+ }
+ // Match the actual config value, not casual mentions in surrounding
+ // comments that explain why the default changed.
+ if strings.Contains(values, "repository: ghcr.io/rcourtman/pulse-agent") {
+ t.Fatal("agent.image.repository must not reference the never-published ghcr.io/rcourtman/pulse-agent image")
+ }
+ if !strings.Contains(values, "- /usr/local/bin/pulse-agent") {
+ t.Fatal("agent.command must default to /usr/local/bin/pulse-agent so the main image's server ENTRYPOINT is overridden")
+ }
+
+ agentTemplate, err := os.ReadFile(repoFile("deploy", "helm", "pulse", "templates", "agent.yaml"))
+ if err != nil {
+ t.Fatalf("read agent.yaml: %v", err)
+ }
+ tmpl := string(agentTemplate)
+ if !strings.Contains(tmpl, "{{- if .Values.agent.command }}") {
+ t.Fatal("agent.yaml template must conditionally render command from .Values.agent.command")
+ }
+ if !strings.Contains(tmpl, "command:\n {{- toYaml .Values.agent.command | nindent 12 }}") {
+ t.Fatal("agent.yaml template must render command via toYaml so list values pass through correctly")
+ }
+
+ dockerfile, err := os.ReadFile(repoFile("Dockerfile"))
+ if err != nil {
+ t.Fatalf("read Dockerfile: %v", err)
+ }
+ dockerfileStr := string(dockerfile)
+ dockerfileRequired := []string{
+ `ln -s /opt/pulse/bin/pulse-agent-linux-arm64 /usr/local/bin/pulse-agent`,
+ `ln -s /opt/pulse/bin/pulse-agent-linux-armv7 /usr/local/bin/pulse-agent`,
+ `ln -s /opt/pulse/bin/pulse-agent-linux-amd64 /usr/local/bin/pulse-agent`,
+ }
+ for _, needle := range dockerfileRequired {
+ if !strings.Contains(dockerfileStr, needle) {
+ t.Fatalf("Dockerfile runtime stage missing arch-resolved pulse-agent symlink: %s", needle)
+ }
+ }
+
+ validateScript, err := os.ReadFile(repoFile("scripts", "validate-release.sh"))
+ if err != nil {
+ t.Fatalf("read validate-release.sh: %v", err)
+ }
+ validate := string(validateScript)
+ validateRequired := []string{
+ `Validating /usr/local/bin/pulse-agent arch-resolved symlink`,
+ `[ -L /usr/local/bin/pulse-agent ]`,
+ `/usr/local/bin/pulse-agent target is not executable`,
+ }
+ for _, needle := range validateRequired {
+ if !strings.Contains(validate, needle) {
+ t.Fatalf("validate-release.sh missing pulse-agent symlink guard: %s", needle)
+ }
+ }
+}
+
func repoFile(parts ...string) string {
root := filepath.Join("..", "..")
segments := append([]string{root}, parts...)
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index 1d301774d7..c5d05433cb 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -4424,7 +4424,10 @@ class SubsystemLookupTest(unittest.TestCase):
)
self.assertEqual(
match["verification_requirement"]["exact_files"],
- ["scripts/release_control/subsystem_lookup_test.py"],
+ [
+ "scripts/installtests/build_release_assets_test.go",
+ "scripts/release_control/subsystem_lookup_test.py",
+ ],
)
def test_lookup_paths_assigns_secure_storage_hardening_to_security_privacy(self) -> None:
diff --git a/scripts/validate-release.sh b/scripts/validate-release.sh
index 65a26bb23b..83b1134331 100755
--- a/scripts/validate-release.sh
+++ b/scripts/validate-release.sh
@@ -205,6 +205,15 @@ if [ "$SKIP_DOCKER" = false ]; then
docker run --rm --entrypoint /bin/sh "$IMAGE" -c 'set -euo pipefail; cd /opt/pulse/bin; required="pulse pulse-agent-linux-amd64 pulse-agent-linux-arm64 pulse-agent-linux-armv7 pulse-agent-linux-armv6 pulse-agent-linux-386 pulse-agent-darwin-amd64 pulse-agent-darwin-arm64 pulse-agent-windows-amd64.exe pulse-agent-windows-amd64 pulse-agent-windows-arm64.exe pulse-agent-windows-arm64 pulse-agent-windows-386.exe pulse-agent-windows-386 pulse-agent-freebsd-amd64 pulse-agent-freebsd-arm64"; for f in $required; do [ -e "$f" ] || { echo "missing binary $f" >&2; exit 1; }; [ -s "$f" ] || { echo "empty binary $f" >&2; exit 1; }; done; [ "$(readlink pulse-agent-windows-amd64)" = "pulse-agent-windows-amd64.exe" ] || { echo "unified agent windows amd64 symlink broken" >&2; exit 1; }; [ "$(readlink pulse-agent-windows-arm64)" = "pulse-agent-windows-arm64.exe" ] || { echo "unified agent windows arm64 symlink broken" >&2; exit 1; }; [ "$(readlink pulse-agent-windows-386)" = "pulse-agent-windows-386.exe" ] || { echo "unified agent windows 386 symlink broken" >&2; exit 1; }; echo "All binaries present"' || { error "Binary validation failed"; exit 1; }
success "All downloadable binaries present"
+ # Validate the arch-resolved /usr/local/bin/pulse-agent symlink. The helm
+ # chart's agent workload (and `docker run rcourtman/pulse --entrypoint
+ # /usr/local/bin/pulse-agent`) depend on this path; without it the chart
+ # defaults to a non-existent image and `agent.enabled=true` hits
+ # ImagePullBackOff.
+ info "Validating /usr/local/bin/pulse-agent arch-resolved symlink..."
+ docker run --rm --entrypoint /bin/sh "$IMAGE" -c 'set -euo pipefail; [ -L /usr/local/bin/pulse-agent ] || { echo "/usr/local/bin/pulse-agent is missing or not a symlink" >&2; exit 1; }; target=$(readlink /usr/local/bin/pulse-agent); case "$target" in /opt/pulse/bin/pulse-agent-linux-amd64|/opt/pulse/bin/pulse-agent-linux-arm64|/opt/pulse/bin/pulse-agent-linux-armv7) : ;; *) echo "/usr/local/bin/pulse-agent points at unexpected target: $target" >&2; exit 1 ;; esac; [ -x "$target" ] || { echo "/usr/local/bin/pulse-agent target is not executable" >&2; exit 1; }; echo "pulse-agent symlink resolves to $target"' || { error "/usr/local/bin/pulse-agent validation failed"; exit 1; }
+ success "/usr/local/bin/pulse-agent symlink is arch-resolved and executable"
+
# Validate version embedding in Docker image binaries
info "Validating version embedding in Docker image binaries..."