Ansible自动化运维之部署Kubernetes K8S

69次阅读
没有评论

ansible文档:Installing Ansible — Ansible Community Documentation

Kubernetes(K8S)简介和安装部署详细教程_kubernetes安装部署-CSDN博客

  1. 主控端安装
sudo apt update
sudo apt install ansible -y
ansible --version

输出类似这样的说明安装成功了:

ansible [core 2.x.x]
  config file = /etc/ansible/ansible.cfg
  ...

添加被控节点:vi /etc/ansible/hosts

[web_servers]
192.168.2.111
192.168.2.112

测试连接​

使用 ping 模块测试与被管理节点的连通性(需提前配置 SSH 免密登录):

ansible all -m ping

root@k8s111:/home/k8s# apt update -y
Ign:1 cdrom://[Debian GNU/Linux 12.11.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250517-09:52] bookworm InRelease
Err:2 cdrom://[Debian GNU/Linux 12.11.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250517-09:52] bookworm Release
  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Reading package lists... Done
E: The repository 'cdrom://[Debian GNU/Linux 12.11.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250517-09:52] bookworm Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

换成腾讯源之后,还是报:

E: The repository 'http://mirrors.cloud.tencent.com/debian-security bookworm/updates Release' does not have a Release file.

正文完
 0
wujingquan
版权声明:本站原创文章,由 wujingquan 于2025-06-09发表,共计1162字。
转载说明:Unless otherwise specified, all articles are published by cc-4.0 protocol. Please indicate the source of reprint.
评论(没有评论)