二月

helmion的Python项目详细描述


头盔

PyPI versionSupported Python versions

Helmion是一个python库,用于下载和定制Helm图表,并且可以 也可用于生成自定义图表。在

Kubragen2与Helmion一起使用允许创建项目部署 很容易。在

示例:chart

importpprintfromjsonpatchext.mutatorsimportInitItemMutator# type: ignorefromhelmion.chartimportProcessorChain,SplitterCategoryResultfromhelmion.configimportBoolFilterfromhelmion.helmchartimportHelmRequestfromhelmion.processorimportDefaultProcessor,FilterRemoveHelmData,FilterCRDs,DefaultSplitter,ProcessorSplitterreq=HelmRequest(repository='https://helm.traefik.io/traefik',chart='traefik',version='9.10.1',releasename='helmion-traefik',namespace='router',values={'service':{'type':'ClusterIP',}})reqfilter=DefaultProcessor(add_namespace=True,namespaced_filter=BoolFilter.ALL,hook_filter=BoolFilter.ALL,jsonpatches=[{'conditions':[[{'op':'check','path':'/kind','cmp':'equals','value':'Service'}],[{'op':'check','path':'/kind','cmp':'equals','value':'ServiceAccount'}],[{'op':'check','path':'/kind','cmp':'equals','value':'ClusterRoleBinding'}]],'patch':[# Traefik Helm chart generates a null annotation field, must initialize it to a dict before merging.{'op':'mutate','path':'/metadata','mut':'custom','mutator':InitItemMutator('annotations'),'value':lambda:{}},{'op':'merge','path':'/metadata','value':{'annotations':{'helmion.github.io/processed-by':'helmion',}},}],}])res=req.generate().process(ProcessorChain(reqfilter,FilterRemoveHelmData(only_exlcusive=False,remove_hooks=False)))fordinres.data:pprint.pprint(d)# Split charts by CRDprint('')print('Split charts by CRDs')print('====================')reqsplitter=ProcessorSplitter(processors={'crds':FilterCRDs(),'default':FilterCRDs(invert_filter=True),})mres=res.split(reqsplitter)forcategory,category_chartinmres.items():print('')print('*** {} ***'.format(category))fordincategory_chart.data:pprint.pprint(d)# Split and filter by Kindprint('')print('Split Deployment and ServiceAccount charts')print('==========================================')reqsplitter2=DefaultSplitter(categoryfunc=lambdac,d:SplitterCategoryResult.categories('deployment')ifd['kind']=='Deployment'elseSplitterCategoryResult.categories('serviceaccount')ifd['kind']=='ServiceAccount'elseSplitterCategoryResult.NONE)mres=res.split(reqsplitter2,ensure_categories=['deployment','serviceaccount'])forcategory,category_chartinmres.items():print('')print('*** {} ***'.format(category))fordincategory_chart.data:pprint.pprint(d)

输出:

^{pr2}$

示例:info

importpprintfromhelmion.infoimportRepositoryInforepository_url='https://helm.traefik.io/traefik'chart_name='traefik'chart_version='9.10.1'# chart_version = '<=9.9.*'repoinfo=RepositoryInfo(repository_url)print('Repository charts')print('=================')forciinrepoinfo.entries.values():print('Chart: {}'.format(ci.name))ifci.latestisnotNone:print('Description: {}'.format(ci.latest.description))print('Latest: {}'.format(ci.latest.version))forrinci.versions:print('\trelease: {}'.format(r.version))repochart=repoinfo.mustChartVersion(chart_name,chart_version)print('')print('Chart.yaml')print('==========')# pprint.pprint(repochart.getChartFile())print(repochart.getArchiveFile('Chart.yaml'))print('')print('values.yaml')print('===========')# pprint.pprint(repochart.getValuesFile())print(repochart.getArchiveFile('values.yaml'))print('')print('dependencies')print('============')pprint.pprint(repochart.getDependencies())# for depname, dep in repochart.getDependenciesCharts().items():#     print(dep.getArchiveFile('Chart.yaml'))## pprint.pprint(repochart.getValuesFileWithDependencies())print('')print('Chart file contents')print('===================')withrepoinfo.mustChartVersion(chart_name,chart_version).fileOpen()astar_file:forfnameintar_file.getnames():print("- {}".format(fname))

