Skip to content

Commit defd81d

Browse files
committed
Remove reference to docker-compose file.
The docker-composie file hasn't been maintained in ages. Also update the k3d and docker image docs. Signed-off-by: Brad Davidson <[email protected]>
1 parent 95fbe79 commit defd81d

File tree

1 file changed

+20
-30
lines changed

1 file changed

+20
-30
lines changed

docs/advanced/advanced.md

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -365,47 +365,37 @@ There are several ways to run K3s in Docker:
365365
<Tabs>
366366
<TabItem value='K3d' default>
367367
368-
[k3d](https://github.com/k3d-io/k3d) is a utility designed to easily run K3s in Docker.
368+
[k3d](https://github.com/k3d-io/k3d) is a utility designed to easily run multi-node K3s clusters in Docker.
369369
370-
It can be installed via the [brew](https://brew.sh/) utility on MacOS:
370+
k3d makes it very easy to create single- and multi-node k3s clusters in docker, e.g. for local development on Kubernetes.
371371
372-
```bash
373-
brew install k3d
374-
```
375-
376-
</TabItem>
377-
<TabItem value="Docker Compose">
378-
379-
A `docker-compose.yml` in the K3s repo serves as an [example](https://github.com/k3s-io/k3s/blob/master/docker-compose.yml) of how to run K3s from Docker. To run `docker-compose` in this repo, run:
380-
381-
```bash
382-
docker-compose up --scale agent=3
383-
# kubeconfig is written to current dir
384-
385-
kubectl --kubeconfig kubeconfig.yaml get node
386-
387-
NAME STATUS ROLES AGE VERSION
388-
497278a2d6a2 Ready <none> 11s v1.13.2-k3s2
389-
d54c8b17c055 Ready <none> 11s v1.13.2-k3s2
390-
db7a5a5a5bdd Ready <none> 12s v1.13.2-k3s2
391-
```
392-
393-
To only run the agent in Docker, use `docker-compose up agent`.
372+
See the [Installation](https://k3d.io/#installation) documentation for more information on how to install and use k3d.
394373
395374
</TabItem>
396375
<TabItem value="Docker">
397376
398-
To use Docker, `rancher/k3s` images are also available to run the K3s server and agent.
377+
To use Docker, `rancher/k3s` images are also available to run the K3s server and agent.
399378
Using the `docker run` command:
400379
401380
```bash
402381
sudo docker run \
403-
-d --tmpfs /run \
404-
--tmpfs /var/run \
405-
-e K3S_URL=${SERVER_URL} \
406-
-e K3S_TOKEN=${NODE_TOKEN} \
407-
--privileged rancher/k3s:vX.Y.Z
382+
--privileged \
383+
--name k3s-server-1 \
384+
--hostname k3s-server-1 \
385+
-p 6443:6443 \
386+
-d rancher/k3s:v1.24.10-k3s1 \
387+
server
388+
```
389+
:::note
390+
You must specify a valid K3s version as the tag; the `latest` tag is not maintained.
391+
Docker images do not allow a `+` sign in tags, use a `-` in the tag instead.
392+
:::
393+
394+
Once K3s is up and running, you can copy the admin kubeconfig out of the Docker container for use:
395+
```bash
396+
sudo docker cp k3s-server-1:/etc/rancher/k3s/k3s.yaml ~/.kube/config
408397
```
398+
409399
</TabItem>
410400
</Tabs>
411401

0 commit comments

Comments
 (0)