Reach your services from your laptop

This page shows how to declare, in the typed model, how each service is reached from your laptop, and then use one command to check whether the app is up (piceli status) and one to forward its ports (piceli access). You do not need kubectl or curl for either.

Maturity: preview

app.access.forward, piceli access and piceli status are new in this release. They work and are tested (including against kind), but options and JSON fields may still change before 1.0. Fields of piceli.status.v1 are only added, never removed, within a major version. See the Roadmap.

How it works

An access declaration is part of the model, but not part of the cluster:

  • it renders to no Kubernetes object and changes no manifest, so piceli render and piceli release plan show exactly what they showed before;

  • piceli access starts one loopback kubectl port-forward per declaration, probes it (TCP or HTTP) and restarts it when it stops answering, but never while it is moving bytes (see Busy forwards);

  • piceli status reads the release state, the live workloads and the declared forwards, and prints whether the app is up and each URL;

  • the local dashboard shows the same forwards as its shortcuts, so a separate --ui-config TOML file becomes optional.

Everything uses the target’s explicit kubeconfig file and context. Piceli never reads KUBECONFIG, ~/.kube/config or the current context. An exec credential plugin (GKE, EKS, AKS, OIDC) runs only when the target allows it: [target] allow_exec = true or Target.kubeconfig(…, allow_exec=True) (see Connect to managed clusters (GKE, EKS, AKS)); otherwise status reports exec-auth-not-allowed in errors and access refuses with that code.

Prerequisites

New to Piceli? Start with Getting Started.

Steps

  1. Declare access on a Service. Pass access=app.access.forward(...) to app.service(...):

    from piceli import App
    
    
    def build(ctx):
        app = App("shop")
        web = app.deployment("web", image=ctx.image("web"), ports=[3000])
        app.service(
            web,
            port=3000,
            access=app.access.forward(local=18080, path="/login", health="/healthz"),
        )
        return app  # return the App, not app.composition(ctx)
    
    • local is the port on 127.0.0.1 (unique within the app).

    • port picks the Service port by number or name (default: the first).

    • path is appended to the URL that status prints.

    • health is None or "tcp" for a TCP probe, a path such as "/healthz" for an HTTP probe that expects 200-399, or a full HealthProbe (status range, interval, timeout, failure threshold).

    • name (the forward id, default: the Service name), label, description, required=False (skip instead of refusing when the port is taken) and restart=RestartPolicy(...) are optional.

    A Deployment may declare access= too; it then forwards to the pods, on the main container’s port. Prefer a Service.

    Important

    The composition function must return the App (a release renders it), so access and status can see its declarations. A function that returns app.composition(ctx) still deploys, but has no declared access.

  2. Check whether the app is up.

    piceli status release.toml
    

    Expected output (exit code 0):

    shop is UP  (namespace shop, context kind-shop)
    release    shop-4d2f7a0c9b1e  ready, apply at 2026-09-24T10:00:00+00:00
    workloads
      ready        Deployment/web  1/1  web=0f5c2a9e81d4
    access     down
      down      web          http://127.0.0.1:18080/login  -> service/web:3000
    Start the forwards with: piceli access release.toml
    
  3. Forward the ports.

    piceli access release.toml
    

    Expected output; it keeps running until Ctrl-C:

    Forwarding 1 port(s) of shop (namespace shop); Ctrl-C stops them.
      web          http://127.0.0.1:18080/login  -> service/web:3000
    web: starting
    web: healthy
    

    Open the printed URL. --only web forwards one declaration; --dashboard 9876 also serves the local dashboard on http://127.0.0.1:9876 with these forwards as its shortcuts.

  4. Check again. In another terminal, piceli status release.toml now shows up next to each forward.

    up means the port is held by the kubectl port-forward that Piceli started for this declaration (same context, namespace, target and ports, started by piceli access or a dashboard), or since 0.19.0 by the piceli access for this TARGET itself (its relay, with kubectl behind it), and its health probe passes. If another process holds the port (another project’s forward, a dev server), the forward is occupied, never up, and only that process’s pid is shown:

    access     down
      occupied  web          http://127.0.0.1:18080/login  -> service/web:3000
          port 18080 is held by pid 4242, not by piceli (status-port-occupied)
    

