• Helm chart仓库操作


    配置国内存放 chart 仓库的地址


    chart图标是存放资源清单的东西,它是存在于远程仓库当中的 

    • 阿里云仓库(https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts)
    • 官方仓库(https://hub.kubeapps.com/charts/incubator)官方 chart 仓库,国内可能无法访问。
    • 微软仓库(http://mirror.azure.cn/kubernetes/charts/)这个仓库推荐,基本上官网有的 chart 这里都有,国内可能无法访问。
    #添加阿里云的 chart 仓库
    1. [root@master ~]# helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
    2. "aliyun" has been added to your repositories
    #添加 bitnami 的 chart 仓库
    [root@xianchaomaster1 ~]# helm repo add bitnami https://charts.bitnami.com/bitnami

    #更新 chart 仓库

    [root@xianchaomaster1 ~]# helm repo update
    #查看配置的 chart 仓库有哪些
    [root@xianchaomaster1 ~]# helm repo list

    #删除 chart 仓库地址

    1. [root@xianchaomaster1 ~]# helm repo remove aliyun
    2. "aliyun" has been removed from your repositories
    #从指定 chart 仓库地址搜索 chart
    [root@xianchaomaster1 ~]# helm search repo aliyun

     

     

    搜索和下载Chart


     #查看阿里云 chart 仓库中的 memcached

    1. [root@master1 ~]# helm search repo aliyun |grep memcached
    2. aliyun/mcrouter 0.1.0 0.36.0 Mcrouter is a
    3. aliyun/memcached 2.0.1 Free & open

    #查看 chart 信息

    1. [root@master1 ~]# helm show chart aliyun/memcached
    2. apiVersion: v1
    3. description: Free & open source, high-performance, distributed memory object caching
    4. system.
    5. home: http://memcached.org/
    6. icon: https://upload.wikimedia.org/wikipedia/en/thumb/2/27/Memcached.svg/1024pxMemcached.svg.png
    #下载 chart 包到本地
    1. [root@master1 ~]# helm pull aliyun/memcached
    2. [root@master1 ~]# tar zxvf memcached-2.0.1.tgz
    3. [root@master1 ~]# cd memcached
    4. [root@master1 memcached]# ls
    5. Chart.yaml README.md templates values.yaml
    • Chart.yaml: chart 的基本信息,包括版本名字之类
    • templates: 存放 k8s 的部署资源模板,通过渲染变量得到部署文件
    • values.yaml:存放全局变量,templates 下的文件可以调用
    1. [root@xianchaomaster1 memcached]# cd templates/
    2. [root@xianchaomaster1 templates]# ls
    • _helpers.tpl NOTES.txt pdb.yaml statefulset.yaml svc.yaml
    • _helpers.tpl 存放能够复用的模板
    • NOTES.txt 为用户提供一个关于 chart 部署后使用说明的文件
  • 相关阅读:
    9月客户文章盘点——累计IF 103.2
    VMWare 虚拟机如何扩展磁盘空间并挂载到已存在的根目录
    吃透50个常用的SQL语句,面试趟过
    10 种常见的BUG分类
    【Lipschitz】基于matlab的Lipschitz李氏指数仿真
    装修干货|卧室常见3个软装搭配问题。福州中宅装饰,福州装修
    我真的从测试转成了开发......
    融资约束指数:SA、KZ、WW (1999至2020年)
    鼠标点击选取物体错误的问题
    SQL之存储过程
  • 原文地址:https://blog.csdn.net/qq_34556414/article/details/125439004