# deploy_k8s **Repository Path**: yeel/deploy_k8s ## Basic Information - **Project Name**: deploy_k8s - **Description**: 用Ansible脚本部署Kubernets 1.23.0 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-03-20 - **Last Updated**: 2022-03-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Ansible常识 ### 安装 ```shell sudo yum install ansible ``` 如果提示找不到,则执行 ```shell sudo yum install epel-release ``` 解释: ansible是EPEL仓库的包,所以需要安装 epel-release(Ansible is part of the Extra Packages for Enterprise Linux (EPEL) repository so you need to install epel-release package first) ### 配置场景 ```shell vim /etc/ansible/hosts [bigdata] 192.168.2.15 192.168.2.16 192.168.2.19 192.168.2.20 ``` ### ping 模块 测试连通性 ansible bigdata -m ping ### cron 模块 同步时钟源 ```shell ansible bigdata -m cron -a 'name="test cron1" job="ntpdate time1.aliyun.com" minute=0 hour=*/1' ``` ### copy 模块 ```shell ansible bigdata -m copy -a "src=/etc/hostname dest=/etc/hostname" ``` ## 部署本项目 第1步:在所有节点上执行 ```shell ansible-playbook -v deploy_all_playbook.yml -f 10 ``` 第2步:在Master节点上执行 ```shell ansible-playbook -v deploy_master_playbook.yml -f 10 ```