Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/helm_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
make -C operator yq
helm-charts/scripts/test-image-values.sh

- name: Prometheus values
run: helm-charts/scripts/test-prometheus-values.sh

- name: KMS setup script
run: helm-charts/scripts/test-setup-kms.sh

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ jobs:
run: |
for d in "$HOME"/.talos/clusters/sbi-* "$HOME"/.talos/clusters/sb-integration*; do
[ -d "$d" ] || continue
sudo -E talosctl cluster show --provisioner qemu --name "$(basename "$d")" 2>&1 | head -40 || true
# HOME by name: sudo-rs, on Ubuntu 26.04 runners, ignores -E.
sudo HOME="$HOME" talosctl cluster show --provisioner qemu --name "$(basename "$d")" 2>&1 | head -40 || true
# QEMU writes one log per node here, and a VM that never started says
# so only in that file.
sudo sh -c 'for f in "$0"/*.log; do
Expand All @@ -276,7 +277,7 @@ jobs:
run: |
for d in "$HOME"/.talos/clusters/sbi-* "$HOME"/.talos/clusters/sb-integration*; do
[ -d "$d" ] || continue
sudo -E talosctl cluster destroy --name "$(basename "$d")" 2>/dev/null || true
sudo HOME="$HOME" talosctl cluster destroy --name "$(basename "$d")" 2>/dev/null || true
# A create that died before writing state.yaml cannot be destroyed,
# and its disk images would go into the runner's cache.
sudo rm -rf "$d" || true
Expand Down
2 changes: 1 addition & 1 deletion control-center/INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ the environment, into the writable scratch mount. Nothing is baked in.
| `SB_GRAYLOG_TOKEN_FILE` | empty | a Graylog access token instead (sent as `<token>:token`); wins over the password |
| `SB_GRAYLOG_CA_FILE` | empty | CA to verify an https Graylog |
| `SB_HELM_URL` | `http://simplyblock-operator:8080` | Helm release view; empty disables it |
| `SB_PROMETHEUS_URL` | `http://simplyblock-prometheus:9090` | metrics; empty disables it |
| `SB_PROMETHEUS_URL` | empty | metrics, from `prometheus.simplyblock.prometheusURL`/`prometheusPORT` when set — the chart deploys no Prometheus of its own; empty disables it |
| `SB_LOGO_URL` | `vendor/logo-white.svg` | brand mark, vendored into the image |
| `SB_MOCK` | `false` | `true` runs on fixtures (needs a `KEEP_MOCKS=1` image) |
| `SB_TOKEN_REFRESH_SECONDS` | `600` | how often the proxied token is re-read |
Expand Down
2 changes: 1 addition & 1 deletion control-center/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ the environment, into the writable scratch mount. Nothing is baked in.
| `SB_K8S_HOST` | `kubernetes.default.svc` | SNI and Host — must be on the API server's certificate |
| `SB_K8S_CA_FILE` | the projected SA CA | CA bundle used to verify it |
| `SB_OPERATOR_URL` | `http://simplyblock-operator:8080` | operator API |
| `SB_PROMETHEUS_URL` | `http://simplyblock-prometheus:9090` | metrics |
| `SB_PROMETHEUS_URL` | empty | metrics, from `prometheus.simplyblock.prometheusURL`/`prometheusPORT` when set — the chart deploys no Prometheus of its own |
| `SB_GRAYLOG_URL` | empty | the log store: Graylog's search API, which the Logs view reads (fully qualified, resolved per request); needs the njs module, GET on `/api/search/universal/{absolute,relative}` only, every response scrubbed of credentials (field names and credential-looking text in log lines). Empty: the Logs view falls back to a pod's live tail from the Kubernetes API |
| `SB_GRAYLOG_USER`, `SB_GRAYLOG_PASSWORD_FILE` | `admin`, empty | HTTP Basic credentials attached by the proxy; the chart mounts the observability stack's own secret |
| `SB_GRAYLOG_TOKEN_FILE` | empty | a Graylog access token instead (sent as `<token>:token`); wins over the password |
Expand Down
47 changes: 39 additions & 8 deletions csi-driver/internal/nfsexport/nfsd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,43 @@ func TestCheckFailsClosedWithoutReachingInnerWhenNFSDsControlFileIsAbsent(t *tes
}
}

