我正在开发一个应用程序,它根据用户的需求将helm图表部署到kubernetes集群。头盔图存储在github上的私人仓库中。该场景是每当用户请求应用程序部署时,系统从git repo构建图表并构建它并将其部署在集群上.Helm不提供REST api
(因为它使用gRPC
协议与分蘖服务器通信)并且helm-cli
不是使用的选项在这种情况下所以我的问题是他们是否可以在不使用helm cli的情况下调用分蘖服务,例如curl或python-client等。
您可以通过示例和Python3支持找到我的pyhelm
分支。
git clone [email protected]:andriisoldatenko/pyhelm.git
cd pyhelm && python setup.py install
我已经为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 {....
}