Targets

TARGET is either:

  • a release.toml path: the cluster comes from [target] and the declarations from the App that [release] composition returns; or

  • module:attr (or file.py:attr) of an object with .app (a piceli App) and .target (with .kubeconfig, .context and .namespace), such as a pipeline object. For a piceli.pipeline.Pipeline the release state piceli deploy keeps (state_dir/release) is read automatically. For other objects, .release_spec (a ReleaseSpec or a path to release.toml) adds the release state, and .last_checks() adds the latest checks result.

A composition environment is the third form: its name as TARGET and the composition’s cluster with --cluster:

piceli access main --cluster infra.py:my_cluster

The composition module names the environment’s namespace, and the cluster’s credentials profile reaches it (its explicit kubeconfig and context, never the current context). An environment that deploys a Pipeline (Environment(pipeline=…)) forwards what its app declares (app.access.forward(...)) on the declared local port, with its path, health probe and restart policy (a declared Service that is not live is left out). Since 0.20.0 those are the only forwards when the app declares any: internal ports (an OTLP intake, a database, a TLS graph port) are not forwarded; --all-ports adds one forward per other live Service port, on a free loopback port. An environment whose app declares no forward (component ports live in their contracts, in the source repositories) forwards every Service port, so several environments are reachable at once. Only named environments are supported (env-not-found otherwise; a branch environment uses --pipeline). The web UI describes its forwards the same way (see Piceli web application).

--ui also forwards the cluster’s in-cluster UI in the same command, as piceli access ui --cluster does (127.0.0.1:8790, the launch URL printed once, "ui" in the started JSON line):

piceli access main --cluster infra.py:my_cluster --ui

If it fails

You see

Meaning

Next step

access-port-conflict

A declared local port (or the --dashboard port) is held by another process. Piceli never takes a port over. When the holder is Piceli’s own process for this app (holder: piceli-forward or piceli-server, for example a piceli access left running in another terminal, or a kubectl port-forward whose piceli access died), stderr says so and prints the command that stops it. Any other process is named by its pid only.

Piceli’s own: piceli access stop --stale TARGET (Stop Piceli’s stale processes). Otherwise stop that pid yourself, or change local=, then run again.

access-stop-needs-stale

piceli access stop without --stale.

Add --stale.

access-stop-incomplete

A stale Piceli process got SIGTERM but its port was still held 5 s later (usually the orphaned kubectl of a supervisor that just stopped).

Run piceli access stop --stale TARGET again.

access-none-declared

No forward is declared, or the composition function returns app.composition(ctx).

Add access= and return the App.

access-unknown-forward

--only names an id that does not exist.

Use an id from piceli status TARGET --json.

access-kubectl-missing

No kubectl found.

Install it or pass --kubectl PATH.

occupied / status-port-occupied in piceli status

A declared local port is held by a process Piceli did not start for this forward. Only its pid is reported.

Stop that process (lsof -nP -iTCP:PORT -sTCP:LISTEN) or change local=, then run piceli access.

access-kubeconfig-invalid

The kubeconfig file or context is missing or unusable.

Fix [target] kubeconfig / context.

exec-auth-not-allowed

The context’s user runs an exec plugin and the target does not allow it.

Review the plugin, then set allow_exec on the target.

access-target-invalid

TARGET is neither a readable release.toml nor a module:attr object with .app and .target.

Read the message on stderr.

status exits 1 with state: degraded or down

Some workloads are not ready.

Read workloads[].problems (for example CrashLoopBackOff, restarts).

status shows state: unknown and errors: ["status-cluster-unreadable"]

The cluster could not be read.

Check that the context reaches the cluster, then retry.

A forward shows busy

A probe failed while the forward moved bytes (a large download over a slow link). It is not restarted.

Nothing to do; it turns healthy once the transfer ends. Read restart_reasons if it restarted before.

A forward shows unhealthy

Piceli’s forward holds the port but the health probe fails.

The upstream is down or not ready: check the workload (piceli status).

Every code is explained by piceli explain <code> and in Error codes.

