You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/command-reference.md
+172Lines changed: 172 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1579,3 +1579,175 @@ container system property list
1579
1579
# output as JSON for scripting
1580
1580
container system property list --format json
1581
1581
```
1582
+
1583
+
## Kubernetes Cluster Management
1584
+
1585
+
`container k8s`manages local single-node Kubernetes clusters backed by container VMs. Each cluster runs a Kubernetes control-plane node inside a container using `kindest/node` and `kubeadm`.
1586
+
1587
+
> [!IMPORTANT]
1588
+
> The `k8s` command is an experimental feature and its subcommands and options are subject to change.
1589
+
1590
+
### `container k8s create`
1591
+
1592
+
Creates and starts a local Kubernetes cluster. Pulls the node image if needed, runs `kubeadm init`, installs the kindnet CNI, and merges the cluster credentials into `~/.kube/config`.
# create a cluster that removes itself when stopped
1629
+
container k8s create --name temp-cluster --rm
1630
+
```
1631
+
1632
+
### `container k8s start`
1633
+
1634
+
Starts a stopped Kubernetes cluster and refreshes its entry in `~/.kube/config` (the container IP can change between starts).
1635
+
1636
+
**Usage**
1637
+
1638
+
```bash
1639
+
container k8s start [--name <name>] [--debug]
1640
+
```
1641
+
1642
+
**Options**
1643
+
1644
+
* `--name <name>`: Cluster name (default: `k8s-dev`)
1645
+
1646
+
**Examples**
1647
+
1648
+
```bash
1649
+
# start the default cluster
1650
+
container k8s start
1651
+
1652
+
# start a named cluster
1653
+
container k8s start --name my-cluster
1654
+
```
1655
+
1656
+
### `container k8s delete (rm)`
1657
+
1658
+
Stops and deletes a Kubernetes cluster container and removes its entry from `~/.kube/config`.
1659
+
1660
+
**Usage**
1661
+
1662
+
```bash
1663
+
container k8s delete [--name <name>] [--debug]
1664
+
```
1665
+
1666
+
**Options**
1667
+
1668
+
* `--name <name>`: Cluster name (default: `k8s-dev`)
1669
+
1670
+
**Examples**
1671
+
1672
+
```bash
1673
+
# delete the default cluster
1674
+
container k8s delete
1675
+
1676
+
# delete a named cluster
1677
+
container k8s delete --name my-cluster
1678
+
container k8s rm --name my-cluster
1679
+
```
1680
+
1681
+
### `container k8s list (ls)`
1682
+
1683
+
Lists all Kubernetes clusters with their status and node image.
1684
+
1685
+
**Usage**
1686
+
1687
+
```bash
1688
+
container k8s list [--debug]
1689
+
```
1690
+
1691
+
**Examples**
1692
+
1693
+
```bash
1694
+
container k8s list
1695
+
container k8s ls
1696
+
```
1697
+
1698
+
### `container k8s load-image`
1699
+
1700
+
Exports an image from the local `container` image store and imports it into the cluster's containerd (in the `k8s.io` namespace) so that Kubernetes can schedule pods that reference it.
* `<image>`: Image reference to load (e.g. `my-app:latest`)
1711
+
1712
+
**Options**
1713
+
1714
+
* `--name <name>`: Cluster name (default: `k8s-dev`)
1715
+
* `--platform <platform>`: Platform of the image variant to load from a multi-arch image (format: os/arch[/variant], default: `linux/<host-arch>`). Use this when the local store contains a multi-arch manifest list and you want to select a specific variant.
Fetches the current kubeconfig from a running cluster and merges its context into a kubeconfig file. Use this to refresh credentials after a cluster restart or to write to an alternate config file.
0 commit comments