Helm的Python客户端 [英] Python client for Helm
问题描述
我正在开发一个应用程序,该应用程序可根据用户需求将掌舵图表部署到kubernetes集群.舵图存储在github上的私有仓库中.该场景是每当用户请求部署应用程序时,系统就会从git repo获取图表以将其构建并部署到群集上.Helm不提供REST api
(因为它使用gRPC
协议与分till服务器通信)和helm-cli
不是在这种情况下使用的选项,所以我的问题是
在不使用helm cli(例如curl或python-client等)的情况下,调用分any服务的任何方法都是
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.
推荐答案
您可以在示例和Python3支持下找到我的pyhelm
分支.
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
我在 README.md 中添加了简单的操作方法:
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 {....
}
这篇关于Helm的Python客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!