big-loser / kubernetes-ansible Goto Github PK
View Code? Open in Web Editor NEWDeploy Kubernetes with ansible
License: GNU General Public License v3.0
Deploy Kubernetes with ansible
License: GNU General Public License v3.0
可以知道当前使用有什么模块,也方便部署~
感谢作者提供的帮助,现在已经全部跑完任务,发现有以下几个小问题:
name: 拷贝 kubernetes 二进制包 这一步由于是要下载,所以有时候会等待比较久,而且master和minions都会执行相同的操作,所以建议把安装包直接放到files用copy会快很多
由于我不是用root,而是用具有sudo权限的用户来执行,所以template过去的文件会放到用户的家目录而不是/root下,当下一个任务需要执行命令调用文件就会出错,可以使用
args: chdir: /root/
增加到执行命令的任务中来切换到/root目录再执行命令
在roles/minions/templates/kube-proxy.j2中由于涉及到获取ip地址{{ ansible_eth0.ipv4.address }},有时候网卡的名称不一定是eth0,所以我要手动改成对应的当前网卡名称才能获取成功
最后的那个任务需要执行
shell: kubectl create -f https://raw.githubusercontent.com/kubernetes/ingress/master/examples/rbac/nginx/nginx-ingress-controller-service.yml
是否需要改为
shell: /opt/kubernetes/bin/kubectl create -f https://raw.githubusercontent.com/kubernetes/ingress/master/examples/rbac/nginx/nginx-ingress-controller-service.yml
还有一个是我执行该项目的时候是使用ansible-playbook -i hosts site.yaml
当我执行ansible -i hosts site.yaml会显示[WARNING]: No hosts matched, nothing to do
https://raw.githubusercontent.com/kubernetes/ingress/
上面网址已经不存在了,能不能通过其它方式
-- Unit docker.service has failed.
docker服务启动失败
环境是centos7.3
不好意思再麻烦到你
根据你之前步骤提示,一直运行没有报错,
TASK [minions : 生成bootstrap 文件 2] ***********************************************************************************************************************************************************
changed: [192.168.0.41]
changed: [192.168.0.42]
TASK [minions : 生成bootstrap 文件 3] ***********************************************************************************************************************************************************
changed: [192.168.0.41]
changed: [192.168.0.42]
TASK [minions : 生成bootstrap 文件 4] ***********************************************************************************************************************************************************
changed: [192.168.0.41]
changed: [192.168.0.42]
TASK [minions : 移动bootstrap 文件] *************************************************************************************************************************************************************
fatal: [192.168.0.41]: FAILED! => {"changed": true, "cmd": "mv /root/bootstrap.kubeconfig /etc/kubernetes", "delta": "0:00:00.005279", "end": "2017-08-16 11:32:37.212218", "failed": true, "rc": 1, "start": "2017-08-16 11:32:37.206939", "stderr": "mv: cannot stat ‘/root/bootstrap.kubeconfig’: No such file or directory", "stderr_lines": ["mv: cannot stat ‘/root/bootstrap.kubeconfig’: No such file or directory"], "stdout": "", "stdout_lines": []}
fatal: [192.168.0.42]: FAILED! => {"changed": true, "cmd": "mv /root/bootstrap.kubeconfig /etc/kubernetes", "delta": "0:00:00.005284", "end": "2017-08-16 11:32:37.218361", "failed": true, "rc": 1, "start": "2017-08-16 11:32:37.213077", "stderr": "mv: cannot stat ‘/root/bootstrap.kubeconfig’: No such file or directory", "stderr_lines": ["mv: cannot stat ‘/root/bootstrap.kubeconfig’: No such file or directory"], "stdout": "", "stdout_lines": []}
直到节点这步发现没有生成到bootstrap.kubeconfig,是BOOTSTRAP_TOKEN的问题吗,怎么排错?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.