captain 安装

  • 安装包

    1
    helm install --version <captain chart version> --debug --namespace=<ns> --set global.registry.address=<init registry> --set alaudaChartRepoURL=<init 节点上的 chart repo> --set namespace=<ns> --name=captain stable/captain --wait --timeout 3000

    kubectl-captain 在安装目录下的 other 目录里

  • 安装要求

    • 软件依赖

      captain 依赖 cert-manager ,必须在 cert-manager 部署成功后,安装 captain

  • 硬件依赖

    均可

用 captain 替换 helm

  • 已经通过 helm 部署的 chart 怎样迁移到 helm 上

    • 详见升级说明文档,大致流程如下:

      通过 kubectl captain 命令或者直接创建 helmrequest 资源,hr 资源存在 global 的集群内
      captain 侦测到新的 helmrequest 资源,会自动部署 chart ,成功后,会生成 release 资源。chart 安装到那个集群,release 资源就存在那个集群内

2.2. 迁移到 captain 的 chart 如何在 helm 里删掉

  • 详见升级说明文档,大致流程如下:

    helm 每成功安装一次 chart ,就会在 kube-system 的 ns 下创建一个 cm,cm 的名字是 chart 的 release 名字+ v[0-9],比如 cert-manager.v1,是 cert-manager 这个 chart 第一次安装成功的版本,以后每更新一次这个 chart ,后面的数字就加1
    找到这个 cm,删掉之后执行 helm list -a 命令就看不到 chart 了,但是 chart 创建的资源还存在

captain 运维

  • captain 安装 chart

    1
    kubectl captain create ,比如kubectl captain create --version 2.1 --namespace=cpaas-system --chart=stable/amp-minio --set global.registry.address=10.0.128.172:60080  amp-minio  

    即创建了一个名为 amp-minio 的 HelmRequest 资源
    写 yaml ,然后 kubectl create -f

  • captain 更新、升级 chart

    1
    kubectl edit <hr name> -n <ns> 修改 chart 的变量和版本
  • captain 删除 chart

    1
    kubectl delete <hr name> -n <ns> 修改 chart 的变量和版本
  • captain 查看 chart 状态

    1
    2
    3
    4
    5
    kubectl get <hr name> -n <ns>                 ## 查看 hr 的状态

    kubectl describe <hr name> -n <ns> ## 查看 hr 详细情况

    kubectl get release -n <ns> ## 查看通过 captain 部署的 chart
  • captain 列出 chart 资源

    1
    kubectl get <hr name> -n <ns> 
  • 和 helm 命令对应功能的 captain 命令

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    helm list       kubectl get <hr name> -n <ns> ; kubectl get release -n <ns> | grep <hr name>  # 这个命令在 chart 安装的目的集群的 master 上执行

    helm repo list kubectl get chartrepo -n <ns>

    help repo up

    helm install kubectl captain create

    helm upgrade kubectl edit <hr name> -n <ns>

    helm get values kubectl get <hr name> -n <ns> -o yaml

    helm status

    captain 错误排障