// startFakeProcess launches a process whose kernel comm is name, by copying a
// real binary to a temp path under that name and executing it there.
// fakeProcessEnv makes the test binary sleep instead of running tests, which
// is how startFakeProcess's copy of it stays up.
const fakeProcessEnv = "NFSEXPORT_FAKE_PROCESS"

// TestMain lets the test binary stand in for a long-running daemon when
// startFakeProcess runs a copy of it.
func TestMain(m *testing.M) {
if os.Getenv(fakeProcessEnv) != "" {
time.Sleep(30 * time.Second)
os.Exit(0)
}
os.Exit(m.Run())
}

// startFakeProcess launches a process whose kernel comm is name, by copying
// this test binary to a temp path under that name and executing it there.
// /proc/pid/comm reflects the executed file's own basename, not argv[0], so
// this is the one portable way to make a process idmapdRunning would actually
// find, without needing a real rpc.idmapd on the test machine.
// find, without needing a real rpc.idmapd on the test machine. The test
// binary rather than sleep: a multicall sleep (uutils, busybox) copied under
// another name refuses to run.
func startFakeProcess(t *testing.T, name string) {
t.Helper()
sleep, err := exec.LookPath("sleep")
self, err := os.Executable()
if err != nil {
t.Skipf("no sleep binary on PATH to fake a process with: %v", err)
t.Skipf("no test binary to fake a process with: %v", err)
}
data, err := os.ReadFile(sleep)
data, err := os.ReadFile(self)
if err != nil {
t.Fatalf("reading %s: %v", sleep, err)
t.Fatalf("reading %s: %v", self, err)
}
fake := filepath.Join(t.TempDir(), name)
if err := os.WriteFile(fake, data, 0o755); err != nil {
t.Fatalf("writing %s: %v", fake, err)
}
cmd := exec.Command(fake, "30")
cmd := exec.Command(fake)
cmd.Env = append(os.Environ(), fakeProcessEnv+"=1")
if err := cmd.Start(); err != nil {
t.Fatalf("starting %s: %v", fake, err)
}
Expand All @@ -152,6 +169,20 @@ func startFakeProcess(t *testing.T, name string) {
})
}

// Regression: 2026-11-18-ubuntu-2604-uutils. Ubuntu 26.04 runners ship uutils
// coreutils, whose sleep is one multicall binary that picks the utility from
// its own name. Copied as rpc.idmapd it refused to run and exited, so
// whether the "already running" tests saw it was a race they lost on every CI
// run. The fake has to stay up for as long as a test looks at it.
func TestAFakeProcessKeepsRunning(t *testing.T) {
startFakeProcess(t, "rpc.idmapd")
waitForProcessRunning(t, "rpc.idmapd", true)
time.Sleep(300 * time.Millisecond)
if running, err := processRunning("rpc.idmapd"); err != nil || !running {
t.Errorf("processRunning(rpc.idmapd) = %v, %v 300ms after it started, want it still running", running, err)
}
}

