生产环境的开源容器管理平台--Rancher入门教程(5):自定义Catalog工具
2016-09-28 21:30
1196 查看
Rancher是一个用于部署和管理生产环境的容器的开源平台,它与Kubernetes/Mesos/Docker Swarm进行集成。使得在任何硬件环境上容器化应用变得触手可及。在这个系列的教程中我们将会学习如何使用rancher, 上篇文章介绍了如何在rancher中添加自定义的catalog,由于较为繁琐,本文介绍一下相关自动化工具。
yo rancher-catalog
在上篇文章中介绍了自定义catalog的方法,但是文件较多,限制很多,从文件名到内容很小的地方都可能造成不能正常显示,使用npm的rancher-catalog这个小工具可以绕开一部分问题。安装
npm install -g yo npm install -g generator-rancher-catalog
执行方法
yo rancher-catalog
demo
生成
设定
确认
rancher-cattle-autocatalog
使用npm的yo,前提是还必须要安装npm,所以也可以使用rancher-cattle-autocatalog进行处理。使用例
[root@liumiaocn rancher]# pwd /tmp/rancher [root@liumiaocn rancher]# ll total 0 [root@liumiaocn rancher]# git clone https://github.com/liumiaocn/rancher-cattle-autocatalog Cloning into 'rancher-cattle-autocatalog'... remote: Counting objects: 18, done. remote: Compressing objects: 100% (14/14), done. remote: Total 18 (delta 1), reused 14 (delta 0), pack-reused 0 Unpacking objects: 100% (18/18), done. [root@liumiaocn rancher]# cd rancher-cattle-autocatalog/scripts/ [root@liumiaocn scripts]# ll total 8 -rw-r--r--. 1 root root 2525 Sep 28 20:39 create_rancher_cattle_catalog.sh drwxr-xr-x. 3 root root 22 Sep 28 20:39 DEMO -rw-r--r--. 1 root root 401 Sep 28 20:39 init.conf [root@liumiaocn scripts]# cat init.conf DEMO @ nginx DEMONAME @ nginx DEMODESCRIPTION @ nginx image DEMOVERSION @ 1.0.0 DEMOCATAGORY @ WEB DEMOMAINTAINER @ liumiaocn@outlook.com DEMOLICENSE @ Apache 2 DEMOURL @ liumiaocn\/rancher-cattle-autocatalog DEMOIMAGE @ nginx DEMOPORTMAPPING @ 80:80 DEMOUUID @ DEMOMINIMUM_VERSION @ DEMOQUESTIONS @ [root@liumiaocn scripts]# [root@liumiaocn scripts]# sh create_rancher_cattle_catalog.sh init.conf [root@liumiaocn scripts]# ll total 8 -rw-r--r--. 1 root root 2525 Sep 28 20:39 create_rancher_cattle_catalog.sh drwxr-xr-x. 3 root root 22 Sep 28 20:39 DEMO -rw-r--r--. 1 root root 401 Sep 28 20:39 init.conf drwxr-xr-x. 3 root root 22 Sep 28 20:39 nginx [root@liumiaocn scripts]# mv nginx/templates/ .. [root@liumiaocn scripts]# rm -rf nginx/ [root@liumiaocn scripts]# cd .. [root@liumiaocn rancher-cattle-autocatalog]# ll total 16 -rw-r--r--. 1 root root 11357 Sep 28 20:39 LICENSE -rw-r--r--. 1 root root 64 Sep 28 20:39 README.md drwxr-xr-x. 3 root root 72 Sep 28 20:44 scripts drwxr-xr-x. 3 root root 18 Sep 28 20:44 templates [root@liumiaocn rancher-cattle-autocatalog]# git add * [root@liumiaocn rancher-cattle-autocatalog]# git commit -m "add nginx rancher catalog" [master e64daec] add nginx rancher catalog 5 files changed, 1701 insertions(+) create mode 100644 templates/nginx/0/docker-compose.yml create mode 100644 templates/nginx/0/rancher-compose.yml create mode 100644 templates/nginx/README.md create mode 100644 templates/nginx/catalogIcon-nginx.svg create mode 100644 templates/nginx/config.yml [root@liumiaocn rancher-cattle-autocatalog]# git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) Username for 'https://github.com': liumiaocn Password for 'https://liumiaocn@github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/liumiaocn/rancher-cattle-autocatalog/' [root@liumiaocn rancher-cattle-autocatalog]#
上篇文章的例子即为使用这种方法自动生成。熟悉格式之后不用任何工具也是一样。
相关文章推荐
- 生产环境的开源容器管理平台--Rancher入门教程(4):自定义Catalog
- 生产环境的开源容器管理平台--Rancher入门教程(2): Host
- 生产环境的开源容器管理平台--Rancher入门教程(3): Certified Catalog
- 生产环境的开源容器管理平台--Rancher入门教程(1): Environment
- 开源自动化配置管理工具Puppet入门教程
- Rancher:一个开源的企业级全栈化容器部署及管理平台
- 谷歌生产级别开源容器调度和管理工具Kubernetes学习二
- 开源自动化配置管理工具Puppet入门教程
- 开源自动化配置管理工具Puppet入门教程(1)
- Rancher是一个开源的企业级全栈化容器部署及管理平台
- 谷歌生产级别开源容器调度和管理工具Kubernetes学习
- 前端接口自动化测试工具-DOClever(免费开源的接口管理平台)使用介绍
- Linux进程管理工具 Supervisord 的安装 及 入门教程
- C#入门教程(一)–.Net平台技术介绍、C#语言及开发工具介绍-打造C#学习教程
- 实用PHP依赖管理工具Composer入门教程
- 19-代码管理工具git入门教程
- Unix/Linux环境C编程入门教程(33) 命令和鼠标管理用户和组
- Rancher 容器管理平台-免费视频培训-链接及内容-第三季
- 开源docker管理平台rancher 安装部署
- 手游公司运维之利用Rundeck自动化运维工具和Shell脚本构建测试环境代码发布平台和生产环境代码发布平台