From e0a141ab12b293b2cc2644d58330ae3d50f4f85f Mon Sep 17 00:00:00 2001 From: Loong Dai Date: Sun, 23 Feb 2025 20:14:27 +0800 Subject: [PATCH] README: add docker run (#11967) * README: add docker run Signed-off-by: Loong * Update README.md Co-authored-by: Robert Neumann * Update README.md Co-authored-by: Robert Neumann --------- Signed-off-by: Loong Co-authored-by: Robert Neumann --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 00c831d37..2c9857cdb 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,18 @@ You can get your invite [here](http://slack.k8s.io/) Below are several ways to use Kubespray to deploy a Kubernetes cluster. +### Docker + +Ensure you have installed Docker then + +```ShellSession +docker run --rm -it --mount type=bind,source="$(pwd)"/inventory/sample,dst=/inventory \ + --mount type=bind,source="${HOME}"/.ssh/id_rsa,dst=/root/.ssh/id_rsa \ + quay.io/kubespray/kubespray:v2.27.0 bash +# Inside the container you may now run the kubespray playbooks: +ansible-playbook -i /inventory/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml +``` + ### Ansible #### Usage