Contract: piceli status

Arguments

TARGET (text, required); --json (flag); --timeout SECONDS (float, 1-60, default 10)

Reads

release.toml or the target module, the release state_dir (catalog, history), the cluster through the explicit kubeconfig (Deployments, StatefulSets, DaemonSets, Pods), and 127.0.0.1 for each declared forward

Writes

Nothing

Approval

None; read-only. Safe to retry.

Exit codes

0 every workload is ready; 1 not ready or the cluster could not be read; 2 TARGET rejected

Output

Human text, or with --json one piceli.status.v1 object (schema)

The JSON object:

{
  "schema": "piceli.status.v1",
  "state": "up",
  "app": "shop",
  "namespace": "shop",
  "context": "kind-shop",
  "source": "release-spec",
  "release": {
    "name": "shop",
    "state": "ready",
    "current": "shop-4d2f7a0c9b1e",
    "previous": null,
    "latest": {"release": "shop-4d2f7a0c9b1e", "intent": "apply", "state": "ready",
               "at": "2026-09-24T10:00:00+00:00", "execution_id": "…"},
    "images": {"web": "registry.example/shop/web@sha256:…"},
    "pending_plans": 0
  },
  "workloads": [
    {
      "kind": "Deployment", "name": "web", "health": "ready", "ready": true,
      "replicas": {"desired": 1, "ready": 1, "updated": 1, "available": 1, "current": 1},
      "images": [{"container": "web", "image": "registry.example/shop/web@sha256:…",
                  "digest": "sha256:…", "pinned": true, "running": ["sha256:…"]}],
      "problems": [],
      "error": null
    }
  ],
  "access": {
    "state": "up",
    "forwards": [
      {"id": "web", "label": "web", "target": "service/web",
       "url": "http://127.0.0.1:18080/login", "local_port": 18080, "remote_port": 3000,
       "required": true, "forward": "up", "error": null,
       "owner": {"port": 18080, "pid": 4242, "command": "kubectl … port-forward service/web 18080:3000",
                 "parent": {"pid": 4200, "command": "… piceli access release.toml"}},
       "probe": {"type": "http", "path": "/healthz", "expect_status": [200, 399],
                 "interval": 5.0, "timeout": 2.0, "failure_threshold": 3}}
    ]
  },
  "checks": null,
  "errors": []
}
  • state: up (every workload ready), degraded, down (none ready or all missing) or unknown (the cluster could not be read, or no workload).

  • workloads[].health: ready (the controller saw the latest spec, every desired replica is updated and ready, and no old replica is left: the rule piceli release apply waits for), idle (scaled to zero), progressing, unavailable, missing or unknown.

  • workloads[].images[].digest: the pinned digest of the spec image, else the single digest the pods report; running lists every digest the pods report.

  • access.forwards[].forward: up (Piceli’s forward for this declaration holds the port and the probe passes), unhealthy (Piceli’s forward holds the port, the probe fails), occupied (another process holds the port; error is status-port-occupied and owner carries only its port and pid, with command and parent null) or down (nothing listens).

  • checks: the latest checks result when the target records one, else null.

  • errors: error codes, for example status-cluster-unreadable.

On the tailnet

A kubectl port-forward goes through the API server’s stream proxy: fine on the LAN, slow and fragile over a slow link (a laptop away from home on Tailscale, a phone). A composition environment can be reachable on the cluster’s Tailscale tailnet instead (0.19.0):

from piceli.envs import Access

Environment(
    "main",
    namespace="shop-main",
    pipeline=pipeline,
    cluster=my_cluster,
    follow={shop: "main"},
    access=Access(tailnet=True, hostname="shop-{env}-{service}"),
)
# branch environments: Environment.per_branch(..., access=Access(tailnet=True))

