Skip to content

Remove k8s start command for now - #2290

Merged
katiewasnothere merged 1 commit into
apple:mainfrom
katiewasnothere:k8s_remove_start
Sep 21, 2026
Merged

katiewasnothere merged 1 commit into
apple:mainfrom
katiewasnothere:k8s_remove_start

Conversation

@katiewasnothere

Copy link
Copy Markdown
Contributor

Type of Change

  • Breaking change

Motivation and Context

The container k8s start command was added to the k8s subcommand to support starting a previously stopped cluster node. Since cluster nodes show up in the higher level container commands such as container ls and container stop, it made sense to have the ability to additionally start control plane nodes for the k8s clusters with container k8s start. However, since adding this subcommand, we've seen a number of issues around restarting (see 1) and we additionally have concerns about what the UX design should be for the k8s plugin moving forward.

Since this is an experimental feature, this PR will remove k8s start for now while we work on improving the plugin overall. This will not only make the code easier to reason about from a developer point of view but additionally gives users less ways to potentially shoot themselves in the foot while we improve the feature.

If a control plane node is stopped in a cluster, in lieu of k8s start, to restart it, a user will need to delete the cluster with container k8s delete and re-create it with container k8s create.

We're open to feedback on this decision and use cases for k8s start.

Testing

  • Added/updated docs

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 18, 2026
@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 24.98%
Integration 66.78%
Combined 76.24%

Comment thread docs/command-reference.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line would be stale (cluster restart)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also added a recovery section to the docs.

@egernst egernst left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one stale doc bit I think.

Suggestion, but not blocker - should we include the "how to recover" description you have in the PR header into docs/kubernetes.md?

Signed-off-by: Kathryn Baldauf <[email protected]>
@katiewasnothere
katiewasnothere merged commit be974a3 into apple:main Sep 21, 2026
3 checks passed
@katiewasnothere
katiewasnothere deleted the k8s_remove_start branch September 21, 2026 23:54
@sembsa

sembsa commented Sep 30, 2026

Copy link
Copy Markdown

You asked for use cases, so here is one from the GUI side.

I maintain Container Desktop, a macOS app that drives the container CLI. It surfaced k8s start as a Start button on any stopped cluster, and 1.5.0 turned that into Error: Unknown option '--name' (exit 64) — which names the wrong problem entirely. I have since gated the button on the CLI version and replaced it with an explanation, so this is not a request to revert; #2156 is real and shipping a restart that fails after an address change is worse than not shipping one.

Two things I would still raise.

The stop path outlived the start path. As the PR notes, cluster nodes show up in container ls and container stop. So the tool still offers a one-word way into a stopped cluster and no way out of it except delete + create. Someone tidying up with container stop <name>, or scripting a shutdown across their containers, can now put a cluster into a state that costs them everything inside it, without ever having typed anything with k8s in it. If k8s start stays out for a while, it might be worth having container stop refuse — or at least warn — on a node carrying com.apple.container.plugin=k8s. That closes the foot-gun at the end where people actually reach for it.

What delete + create costs. It is not the same operation as a restart: deployed workloads are gone, anything pushed in with k8s load-image has to be loaded again, and the kubeconfig context is rebuilt. For a cluster that exists to hold a work-in-progress deployment, that is the difference between "come back tomorrow" and "set it all up again". The cost is not the recreate itself so much as everything the recreate discards.

The use case, concretely: a long-lived local cluster on a laptop that gets stopped for the same reasons anything on a laptop gets stopped — reclaiming RAM, a reboot, a service restart — and is expected to come back with its contents. That is the shape I see people using it in.

Happy to test whatever the redesign lands on. From where I sit the awkward part is not the missing command, it is that stopping is still one step and starting is now none.

andrew-waters added a commit to andrew-waters/orchard that referenced this pull request Sep 30, 2026
The container package pin moves from 1.4.1 to 1.5.0, which pulls
containerization 0.47.0. Nothing Orchard calls has changed shape. The
release fixes GHSA-44v5-vx46-ghv6 in the k8s plugin (kubeconfig values
from the guest are sanitised before merging), which Orchard gets through
the CLI.

