All Projects → aiopsclub → python-helm

aiopsclub / python-helm

Licence: Apache-2.0 license
python client for helm

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-helm

kube-test-container
Kubernetes Test Container
Stars: ✭ 27 (+58.82%)
Mutual labels:  helm
gitops-helm-workshop
Progressive Delivery for Kubernetes with Flux, Helm, Linkerd and Flagger
Stars: ✭ 59 (+247.06%)
Mutual labels:  helm
kubernetes
Kubernetes/Helm configs for ReportPortal
Stars: ✭ 66 (+288.24%)
Mutual labels:  helm
cog-helm
A Helm chart to deploy Cog on Kubernetes
Stars: ✭ 17 (+0%)
Mutual labels:  helm
helm-charts
Helm charts for Vector.
Stars: ✭ 50 (+194.12%)
Mutual labels:  helm
charts
Curated kubernetes helm charts with well-defined structures
Stars: ✭ 24 (+41.18%)
Mutual labels:  helm
helm-freeze
Freeze your charts in the wished versions
Stars: ✭ 29 (+70.59%)
Mutual labels:  helm
k8s-istio-webinar
Istio webinar
Stars: ✭ 18 (+5.88%)
Mutual labels:  helm
kube-janitor
Kubernetes Job Cleaner
Stars: ✭ 37 (+117.65%)
Mutual labels:  helm
helm-schema-gen
So that you don't have to write values.schema.json by hand from scratch for your Helm 3 charts. [CURRENTLY NOT MAINTAINED]
Stars: ✭ 104 (+511.76%)
Mutual labels:  helm
gcloud-kubectl-helm
Docker image for the quaternity of gcloud, helm, kubectl and SOPS
Stars: ✭ 32 (+88.24%)
Mutual labels:  helm
bitops
Automate the provisioning and configuration of cloud infrastructure.
Stars: ✭ 28 (+64.71%)
Mutual labels:  helm
kubernetes example
5-Step Kubernetes CI/CD Process using Artifactory & Helm
Stars: ✭ 35 (+105.88%)
Mutual labels:  helm
NodeWrecker
Simple pod to run in kubernetes to stress test your nodes
Stars: ✭ 27 (+58.82%)
Mutual labels:  helm
helm-zabbix
Helm Chart For Zabbix
Stars: ✭ 56 (+229.41%)
Mutual labels:  helm
kube-tools-aws
A lightweight Docker image with various CLI tooling for working with Kubernetes.
Stars: ✭ 26 (+52.94%)
Mutual labels:  helm
nifi
Helm nifi chart
Stars: ✭ 29 (+70.59%)
Mutual labels:  helm
kubetools
Kubetools - Curated List of Kubernetes Tools
Stars: ✭ 674 (+3864.71%)
Mutual labels:  helm
polscan
Zero-setup SSH-based scanner with extensive visualizations for Debian server inventory, policy compliance and vulnerabilities
Stars: ✭ 57 (+235.29%)
Mutual labels:  helm
docker-kubernetes-course
Demoing Kubernetes/AKS features
Stars: ✭ 42 (+147.06%)
Mutual labels:  helm

Welcome to python-helm

Badge LICENSE Slack

python-helm is a helm client for python(tiller version: 2.9.1).

github地址

TODO

  • 添加grpc对象序列化函数,便于处理
  • 基于react antd构建简单管理前端
  • 继续完善后端代码

目录:

  1. 功能介绍
  2. Tiller控制列表
  3. grpc接口生成
  4. 使用方法
  5. 函数文档

功能

python-helm 可以实现对Tiller的访问

Tiller控制

  • 安装
  • 升级
  • 回滚
  • 删除
  • 测试
  • 获取版本历史

该项目主要依赖于官方的hapi的grpc接口

helm grpc 生成方式:

The helm gRPC libraries are located in the hapi directory.
They were generated with the grpc_tools.protoc utility against Helm 2.9.1.
Should you wish to re-generate them you can easily do so:

grpc python协议文件生成

# git clone https://github.com/kubernetes/helm ./helm
# python -m grpc_tools.protoc -I helm/_proto --python_out=. --grpc_python_out=. ./helm/_proto/hapi/chart/*
# python -m grpc_tools.protoc -I helm/_proto --python_out=. --grpc_python_out=. ./helm/_proto/hapi/services/*
# python -m grpc_tools.protoc -I helm/_proto --python_out=. --grpc_python_out=. ./helm/_proto/hapi/release/*
# python -m grpc_tools.protoc -I helm/_proto --python_out=. --grpc_python_out=. ./helm/_proto/hapi/version/*

完成后,将在当前目录下生成hapi目录,这就是我们需要的grpc协议文件

# ls ./hapi # total 0
# drwxr-xr-x 2 root root 200 Jul 9 16:47 chart
# drwxr-xr-x 2 root root 294 Jul 9 16:47 release
# drwxr-xr-x 2 root root 53 Jul 9 16:47 rudder
# drwxr-xr-x 2 root root 53 Jul 9 16:47 services
# drwxr-xr-x 2 root root 55 Jul 9 16:47 version

How to use it

  1. First you need repo_url and chart name to download chart:
    In [1]: from pyhelm.repo import RepoUtils  
    In [2]: chart_path = from_repo('https://kubernetes-charts.storage.googleapis.com/', 'mariadb')  
    In [3]: print(chart_path)  
    "/tmp/pyhelm-kibwtj8d/mongodb"  
  1. Next step to build ChartBuilder instance to manipulate with Tiller.
   In [1]: from pyhelm.chartbuilder import ChartBuilder  
   In [2]: chart = ChartBuilder({'name': 'mongodb', 'source': {'type': 'directory', 'location': '/tmp/pyhelm-kibwtj8d/mongodb'}})   
  1. Control tiller
from pyhelm.chartbuilder import ChartBuilder  
from pyhelm.tiller import Tiller  
# 构建chart元数据  
chart = ChartBuilder({'name': 'mongodb', 'source': {'type': 'directory', 'location': '/tmp/pyhelm-kibwtj8d/mongodb'}})  
# 生成tiller连接实例  
tiller_ins = Tiller(tiller_host, tiller_port)  
# 安装 release  
tiller_ins.install_release(chart.get_helm_chart(), dry_run=False, namespace='default')  
# 列出 release  
tiller_ins.list_releases(limit=RELEASE_LIMIT, status_codes=[], namespace=None)  
# 删除 release  
tiller_ins.uninstall_release(release_name)  
# 获得 release 版本历史  
tiller_ins.get_history(name, max=MAX_HISTORY) 
# 回滚 release  
tiller_ins.rollback_release(name, version, timeout=REQUEST_TIMEOUT)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].