k3s 单机部署

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

[INFO]  Finding release for channel stable
[INFO]  Using v1.30.6+k3s1 as release
[INFO]  Downloading hash rancher-mirror.rancher.cn/k3s/v1.30.6-k3s1/sha256sum-amd64.txt
[INFO]  Downloading binary rancher-mirror.rancher.cn/k3s/v1.30.6-k3s1/k3s
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Skipping installation of SELinux RPM
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Skipping /usr/local/bin/ctr symlink to k3s, command exists in PATH at /usr/bin/ctr
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO]  systemd: Starting k3s
# systemctl status k3s

● k3s.service - Lightweight Kubernetes
     Loaded: loaded (/etc/systemd/system/k3s.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2024-11-07 22:53:00 CST; 2min 41s ago
       Docs: https://k3s.io
    Process: 17826 ExecStartPre=/bin/sh -xc ! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service 2>/dev/null (code=exited, status=0/SUCCESS)
    Process: 17828 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status=0/SUCCESS)
    Process: 17829 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
   Main PID: 17830 (k3s-server)
      Tasks: 17
     Memory: 513.7M
     CGroup: /system.slice/k3s.service
             └─17830 /usr/local/bin/k3s server
# kubectl get node

NAME     STATUS   ROLES                  AGE     VERSION
donkey   Ready    control-plane,master   3m54s   v1.30.6+k3s1

# kubectl get node -o wide
 
NAME     STATUS   ROLES                  AGE     VERSION        INTERNAL-IP     EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION       CONTAINER-RUNTIME
donkey   Ready    control-plane,master   5m40s   v1.30.6+k3s1   192.168.31.10   <none>        Ubuntu 20.04.1 LTS   5.15.0-101-generic   docker://24.0.5
# kubectl get ns
NAME              STATUS   AGE
default           Active   30m
kube-node-lease   Active   30m
kube-public       Active   30m
kube-system       Active   30m
# kubectl get all -n kube-system
NAME                                          READY   STATUS              RESTARTS   AGE
pod/coredns-7b98449c4-wq8j4                   0/1     ContainerCreating   0          31m
pod/helm-install-traefik-677s8                0/1     ContainerCreating   0          31m
pod/helm-install-traefik-crd-ldpbp            0/1     ContainerCreating   0          31m
pod/local-path-provisioner-595dcfc56f-k5xq5   0/1     ContainerCreating   0          31m
pod/metrics-server-cdcc87586-lvv5x            0/1     ContainerCreating   0          31m

NAME                     TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                  AGE
service/kube-dns         ClusterIP   10.43.0.10     <none>        53/UDP,53/TCP,9153/TCP   31m
service/metrics-server   ClusterIP   10.43.89.160   <none>        443/TCP                  31m

NAME                                     READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/coredns                  0/1     1            0           31m
deployment.apps/local-path-provisioner   0/1     1            0           31m
deployment.apps/metrics-server           0/1     1            0           31m

NAME                                                DESIRED   CURRENT   READY   AGE
replicaset.apps/coredns-7b98449c4                   1         1         0       31m
replicaset.apps/local-path-provisioner-595dcfc56f   1         1         0       31m
replicaset.apps/metrics-server-cdcc87586            1         1         0       31m

NAME                                 STATUS    COMPLETIONS   DURATION   AGE
job.batch/helm-install-traefik       Running   0/1           31m        31m
job.batch/helm-install-traefik-crd   Running   0/1           31m        31m

丸辣,镜像根本下不了!!!

离线安装

https://github.com/k3s-io/k3s/releases

curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh > install.sh
mkdir -p /var/lib/rancher/k3s/agent/images/
cp ./k3s-airgap-images-amd64.tar /var/lib/rancher/k3s/agent/images/
chmod +x k3s
cp k3s /usr/local/bin/k3s
INSTALL_K3S_SKIP_DOWNLOAD=true ./install.sh --docker

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

颹蕭蕭

白嫖?

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值