docker

关注公众号 jb51net

关闭
首页 > 网站技巧 > 服务器 > 云和虚拟化 > docker > k3s docker部署Kubernetes

k3s 通过docker部署 Kubernetes的方法步骤

作者:Jon_c

本文主要介绍了k3s 通过docker部署 Kubernetes的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

宿主机:

"Debian GNU/Linux 12 (bookworm)

docker

 docker version
Client:
 Version:           20.10.24+dfsg1
 API version:       1.41
 Go version:        go1.19.8
 Git commit:        297e128
 Built:             Thu May 18 08:38:34 2023
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.24+dfsg1
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.19.8
  Git commit:       5d6db84
  Built:            Thu May 18 08:38:34 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.20~ds1
  GitCommit:        1.6.20~ds1-1+b1
 runc:
  Version:          1.1.5+ds1
  GitCommit:        1.1.5+ds1-1+deb12u1
 docker-init:
  Version:          0.19.0
  GitCommit:

Kubernetes

sudo curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn sh -s - --docker

查看所有pods

sudo k3s kubectl get pods  -A
NAME                                      READY   STATUS      RESTARTS      AGE
coredns-576bfc4dc7-lbpbx                  1/1     Running     3 (10m ago)   24h
helm-install-traefik-4bbrc                0/1     Completed   1             24h
helm-install-traefik-crd-pmhjj            0/1     Completed   0             24h
local-path-provisioner-6795b5f9d8-xn7l7   1/1     Running     0             24h
metrics-server-557ff575fb-swkj8           1/1     Running     4 (10m ago)   24h
svclb-traefik-ff6a2fe0-k9lx9              2/2     Running     0             24h
traefik-5fb479b77-z8c47                   1/1     Running     4 (10m ago)   24h

查看起来的docker容器

docker ps
CONTAINER ID   IMAGE                              COMMAND                  CREATED          STATUS          PORTS     NAMES
11d874df2b10   0c1204a22f13                       "entry install --set…"   2 seconds ago    Up 1 second               k8s_helm_helm-install-traefik-tgmhn_kube-system_ed3a5bd6-ed85-4871-b57e-e784714ca8a9_1
b8252bcd663f   rancher/mirrored-coredns-coredns   "/coredns -conf /etc…"   13 seconds ago   Up 11 seconds             k8s_coredns_coredns-576bfc4dc7-k6vft_kube-system_deed676e-f250-4a93-88cb-2234b4b66e53_0
37982bef167f   rancher/local-path-provisioner     "local-path-provisio…"   14 seconds ago   Up 13 seconds             k8s_local-path-provisioner_local-path-provisioner-6795b5f9d8-xnmcn_kube-system_52b145b5-fe7c-4046-a99d-b828baa566e8_0
c8ecb8764836   rancher/mirrored-pause:3.6         "/pause"                 27 seconds ago   Up 25 seconds             k8s_POD_helm-install-traefik-tgmhn_kube-system_ed3a5bd6-ed85-4871-b57e-e784714ca8a9_0
cef9616dbda4   rancher/mirrored-pause:3.6         "/pause"                 27 seconds ago   Up 26 seconds             k8s_POD_local-path-provisioner-6795b5f9d8-xnmcn_kube-system_52b145b5-fe7c-4046-a99d-b828baa566e8_0
b61875381946   rancher/mirrored-pause:3.6         "/pause"                 27 seconds ago   Up 26 seconds             k8s_POD_coredns-576bfc4dc7-k6vft_kube-system_deed676e-f250-4a93-88cb-2234b4b66e53_0
27dbfa46c2c5   rancher/mirrored-pause:3.6         "/pause"                 27 seconds ago   Up 26 seconds             k8s_POD_metrics-server-557ff575fb-nn42w_kube-system_5a68181e-633c-4664-85fb-86171cf06d1e_0
a0904d243b85   rancher/mirrored-pause:3.6         "/pause"                 27 seconds ago   Up 26 seconds             k8s_POD_helm-install-traefik-crd-hhrs2_kube-system_fe4b04df-b8e4-4867-92c0-df09b47a5c30_0
➜  ~

停止

sudo /usr/local/bin/k3s-killall.sh

删除

sudo /usr/local/bin/k3s-uninstall.sh

到此这篇关于k3s 通过docker部署 Kubernetes的方法步骤的文章就介绍到这了,更多相关k3s docker部署Kubernetes内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

您可能感兴趣的文章:
阅读全文