Cluster(..., access=Access(tailnet=True)) is the default of every environment of that cluster: release candidates and every branch environment included. Declare it on the environments you mean when that is not what you want.

  • The environment’s release adds, for each Service the app declares a forward for (app.access.forward, or Access(services=[...])), a companion Service <name>-tailnet with loadBalancerClass: tailscale. The Tailscale Kubernetes operator, which the cluster’s owner installs (Piceli does not, see the checklist), gives it the machine name hostname ({env}, {service}, {namespace}) on the tailnet: only the devices the tailnet policy lets reach the proxies’ tag get in, and the app keeps its own login. Only the forwarded ports are exposed.

  • The NetworkPolicies are decided by the pods (0.19.1; 0.19.0 compared policy labels with the Service selector and could miss a policy). Piceli takes the pod templates of the release’s workloads (Deployment, StatefulSet, DaemonSet, ReplicaSet, Job, CronJob, Pod) whose labels match each exposed Service’s selector, and every ingress NetworkPolicy of the environment whose podSelector (matchLabels and matchExpressions) selects one of them gets one more rule: the operator’s namespace (operator_namespace, default tailscale) on the exposed target ports only. A policy can select the pods through labels the Service does not use; it is still found. Piceli adds no new policy (a new one would cut the pods off from every other source) and widens none beyond those ports.

  • The cluster’s nodes are admitted too (0.91.0). The operator marks a plain companion’s tailnet IP ipMode: VIP, so kube-proxy on each node sends that IP straight to the pod. A tailnet device that is also a node then reaches the pod from the node, not through the proxy, and a policy that admits only the operator’s namespace refused it. env up (and the GitOps controller) reads the nodes and adds a second rule, on the same ports of the plain companions only (a Tailscale Ingress is not short-circuited): each node’s InternalIP and the first two addresses of its pod range (spec.podCIDRs), where node traffic leaves from on flannel, k3s’ default. Pods never get those two addresses. On another network plugin, node traffic may come from an address not in this list; reach the service from a device that is not a node. The node list is read at each deploy: a node added later is admitted by the next one. When the nodes cannot be listed (no list nodes right), env up says so and only the operator is admitted, as before.

  • piceli access ENV --cluster infra.py:CLUSTER prints the tailnet URL of each such forward instead of forwarding it, and keeps forwarding the rest (and the UI with --ui). The name is read from the companion’s status.loadBalancer.ingress, never composed: when a stale device still holds the name, Tailscale gives the new proxy <name>-1, and that is the URL printed. A companion without a name yet is forwarded as before, with a note. --forward forwards everything.

The started event (--json) lists them under tailnet (id, service, port, host, ready, url, companion); when every selected forward is on the tailnet and there is no --ui, piceli access prints them and exits 0.

Options (0.19.1; defaults unchanged):

  • tags=["tag:family-dashboard"] (annotation tailscale.com/tags): the proxies’ tags, to give one environment’s services wider or narrower access than the operator’s default tag. The tailnet policy must make the operator’s tag an owner of each (tagOwners), or the operator cannot create the proxy (an access-tailnet-pending note shows its event).

  • https=True: every exposed TCP port whose forward speaks HTTP (its scheme, else what the port’s name or number says, as piceli access shows it) gets a Tailscale Ingress (ingressClassName: tailscale) instead, served at https://<name>.<tailnet>.ts.net/<path> with a tailnet certificate and no port in the URL. It needs MagicDNS and HTTPS certificates on in the tailnet, which is why it is opt-in. A Service that also exposes non-HTTP or UDP ports keeps one plain companion (https-mixed-ports). Turning it on replaces a port’s plain companion with the Ingress of the same name: the release deletes the old companion first, so the Ingress gets the plain tailnet name (an Ingress created while the old proxy still held the name got NAME-1; delete such an Ingress once, and the next release creates it again under the plain name).

  • proxy_class="NAME" (label tailscale.com/proxy-class): the operator’s ProxyClass for these proxies.

Branch environments create and delete tailnet devices. With Environment.per_branch(..., access=Access(tailnet=True)) every branch environment adds its companions, so the operator creates one device per exposed Service when the branch is deployed. Deleting the environment (the branch is deleted, or idle_stop and teardown) removes the companions and so the devices.

Why a service is not on the tailnet

Nothing is skipped silently (0.19.1). The plan of an environment with Access(tailnet=True) has access in its plan stage (shown, not part of the plan hash): tailnet (each companion: kind, name, service, host, ports, scheme), policies (the ingress policies admitting the operator’s namespace), nodes (the node addresses admitted beside it, 0.91.0) and notes:

