Helmion插件:Kube资源报告

hmi-kuberesourcereport的Python项目详细描述


Helmion插件:Kube资源报告

PyPI versionSupported Python versions

hmi kuberesourcereport是Helmion的图表生成器 它在Kubernetes部署了一个Kube Resource Report服务。在

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

示例

fromkubragen2.outputimportOutputProject,OutputFile_ShellScript,OutputFile_Kubernetes,OD_FileTemplate, \
    OutputDriver_Printfromhmi_kuberesourcereportimportKubeResourceReportChartRequestout=OutputProject()shell_script=OutputFile_ShellScript('create_gke.sh')out.append(shell_script)shell_script.append('set -e')## OUTPUTFILE: app-namespace.yaml#file=OutputFile_Kubernetes('app-namespace.yaml')file.append([{'apiVersion':'v1','kind':'Namespace','metadata':{'name':'app-monitoring',},}])out.append(file)shell_script.append(OD_FileTemplate(f'kubectl apply -f ${{FILE_{file.fileid}}}'))shell_script.append(f'kubectl config set-context --current --namespace=app-monitoring')## SETUP: kube-resource-report#kms_req=KubeResourceReportChartRequest(namespace='app-monitoring',values={'resources':{'requests':{'cpu':'5m','memory':'50Mi'},'limits':{'cpu':'10m','memory':'100Mi'},},})kms_chart=kms_req.generate()## OUTPUTFILE: kuberesourcereport.yaml#file=OutputFile_Kubernetes('kuberesourcereport.yaml')out.append(file)file.append(kms_chart.data)shell_script.append(OD_FileTemplate(f'kubectl apply -f ${{FILE_{file.fileid}}}'))## Write files#out.output(OutputDriver_Print())# out.output(OutputDriver_Directory('/tmp/build-gke'))

输出:

^{pr2}$

作者

范围实数(rangelreale@gmail.com

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

推荐PyPI第三方库


热门话题
使用多个参数的枚举   从Oracle到Redis的java复制表   java如何保护tomcat服务器中的db用户名和密码。xml   java如何使用注册密钥保护移动应用程序?   java在什么情况下超类不应该是抽象的?   java Backspace键在macOS上的Scala REPL中不起作用   arduino Java+Uno+RFID:调用方法读取Java中的RFID   带有where语句中集合的java JPA查询   java如何向基于Tyrus注释的客户端添加请求头   java对我的二进制搜索算法的反馈   java重新访问数据库时文件的内容不正确   用户在字符串中输入值后退出While循环(Java)   java如何在Maven中的多个项目之间共享项目依赖关系?   java Close从未在数据库上被明确调用   在java中从文件读入布尔矩阵   Java:如何使用父节点将XML流拆分为小型XML文档。VTDXML