生产环境的开源容器管理平台--Rancher入门教程 4 自定义Catalog

这里写图片描述

Rancher是一个用于部署和管理生产环境的容器的开源平台,它与Kubernetes/Mesos/Docker Swarm进行集成。使得在任何硬件环境上容器化应用变得触手可及。在这个系列的教程中我们将会学习如何使用rancher,
上篇文章介绍如何在添加了Host的Cattle环境中运行certified catalog,在本文中,我们将学习一下如何在rancher中添加自定义的catalog.

disable certified设定

在上篇文章中我们提到Rancher Certified Catalog和Community Contributed的catalog,目前的76个里面除了2个是rancher lib certified之外,剩余的都是community contributed的。 而如果希望Catalog里面出现的仅仅是自己的内容的话则需要Disable这两项设定。

这里写图片描述

事前准备

这里写图片描述

构成说明

文件目录名称 说明以及限制事项
templates 与Rancher所支持的4种格式相对应,templates即为Default的Cattle的写法,剩余的三种分别为kubernetes-templates/mesos-templates/swarm-templates
nginx entry的名称
0 按照0,1,2的顺序创建目录
docker-compose.yml 用于创建stack的docker-compose.yml
rancher-compose.yml rancher为了便于管理catalog,自己封装的一层的格式,其何config.yml一起用于设定图形界面显示的catalog相关的各种信息
catalogIcon-nginx.svg 注意此处名字写法固定,没有发挥的余地,格式也是需要svg,可以考虑使用Inkscape等工具转换
config.yml 用于设定图形界面显示的catalog相关的各种信息

config.yml

[root@liumiaocn nginx]# cat templates/nginx/config.yml
name:  nginx
description: |
   nginx image
version:  1.0.0
category:  WEB
maintainer:  liumiaocn
license:  Apache 2
projectURL: https://github.com/ liumiaocn/rancher-cattle-autocatalog
[root@liumiaocn nginx]#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

docker-compose.yml

[root@liumiaocn nginx]# cat templates/nginx/0/docker-compose.yml
#  nginx image
nginx:
  image:  nginx
[root@liumiaocn nginx]#
  • 1
  • 2
  • 3
  • 4
  • 5

rancher-compose.yml

[root@liumiaocn nginx]# cat templates/nginx/0/rancher-compose.yml
.catalog:
  name:  nginx
  version:  1.0.0
  description:  nginx image
  uuid: #
  minimum_rancher_version: #
  questions: #
[root@liumiaocn nginx]#
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

设定自定义catalog

这里写图片描述

确认结果

这里写图片描述

view detail

这里写图片描述

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://www.cnblogs.com/captainbed

猜你喜欢

转载自www.cnblogs.com/firsttry/p/10189167.html