1 Star 0 Fork 13

xiao菜鸟/k8s 高可用集群 ansible 剧本部署

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
manifests_keepalived_haproxy.yaml 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
山河已无恙 提交于 2023-02-05 23:52 . init
# ansible 2.9.27
# # # config file = /root/ansible/ansible.cfg
# # # configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
# # # ansible python module location = /usr/lib/python2.7/site-packages/ansible
# # # executable location = /usr/bin/ansible
# # # python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
# #
# # #@File : manifests_keepalived_haproxy.yaml
# # #@Time : 2023/01/19 23:02:47
# # #@Author : Li Ruilong
# # #@Version : 1.0
# # #@Desc : HA 静态 pod 相关 配置文件 YAML 文件准备
# # #@Contact : liruilonger@gmail.com
---
# 创建 静态 pod 目录
- name: create manifests dir
file:
path: /etc/kubernetes/manifests/
state: directory
force: true
# 复制 keepalived haproxy 对应的 静态 pod yaml 文件
- name: copy manifests pod, haproxy and keepalived
copy:
src: ./file/manifests/keepalived.yaml
dest: /etc/kubernetes/manifests/keepalived.yaml
- name: copy manifests pod, haproxy and keepalived
copy:
src: ./file/manifests/haproxy.yaml
dest: /etc/kubernetes/manifests/haproxy.yaml
# 创建 haproxy 配置文件 目录
- name: create haproxy dir
file:
path: /etc/haproxy
state: directory
force: true
- name: copy /etc/haproxy/haproxy.cfg
copy:
src: ./file/haproxy/haproxy.cfg
dest: /etc/haproxy/haproxy.cfg
# 创建 keepalived 配置文件 目录
- name: create keepalived dir
file:
path: /etc/keepalived
state: directory
force: true
- name: copy /etc/keepalived/keepalived.conf
copy:
src: ./file/keepalived/keepalived.conf
dest: /etc/keepalived/keepalived.conf
- name: copy /etc/keepalived/check_apiserver.sh
copy:
src: ./file/keepalived/check_apiserver.sh
dest: /etc/keepalived/check_apiserver.sh
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/imajack/k8s_deploy_ansible.git
git@gitee.com:imajack/k8s_deploy_ansible.git
imajack
k8s_deploy_ansible
k8s 高可用集群 ansible 剧本部署
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385