zoukankan      html  css  js  c++  java
  • kubernets helm chart 常用ming'l

    1、helm安装

    软件准备

    helm v2由客户端helm cli工具和服务器tiller两部分组成。

    下载地址:https://storage.googleapis.com/kubernetes-helm/helm-v2.11.0-linux-amd64.tar.gz

    release地址:https://github.com/helm/helm/releases

    运行tiller服务器

    本地运行直接执行tiller即可 ./tiller

    初始化helm

     
     
     
     
     
     
     
     
     
    helm init --client-only
    #Creating /root/.helm
    #Creating /root/.helm/repository
    #Creating /root/.helm/repository/cache
    #Creating /root/.helm/repository/local
    #Creating /root/.helm/plugins
    #Creating /root/.helm/starters
    #Creating /root/.helm/repository/repositories.yaml
    #$HELM_HOME has been configured at /root/.helm.

    参数:

    --client-only:只初始化helm,不在集群内安装tiller,只会在helm home目录下创建配置文件

    --home:helm 文件存储目录,默认/root/.helm,若初始化时修改了该参数,后续的helm调用也需要指定home路径。因此可直接修改环境变量$HELM_HOME来实现。

    2.helm push 安装

    helm-push插件地址 https://github.com/chartmuseum/helm-push/

    下载后,将其解压到.helm/plugins/helm-push.git下

    3、helm常用命令

    helm install --name test .  在chart目录内,部署chart

    helm del --purge test 删除test部署

    helm push mychart-0.1.0.tgz repo 上传chart包

    helm repo add --username username --password password repo_name repo_address/username 增加repo
    helm repo list 列举已添加的charts repo
    helm repo remove repo_name 移除repo
    helm search keyword -l 列出repo提供的带有关键字的模板
    helm fetch --version version repo/chart_name 下载模板到本地
    helm install /root/testlink-4.0.1.tgz --tls 安装模板实例
    helm list --tls 列出所有仓库的charts实例
    helm plugin install https://github.com/chartmuseum/helm-push

    4、k8s常用命令
     kubectl get pod/deployment/svc -n name1 查看name1 namespace下的pos、svc、deployment
    kubectl get pod/svc/deployment --all-namcpaces 查看所有namespace下的
    kubectl describe pod/deployment xxx -n name1 查看pod/deployment描述
     查看pod 日志 (如果pod有多个容器需要加-c 容器名)kubectl logs xxx -n kube-system
     删除应用(先确定是由说明创建的,再删除对应的kind):kubectl delete deployment xxx -n kube-system

     导出配置文件:

    导出proxy
      kubectl get ds -n kube-system -l k8s-app=kube-proxy -o yaml>kube-proxy-ds.yaml
      导出kube-dns
      kubectl get deployment -n kube-system -l k8s-app=kube-dns -o yaml >kube-dns-dp.yaml
      kubectl get services -n kube-system -l k8s-app=kube-dns -o yaml >kube-dns-services.yaml
      导出所有 configmap
      kubectl get configmap -n kube-system -o wide -o yaml > configmap.yaml

  • 相关阅读:
    【FastJSON】使用JSON.toJSONString()-解决FastJson中“$ref 循环引用”的问题
    格林威治时间(GTM)转北京时间
    @RenderBody、@RenderSection、@RenderPage、Html.RenderPartial、Html.RenderAction的作用和区别
    Net操作Excel(终极方法NPOI)
    10款.net 图形插件
    23种设计模式
    asp.net页面关闭的时候如何触发事件?
    IIS HTTP 错误 404.17
    Win10 Sql2008R2 在关闭【0x80041033】
    国内外前端(js)开发框架对比
  • 原文地址:https://www.cnblogs.com/zl1991/p/14177218.html
Copyright © 2011-2022 走看看