// processStatusIsZombie is processRunning's decision, pulled out so it is
// testable against a "State:" line directly rather than a live zombie.
func TestProcessStatusIsZombie(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions helm-charts/charts/simplyblock-operator/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ dependencies:
- name: opensearch
repository: https://opensearch-project.github.io/helm-charts
version: 2.9.0
- name: prometheus
- name: kube-prometheus-stack
repository: https://prometheus-community.github.io/helm-charts
version: 25.18.0
digest: sha256:08f07d95d3307a3c80cd3124209b4a00cd91d8ba9c079270dced96886b24678b
generated: "2026-10-29T14:03:15.334278+01:00"
version: 92.2.0
digest: sha256:1a41572053d620e919e2dbe538ba16f4550d8568511633fb93dc66e763ba42ac
generated: "2026-11-18T15:08:52.598917069+01:00"
6 changes: 3 additions & 3 deletions helm-charts/charts/simplyblock-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:
version: 2.9.0
repository: https://opensearch-project.github.io/helm-charts
condition: controlplane.observability.enabled
- name: prometheus
version: "25.18.0"
repository: "https://prometheus-community.github.io/helm-charts"
- name: kube-prometheus-stack
version: 92.2.0
repository: https://prometheus-community.github.io/helm-charts
condition: prometheus.enabled
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ http://simplyblock-operator:8080
{{- .Values.controlCenter.prometheusUrl -}}
{{- else -}}
{{- $p := ((.Values.prometheus).simplyblock) | default dict -}}
{{- printf "http://%s:%v" ($p.prometheusURL | default "simplyblock-prometheus") ($p.prometheusPORT | default 9090) -}}
{{- printf "http://%s:%v" ($p.prometheusURL | default (ternary "prometheus-operated" "simplyblock-prometheus" (.Values.prometheus.enabled | default false))) ($p.prometheusPORT | default 9090) -}}
{{- end -}}
{{- end -}}
39 changes: 39 additions & 0 deletions helm-charts/charts/simplyblock-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,45 @@ true
{{- end -}}
{{- end -}}

{{/* Whether this install is deploying its own prometheus-operator (the
kube-prometheus-stack dependency) rather than relying on one the customer
already runs. True only when both halves of it are actually on: the CRDs
without the controller (or the reverse) scrape nothing and own nothing,
so neither half alone is "bundling" anything.

This also decides whether prometheus-operator-servicemonitors.yaml and
prometheus-operator-alerting.yaml's own "does this cluster have the CRD"
checks apply at all: on a fresh install, .Capabilities.APIVersions is
captured before this same install's own kube-prometheus-stack dependency
creates its CRDs, so a literal capability check would fail an install
that was about to supply the CRD itself. Bundling skips that check and
trusts Helm's own install ordering instead; only the not-bundling path
still needs it, because then nothing else is going to create the CRD. */}}
{{- define "simplyblock.bundlesPrometheusOperator" -}}
{{- $kps := index .Values "kube-prometheus-stack" | default dict -}}
{{- $crds := ($kps.crds | default dict).enabled -}}
{{- $operator := ($kps.prometheusOperator | default dict).enabled -}}
{{- if and $crds $operator -}}
true
{{- end -}}
{{- end -}}

{{/* The customer's own Prometheus, named to the management API's trusted
scrapers (SB_K8S_METRICS_SERVICE_ACCOUNTS). Empty until
prometheus.serviceAccount.name is set, same as sbcc.trustedAccount leaves
the Control Center's entry empty until it opts in. */}}
{{- define "simplyblock.extraMetricsServiceAccount" -}}
{{- $sa := .Values.prometheus.serviceAccount | default dict -}}
{{- $accounts := list -}}
{{- if $sa.name -}}
{{- $accounts = append $accounts (printf "system:serviceaccount:%s:%s" ($sa.namespace | default .Release.Namespace) $sa.name) -}}
{{- end -}}
{{- if .Values.prometheus.enabled -}}
{{- $accounts = append $accounts (printf "system:serviceaccount:%s:simplyblock-metrics-scraper" .Release.Namespace) -}}
{{- end -}}
{{- join "," $accounts -}}
{{- end -}}

{{- define "simplyblock.controlPlaneAddr" -}}
{{- if .Values.csiConfig.simplybk.ip -}}
{{ .Values.csiConfig.simplybk.ip }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ data:
uid: PBFA97CFB590B2093
editable: true
---
# The eleven rules below are mirrored, independently, as a PrometheusRule in
# prometheus-operator-alerting.yaml for prometheus.enabled installs.
# Adding or changing a rule here means doing the same there. Nothing checks
# that the two stay in step. Expected to be temporary: once Grafana alerting
# is retired, this ConfigMap goes and that PrometheusRule is the only copy.
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,8 @@ spec:
- --http-address=0.0.0.0:9091
- --query.replica-label=replica
- --store=simplyblock-thanos:10901
{{- $replicas := int .Values.prometheus.server.replicaCount }}
{{- $ns := .Release.Namespace }}
{{- range $i := until $replicas }}
- --store=simplyblock-prometheus-{{ $i }}.simplyblock-prometheus-headless.{{ $ns }}.svc:10901
{{- if not .Values.prometheus.enabled }}
- --store=simplyblock-prometheus-0.simplyblock-prometheus-headless.{{ .Release.Namespace }}.svc:10901
{{- end }}
ports:
- containerPort: 9091
Expand Down
Loading
Loading