Code

why

Meaning

access-tailnet-skipped

not-found, no-selector, no-matching-port, https-mixed-ports

The Service gets no companion (or not the HTTPS one)

access-policy-unchanged

selector-unevaluable

A policy’s podSelector cannot be evaluated (an unknown operator): if it selects the pods, the proxies are blocked

access-policy-unchanged

pods-not-in-release

No workload of the release has pods the Service selects, so the policies in front of them cannot be checked

piceli access checks the running cluster, read-only, and prints tailnet_notes (also in its started event):

Code

Meaning

access-tailnet-missing

The running release has no companions (rendered before Access(tailnet=True)): deploy the environment again

access-operator-missing

No operator Deployment in operator_namespace and no tailscale IngressClass

access-operator-not-ready

No ready operator replica, or a crash-looping operator pod

access-operator-unknown

The operator’s namespace cannot be read with these credentials

access-tailnet-pending

A companion has no tailnet name yet; the note quotes the operator’s latest Event on it (tags it may not use, OAuth errors)

Cluster owner checklist

Piceli holds no Tailscale credential and installs nothing on the tailnet. The cluster’s owner does this once per cluster:

  1. Tailnet policy. In tagOwners, the operator’s tag (for example tag:k8s-operator) owned by the tailnet admins, and the proxies’ tag (tag:k8s, plus every tag an environment names in Access(tags=...)) owned by the operator’s tag. A grant from the people who should reach the services to the proxies’ tag (and none from anyone else). A policy test that checks both (who gets in, who does not) is recommended. A new tailnet Service then needs no policy change.

  2. An OAuth client for the operator only: scopes Devices Core (write) and Auth Keys (write), tagged with the operator’s tag. Keep it in the cluster only.

  3. Install the operator in operator_namespace (default tailscale), for example with its Helm chart. Two traps:

    • Create the operator-oauth Secret without trailing newlines. echo and security find-generic-password -w add one, the operator sends the file verbatim, and it fails with oauth2: cannot fetch token: 401 ... API token invalid. Use printf %s or --from-literal.

    • The operator has no readiness probe: kubectl rollout status succeeds while it crash-loops. Wait for the Startup complete, operator running line in its log.

  4. NetworkPolicies must be enforced for the operator rule to matter (most CNIs; K3s’s kube-router does).

  5. The operator’s own device does not appear in a laptop’s tailscale status unless a grant reaches the operator’s tag; the proxies do appear once a companion is deployed.

Web pages and other services

New in 0.31.0. Each forward has a scheme: what the port speaks. Only http and https are printed as links, first and with their label; any other service is printed by its scheme and marked “not a web page”:

  Console (web): http://127.0.0.1:18090/  -> service/web:8090
  turn         turn:127.0.0.1:13478  -> service/turn:3478  (TURN, not a web page)

The scheme is the forward’s scheme= (app.access.forward(local=..., scheme="tcp"), or scheme = "..." in an access profile), else the Service port’s appProtocol (ServicePort(port=3478, app_protocol="turn") renders it), else the first word of the port’s name (http-api, turn-udp, grpc), else a well-known non-web port (3478 TURN, 5349 TURNS, 5432 PostgreSQL, 6379 Redis, 4317 gRPC, …), else udp for a UDP port, else http. TURN and STUN are written turn:HOST:PORT (RFC 7065); others SCHEME://HOST:PORT. The JSON of access, status and the tailnet entries carries scheme and web.

Contract: piceli access

Arguments

TARGET (text, required); --only ID (repeatable); --json (flag); --kubectl PATH (default kubectl); --poll SECONDS (0.1-60, default 1); --dashboard PORT (optional); --ui-config PATH (optional, also $PICELI__UI_CONFIG); with --cluster: --ui, --forward (0.19.0: also the services on the tailnet)

Reads

release.toml or the target module, the kubeconfig, kubectl

Writes

Loopback ports only: one kubectl port-forward --address 127.0.0.1 process per forward, each in its own process group, all stopped on exit (also when piceli is killed: see below). Nothing in the cluster.

