Python client for Helm

只谈情不闲聊 提交于 2020-01-13 18:29:52

问题


I am working on an application which deploys helm charts to kubernetes cluster on user's demand. Helm charts are stored in private repo on github. The scenario is whenever user request an application deployment the system fetches chart from git repo build it and deploy it on the cluster.Helm does not provide REST api(as it uses gRPC protocol to talk to tiller server) and helm-cli is not the option to use in this scenario so my question is Is their any way to call tiller services without using helm cli e.g curl or python-client etc.


回答1:


You can find my fork of pyhelm with examples and Python3 support.

git clone git@github.com:andriisoldatenko/pyhelm.git
cd pyhelm && python setup.py install

I've added simple how-to to README.md:

from pyhelm.chartbuilder import ChartBuilder
from pyhelm.tiller import Tiller

chart = ChartBuilder({'name': 'mongodb', 'source': {'type': 'directory', 'location': '/tmp/pyhelm-kibwtj8d/mongodb'}})
t.install_release(chart.get_helm_chart(), dry_run=False, namespace='default')

Out[9]:
release {
  name: "fallacious-bronco"
  info {
    status {
      code: 6
    }
    first_deployed {
      seconds: 1521647335
      nanos: 746785000
    }
    last_deployed {
      seconds: 1521647335
      nanos: 746785000
    }
    Description: "Dry run complete"
  }
  chart {....
}


来源:https://stackoverflow.com/questions/49540061/python-client-for-helm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!