输出:

Repository charts
=================
Chart: traefik
Description: A Traefik based Kubernetes ingress controller
Latest: 9.11.0
	release: 9.11.0
	release: 9.10.2
	release: 9.10.1
	release: 9.10.0
	release: 9.9.0
	release: 9.8.4
	release: 9.8.3
	release: 9.8.2
	release: 9.8.1
	release: 9.8.0
	release: 9.7.0
	release: 9.6.0
<...more...>

Chart.yaml
==========
apiVersion: v2
appVersion: 2.3.1
description: A Traefik based Kubernetes ingress controller
home: https://traefik.io/
icon: https://raw.githubusercontent.com/traefik/traefik/v2.3/docs/content/assets/img/traefik.logo.png
keywords:
- traefik
- ingress
maintainers:
- email: emile@vauge.com
  name: emilevauge
- email: daniel.tomcej@gmail.com
  name: dtomcej
- email: ldez@traefik.io
  name: ldez
name: traefik
sources:
- https://github.com/traefik/traefik
- https://github.com/traefik/traefik-helm-chart
type: application
version: 9.10.1


values.yaml
===========
# Default values for Traefik
image:
  name: traefik
  # defaults to appVersion
  tag: ""
  pullPolicy: IfNotPresent

#
# Configure the deployment
#
deployment:
  enabled: true
  # Number of pods of the deployment
  replicas: 1
  # Additional deployment annotations (e.g. for jaeger-operator sidecar injection)
  annotations: {}
<...more...>

dependencies
============
{}

Chart file contents
===================
- traefik/Chart.yaml
- traefik/values.yaml
- traefik/templates/_helpers.tpl
- traefik/templates/dashboard-hook-ingressroute.yaml
- traefik/templates/deployment.yaml
- traefik/templates/hpa.yaml
- traefik/templates/ingressclass.yaml
- traefik/templates/poddisruptionbudget.yaml
- traefik/templates/pvc.yaml
- traefik/templates/rbac/clusterrole.yaml
- traefik/templates/rbac/clusterrolebinding.yaml
- traefik/templates/rbac/podsecuritypolicy.yaml
- traefik/templates/rbac/role.yaml
- traefik/templates/rbac/rolebinding.yaml
- traefik/templates/rbac/serviceaccount.yaml
- traefik/templates/service.yaml
- traefik/templates/tlsoption.yaml
- traefik/.helmignore
- traefik/Guidelines.md
- traefik/LICENSE
- traefik/README.md
- traefik/crds/ingressroute.yaml
- traefik/crds/ingressroutetcp.yaml
- traefik/crds/ingressrouteudp.yaml
- traefik/crds/middlewares.yaml
- traefik/crds/tlsoptions.yaml
- traefik/crds/tlsstores.yaml
- traefik/crds/traefikservices.yaml

学分

基于

基于MichaelVL/kubernetes-deploy-tools。在

作者

范围实数(rangelreale@gmail.com

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java错误:无法解析方法   如何用相同的父标记和子标记在Java中解析XML?   日期使用Java中的时区偏移将本地时间转换为UTC   java如何在多进程、多线程环境中读取文件   WebView中的java弹出式对话框不在当前显示范围内,但在chrome浏览器中运行良好   只有2个参数的java递归二进制搜索方法   无法在java中调用函数   java JavaMail在Tomcat服务器上运行时停止工作   反射通过java程序生成、编译和运行java类   java Android:如何使ListView即使在应用程序关闭后仍保持禁用状态   在JAVA中识别匿名类实例   java渲染一个由三角形组成的立方体,在旋转时会产生奇怪的角度   函数式编程如何基于比较连续的列表元素将Java流减少为布尔值   java如何替换列表中的多个项目?   java Android如何获取随机sqlite数据?   java我已经将useSSL设置为false,但仍然收到警告   java使用动态变量生成jlabel   apachespark:java。lang.NoClassDefFoundError v2TableWithV1回退