Approval

None; it only reads the cluster. Ask the owner before starting long-running processes on their machine.

Exit codes

0 stopped by Ctrl-C, SIGTERM or SIGHUP; 1 every forward gave up (access-forwards-failed); 2 rejected before starting anything

Output

Human lines, or with --json JSON lines: one started event, one status event per change, one stopped event

{"event": "started", "app": "shop", "namespace": "shop", "dashboard": null,
 "forwards": [{"id": "web", "url": "http://127.0.0.1:18080/login", "target": "service/web",
               "local_port": 18080, "remote_port": 3000}],
 "skipped": []}
{"event": "status", "id": "web", "state": "running", "health": "healthy", "restarts": 0, "url": "…", "owner": null, "…": "…"}
{"event": "stopped", "state": "stopped"}

Which pod a forward reaches. kubectl port-forward service/web (or a Deployment) connects to one pod when it starts and stays with it, so during a rollout a forward could keep pointing at a pod that is replaced. Since 0.8.1 piceli access asks the API (read-only) which pods are Ready and not terminating for the forward’s Service or Deployment, connects to the newest, and every ~2 seconds checks that the pod is still one of them; when it is not, it reconnects to the live owner without counting a restart or a failure. Each status event (and the dashboard’s forwards) carries "pod": the pod the forward is connected to now (null for a pod/NAME target, when nothing is Ready yet, or when the API cannot be read: the forward then keeps kubectl’s own choice, as before). A change of pod is a new status event.

Every kubectl stops with piceli access (and piceli access ui). On Ctrl-C, SIGTERM or SIGHUP it stops them itself. Each forward runs in its own session, so when piceli dies another way (SIGKILL, a crash) a small watchdog process it starts in its own process group, which holds the other end of a pipe, sees the pipe close and stops every forward still registered (SIGTERM, then SIGKILL after 3 seconds); it never signals anything else. Only a piceli killed together with its watchdog (its whole process group) leaves a forward behind, which piceli access stop --stale stops.

Busy forwards and restarts

kubectl port-forward carries every connection through one stream to the API server. Over a slow link (a laptop away from the cluster) a large download fills that stream, and a health probe sent through the same forward times out although the forward is fine. Since 0.19.0 piceli access holds each declared local port itself, in a small relay in front of kubectl, which listens on an internal loopback port:

  • Moving bytes means healthy. A forward with an open connection that moved bytes in the last 15 seconds is never restarted. A failed probe then sets health: busy instead of counting a failure.

  • The probe uses a short request on its own connection, straight to kubectl’s internal port, so it never waits in line behind your download in the relay.

  • Back off before restarting. A forward is restarted only after failure_threshold failed probes while idle, with the declared backoff. The relay keeps the local port during the restart, so your browser or client sees a refused request at worst, never a port taken by someone else.

  • Every restart is reported with its reason. The status events and the dashboard’s forwards carry restart_reasons: the last ten restarts, newest last, as {"at": "2026-10-11T09:12:03Z", "reason": "health probe failed: …"}. They also carry traffic: {"active_connections", "bytes", "busy"}.

Because the relay is part of piceli access, a leftover piceli access holding a forward’s port shows as holder: piceli-server in a port conflict, and piceli access stop --stale stops it (and its kubectl with it). The dashboard’s own forwards (observe serve) keep the plain kubectl behaviour.

piceli access ui (and --ui) keeps its forward through an API outage: a kubectl port-forward that exits is restarted with a backoff capped at 30 seconds until you stop it, instead of giving up after a number of restarts.

Port conflicts: before starting anything, every declared local port is checked. A required forward on a taken port rejects the command:

{"state": "rejected", "reason": "access-port-conflict",
 "conflicts": [{"id": "web", "local_port": 18080, "required": true, "holder": "piceli-forward",
                "owner": {"port": 18080, "pid": 4242, "command": "kubectl … port-forward service/web 18080:3000 --address 127.0.0.1",
                          "parent": {"pid": 4200, "command": "… piceli access release.toml"}}}]}