1.5.0 removed `container k8s start` (apple/container#2290), so a stopped
cluster can only be deleted and created again. Start is replaced by
Recreate, which does both in one step. It opens the Create Cluster sheet
filled in from the cluster: name, CPUs and memory from the node, the
Kubernetes version and the CNI manifest. A node records its image without
the tag, so Orchard now remembers what each cluster was created with, and
for older clusters recovers the version by matching the image digest
against the plugin default and the listed versions, asking when neither
matches. A plain container start skips the node boot, readiness wait and
kubeconfig write the old command did, so stopped cluster nodes no longer
offer Start anywhere in the Containers view, the menu bar or the command
palette, and startContainer refuses them as a backstop.

Node preparation now uses the node image's own iptables backend instead
of iptables-nft (apple/container#2120, closed), so a kernel without
nftables no longer breaks cluster creation. K8sKernelAdvisor and its
"Cluster Creation Will Fail" state go; the node-prep failure keeps its
own message but no longer blames the kernel.

1.5.0 also reads the Kubernetes version from the node image's tag
(apple/container#2271), so choosing one now means something. The node
image field becomes a version menu: the plugin's own default, read from
`k8s create --help`, then the newest kindest/node release of each minor
from 1.31, fetched from Docker Hub and pinned by digest, then a custom
image, which must carry a tag because 1.5.0 refuses one without. The
sheet's Advanced section takes a CNI manifest for the new --cni option.

DNS domains can be created with --localhost, so a domain resolves to an
address pf redirects to the Mac's 127.0.0.1. Before 1.5.0 adding or
removing that rule reloaded all of pf and cut egress for every running
container (apple/container#2256). The CLI lists names only, so the
redirect address is read from the domain's resolver file.

Fixes:
- The missing-plugin probe matches 1.5.0's "unknown command 'k8s'"
  wording as well as the old "Plugin ... not found".
- An image entrypoint of [""] clears the entrypoint rather than becoming
  an empty argv[0], matching the CLI from 1.5.0.
- A stopped container, machine or cluster no longer keeps its charts,
  where a sparse window showed a "Collecting" spinner for samples that
  were never coming.
melonfleet added a commit to melonfleet/flotilla that referenced this pull request Oct 5, 2026
…tart

container 1.5.0 removed `k8s start` (apple/container#2290): restarts
were unreliable, especially after the node came back on a new IP. The
release notes and the tagged docs give the same recovery: delete the
cluster, then create it again. Flotilla still offered Start, which on
1.5 fails with "Unknown option '--name'".

- Start is gone from the Clusters row, ContainerCLI, AppModel and the
  allowlist. Default-deny means the spec goes with the command, and a
  test now holds that `k8s start` is refused.
- Recreate takes its place for a cluster that is not running. It is one
  operation with one progress panel: delete, then create with the same
  name, CPUs and memory, streaming the create's own progress. `k8s
  list` prints memory as "4096 MB" and `--memory` wants "4096M";
  K8sNode.memoryFlag converts, and anything unparseable falls back to
  the CLI default rather than sending a refused value.
- It always asks. The confirmation says why first: container 1.5
  cannot restart a stopped cluster. Then what is kept and what is lost,
  including that a custom node image or CNI cannot be kept, because
  nothing this app can read records them.

Also from 1.5 (apple/container#2271): `--node-image` must name a tag,
because the tag now picks the Kubernetes version and the CLI refuses an
untagged or digest-only image before provisioning. A new value shape,
taggedImageReference, checks the last path component, so a registry
port is not mistaken for a tag; every other image field still accepts
an untagged reference. The create form's field checks the same shape.
It had checked a looser one, which would have left Create disabled with
nothing on screen saying why.

Verified on a real cluster: fx-k8s was created, stopped with `container
stop` as the docs describe, and recreated from the app. It came back
running at 2 CPUs and 4096 MB on a new address, so it really was
recreated rather than restarted. The cluster's poll also logs an
observed "Started" beside "Recreated"; that duplicate is logged as a
follow-up.

`k8s create --cni` is an opportunity rather than a fix, and is left for
later. Decision recorded as a Q22 amendment. 514 tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
katiewasnothere added a commit to katiewasnothere/container that referenced this pull request Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants