Skip to content

v2.6.0 — YAML view/edit with Monaco + server dry-run

Choose a tag to compare

@vurulkan vurulkan released this 02 Oct 14:24
· 42 commits to main since this release

v2.6.0 — YAML view/edit with Monaco + server dry-run

Every resource that already had a YAML button now opens a view/edit modal
powered by Monaco. Operators can audit the YAML, flip to Edit, run a
server-side dry-run, and apply with a confirmation — all without leaving the
console.

Flow

  • View (default) — the YAML button opens a read-only Monaco pane with
    syntax highlighting. Non-editors stop here.
  • Edit — a visible toggle (only when you have the new {resource}:edit
    permission) flips the body to a side-by-side DiffEditor: left is the
    server copy, right is your editable buffer.
  • Dry-run — sends the draft to the API server with DryRun=All. The
    canonicalized object (defaulted fields, timestamps) replaces the left pane
    so you see what the cluster would actually store.
  • Apply — gates behind a confirmation and persists. The modal swaps in
    the fresh resourceVersion so you can iterate without reopening.

Permissions

  • New per-resource action edit. The admin wildcard includes it on every
    resource; non-admins get it via a role grant.
  • Role Permissions "Add" matrix shows edit as a destructive-tinted chip
    (rose) so operators can grant it deliberately.
  • SRE template now also grants edit on deployments, statefulsets,
    configmaps so bumping an env var or scaling via YAML doesn't need an
    Admin role.

Backend

  • POST /api/namespaces/{ns}/{resource}/{name}/apply with
    {yaml, dryRun}. Supported resources: pods, deployments, daemonsets,
    statefulsets, hpas, services, configmaps, ingresses, cronjobs, jobs.
  • Guardrails: metadata.name and metadata.namespace must match the URL;
    metadata.resourceVersion is required (optimistic concurrency — a stale
    edit fails with 409 instead of clobbering).
  • Audit entries: {resource}.apply.{success,denied,rate_limited,failed}
    with before/after sha256 prefixes stored in the row's ResourceName
    — enough to distinguish writes without logging full YAML.
  • Per-user rate limiter (shared with scale/restart buckets).

CDN / air-gapped note

Monaco loads from https://cdn.jsdelivr.net by default. CSP widens to allow
that CDN and worker-src blob: so Monaco can spawn its web workers.
Air-gapped deployments can self-host the vs folder and point
@monaco-editor/react's loader.config({ paths: { vs: '/vs' } }) at a local
path, then tighten CSP back to self.

Upgrade

docker pull ghcr.io/vurulkan/kubernetes-openconsole:2.6.0
docker rm -f openconsole && \
  docker run -d --name openconsole -p 8080:8080 -e DATA_PATH=/tmp/app.db \
    ghcr.io/vurulkan/kubernetes-openconsole:2.6.0

No schema change. Monaco is lazy-loaded, so first page open is unchanged;
opening the YAML modal pulls Monaco from the CDN on first use.

Rollback

docker pull ghcr.io/vurulkan/kubernetes-openconsole:2.5.2