[不指定 2024/06/08 10:35 | by 孤城浪子 ]

在 Kubernetes 中,您可能需要重置节点并将其重新加入集群,原因有很多,例如:

  • 节点出现故障需要重建
  • 节点操作系统需要升级
  • 节点配置需要更改
  • 节点需要从集群中永久移除

以下是一些关于如何重置 Kubernetes 节点并将其重新加入集群的步骤:

步骤 1: 驱逐节点(可选)

如果可能,最好先从集群中安全地驱逐节点。这将确保在节点不可用时,工作负载能够平稳地迁移到其他节点上。您可以使用以下命令驱逐节点:

kubectl drain <node-name> --ignore-daemonsets --delete-local-data 

步骤 2: 从集群中删除节点

使用以下命令从集群中删除节点:

kubectl delete node <node-name> 

步骤 3: 清理节点

在节点本身上,您需要清理所有 Kubernetes 组件和数据。这可以通过以下步骤完成:

  • 停止 kubelet 服务:

    systemctl stop kubelet 
  • 禁用 kubelet 服务:

    systemctl disable kubelet 
  • 清除所有 Kubernetes 相关文件和目录,包括:

    • /var/lib/kubelet/*
    • /etc/cni/net.d/*
    • /var/lib/cni/*
    • /etc/kubernetes/*

    您可以使用以下命令删除这些文件和目录:

    rm -rf /var/lib/kubelet/* /etc/cni/net.d/* /var/lib/cni/* /etc/kubernetes/* 

步骤 4: 重置网络配置(如果需要)

如果您的节点使用 CNI 网络插件,您可能还需要重置网络配置。这可以通过删除 CNI 配置文件并重启网络服务来完成。

步骤 5: 重新加入节点

清理节点后,您可以使用与最初添加节点时相同的步骤将其重新添加到集群中。这通常涉及运行由 kubeadm join 命令生成的加入脚本。

注意事项:

  • 在执行这些步骤之前,请备份您的 Kubernetes 集群和节点。
  • 这些步骤可能会导致数据丢失,因此请谨慎操作。
  • 在某些情况下,您可能需要执行其他步骤来重置和重新加入节点,具体取决于您的环境。
[不指定 2024/06/07 15:10 | by 孤城浪子 ]

由于网络原因,国内用户访问 Docker Hub 下载镜像的速度可能比较慢。为了提升下载速度,可以使用国内的 Docker 镜像加速器。以下是几个常用的选择:

1.  阿里云镜像加速器

  • 阿里云容器镜像服务提供了免费的镜像加速服务,可以显著提升 Docker 镜像下载速度。
  • 你需要先注册一个阿里云账号,然后在容器镜像服务控制台获取加速器地址。
  • 具体配置方法可以参考阿里云官方文档:https://help.aliyun.com/document_detail/60750.html

2.  DaoCloud 镜像加速器

  • DaoCloud 也提供了免费的 Docker 镜像加速器服务。
  • 你需要先注册一个 DaoCloud 账号,然后在控制台获取加速器地址。
  • 具体配置方法可以参考 DaoCloud 官方文档:https://www.daocloud.io/mirror#accelerator-doc

3.  网易云镜像加速器

  • 网易云容器镜像服务也提供免费的镜像加速服务。
  • 你需要先注册一个网易云账号,然后在容器镜像服务控制台获取加速器地址。
  • 具体配置方法可以参考网易云官方文档。

4.  腾讯云镜像加速器

  • 腾讯云容器镜像服务也提供免费的镜像加速服务。
  • 你需要先注册一个腾讯云账号,然后在容器镜像服务控制台获取加速器地址。
  • 具体配置方法可以参考腾讯云官方文档。

5.  七牛云镜像加速器

  • 七牛云容器镜像服务也提供免费的镜像加速服务。
  • 你需要先注册一个七牛云账号,然后在容器镜像服务控制台获取加速器地址。
  • 具体配置方法可以参考七牛云官方文档。

如何配置 Docker 镜像加速器:

  • 不同的操作系统配置方法有所不同,具体可以参考对应镜像加速器的官方文档。
  • 一般来说,需要修改 Docker 的配置文件 daemon.json,添加镜像加速器的地址。

需要注意的是:

  • 不同镜像加速器的加速效果可能会有所差异,建议根据自己的网络情况选择合适的加速器。
  • 一些镜像加速器可能会限制免费用户的流量或下载速度。
  • 使用镜像加速器可能会带来一些安全风险,建议选择信誉良好的服务提供商。
[不指定 2024/06/07 14:50 | by 孤城浪子 ]
如何在 /etc/apt/sources.list.d/docker.list 文件中使用国内源安装 Docker 的方法:

步骤:

  1. 备份原始文件: 在修改之前,最好备份一下原始的 docker.list 文件,以便出现问题时可以恢复:

    sudo cp /etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/docker.list.bak 
  2. 编辑 docker.list 文件: 使用你喜欢的文本编辑器打开 docker.list 文件:

    sudo nano /etc/apt/sources.list.d/docker.list 
  3. 添加国内源:

    将以下内容添加到 docker.list 文件中,替换掉原有的内容(如果存在)。可以选择其中一个源:

    • 阿里云:

      deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal stable 
    • 清华大学:

      deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu focal stable 
    • 网易:

      deb [arch=amd64] http://mirrors.163.com/docker-ce/linux/ubuntu focal stable 

    注意:

    • 将 focal 替换为你正在使用的 Ubuntu 版本代号。可以使用 lsb_release -cs 命令查看。
    • 建议选择地理位置上离你最近的镜像源,以获得更快的下载速度。
  4. 更新软件包列表并安装 Docker:

    sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io 
  5. 验证安装:

    sudo docker run hello-world 

    如果 Docker 安装成功,你将看到 "Hello from Docker!" 的输出信息。

现在,你已经成功配置了国内源,并可以使用 apt 命令安装和管理 Docker 了。

把 /etc/apt/sources.list 里面的内容全部注释掉,增加以下 Debian 12 的软件源:

国内常见镜像站点

Debian全球镜像站列表:https://www.debian.org/mirror/list 。

下面列出国内常用的镜像站点及 /etc/apt/sources.list 中的具体对应内容:

阿里云镜像站

deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib

腾讯云镜像站

deb https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib 
deb-src https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.tencent.com/debian-security/ bookworm-security main
deb-src https://mirrors.tencent.com/debian-security/ bookworm-security main
deb https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib

网易镜像站

deb https://mirrors.163.com/debian/ bookworm main non-free non-free-firmware contrib 
deb-src https://mirrors.163.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.163.com/debian-security/ bookworm-security main
deb-src https://mirrors.163.com/debian-security/ bookworm-security main
deb https://mirrors.163.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.163.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.163.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.163.com/debian/ bookworm-backports main non-free non-free-firmware contrib

华为镜像站

deb https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib 
deb-src https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb-src https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib

清华大学镜像站

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware 
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware

中科大镜像站

deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware 
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
[不指定 2024/06/02 16:58 | by 孤城浪子 ]
VMware 于2024年5月14日推出了桌面虚拟化平台的最新版本 Workstation Pro 17.5.2 和 Fusion Pro  13.5.2,并且宣布这两个产品对个人使用完全免费。大家可以点击下面的链接下载,下载需要登录 Broadcom Support  Portal,如果你在上面还没有账号的话可以注册一个。        

注意:只有这两个最新版本以及以后的版本才支持个人使用 (Personal Use) 免费许可。以 Workstation Pro  为例,在第一次启动时会要求你输入 license key,对于个人用户而言,你只需要选 Personal Use 就可以免费使用了。

  
      

需要注意的是,Workstation Pro 和 Fusion Pro 的免费仅适用于非商业用途,VMware 对于个人使用和商业用途的定义如下:

    
  • 个人使用: Workstation 或 Fusion 安装到电脑后,被用于运行非商业目的的虚拟机。个人使用明确排除将产品用于商业目的,包括经营或运营企业、组织、政府组织或教育机构等。
  • 商业用途:企业许可允许将产品用于商业目的,包括经营或运营企业、组织、政府组织或教育机构等。
    

把 Workstation Pro 和 Fusion Pro 用于商业用途的话需要购买企业许可。

 
分页: 1/69 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表