holder is piceli-forward (the kubectl port-forward Piceli starts for one of this app’s declared forwards: the same kubeconfig, context, namespace, target and ports, started by a Piceli process or orphaned), piceli-server (piceli access with the same TARGET, or observe serve / operator serve with the same --kubeconfig and --context), other or unknown. Only a Piceli process keeps its command and parent; for other they are null and stderr shows the pid alone (… is held by pid 4242 (not piceli)), as in piceli status. Since 0.8.0 the command line of another process is never printed, here, in the dashboard’s forward conflicts or in observe.

A forward with required=False on a taken port is listed under skipped and not started. While supervising, a forward whose port another process takes is marked conflict with that owner and is not retried: no supervisor (the dashboard’s or piceli access) waits for a declared port to free up and then silently takes it back. The owner is found through /proc on Linux and lsof on macOS; when neither works, owner is null.

Stop Piceli’s stale processes

piceli access stop --stale TARGET [--port PORT]...

Checks each declared forward’s local port (and each --port, for a dashboard, observe serve or operator serve port) and frees the ones held by Piceli’s own process for this app, as recognised above: a supervised forward’s supervisor (piceli access, observe serve, operator serve) gets SIGTERM, so it stops all of its forwards cleanly; an orphaned kubectl gets SIGTERM itself; so does a Piceli server for the same target. The holder is looked up twice and signalled only when it is still the same process. Any other process is left alone and reported by pid only. Nothing in the cluster is touched.

{"state": "succeeded", "app": "shop", "namespace": "shop",
 "stopped": [{"port": 18080, "pid": 4200, "holder": "piceli-forward", "owner": {"pid": 4242, "…": "…"}}],
 "left": [{"port": 18081, "holder": "other", "owner": {"port": 18081, "pid": 777, "command": null, "parent": null}}],
 "failed": [], "free": [9876]}

Exit 0 when every Piceli holder let go of its port (also when there was none), 1 (access-stop-incomplete) when one still holds it after 5 seconds, 2 when rejected (no --stale, an invalid TARGET, no declared forward and no --port). It needs the /proc file system (Linux) or lsof (macOS) to see a port’s owner.

The forward of a stale piceli access ui (see Piceli web application) is stopped with the cluster instead of a TARGET:

piceli access stop --stale --cluster infra.py:my_cluster   # or: --profile my-cluster

It checks port 8790 (and each --port). Piceli’s own UI forward is the kubectl port-forward to service/piceli-ui (or the pod behind it) in piceli-system with that profile’s kubeconfig and context, started by a piceli access ui that still runs (also when run through its console script, python …/bin/piceli access ui) or orphaned, or a child that piceli access ui recorded for exactly that forward in its private registry ($XDG_STATE_HOME/piceli/ui/forwards, the same one piceli ui serve uses). Its supervisor gets SIGTERM and stops the forward. The JSON has "app": "ui" and "namespace": "piceli-system". Another cluster’s UI forward, or anything else on the port, is left alone and named by its pid only.

The dashboard

piceli access TARGET --dashboard 9876 serves the local operations dashboard (see Operations Lens) with the model’s forwards as its shortcuts and, if no --ui-config declares tiers, one tier listing the app’s workloads. piceli operator serve --access TARGET does the same for the operator dashboard, and also starts the declared forwards at launch (same port-conflict refusal as piceli access; --no-start-access leaves them stopped until you click Start). The model’s declarations are explicit, so they start; a user’s saved forwards never start without --restore-forwards (see Operations Lens). --ui-config still works: its shortcuts win over a model forward with the same id, and its badges and tiers are kept.

The Port Forwards and Shortcuts tab of the local dashboard for the shop namespace. The api shortcut forwards service/api to 127.0.0.1:13080 and the web shortcut forwards service/web to 127.0.0.1:13000; both are running and healthy. The supervised forwards table lists the same two forwards with their local and remote ports, live links, health and process state.

piceli access examples/shop/app.py:pipeline --dashboard 9876: the shop example’s two declared forwards (access=app.access.forward(...) on api and web, see Deploy an app from source) as dashboard shortcuts, each probed and supervised on loopback.