简体   繁体   English

Kubernetes掌舵Java API

[英]Kubernetes helm Java API

Is there any known Java API to use Kubernetes helm (something like the great KubernetesClient from fabric8)? 是否有任何已知的Java API使用Kubernetes helm(类似于fabric8的伟大KubernetesClient)? I am trying to initial helm commands from Java but I couldn't find anything that actually works... 我试图从Java初始化helm命令,但我找不到任何实际工作的东西......

Thanks, Nir 谢谢,Nir

I've written microbean-helm . 我写过microbean-helm This project: 这个项目:

  1. Checks out the .proto files from the Helm project… 检查Helm项目中的.proto文件...
  2. …generates their gRPC Java bindings… ...生成他们的gRPC Java绑定...
  3. …and adds a couple of utility classes. ...并添加了几个实用程序类。

The end result is that Tiller, the server-side component of Helm that does all the heavy lifting like chart installation, etc., is addressable and drivable from Java. 最终的结果是,Tiller是Helm的服务器端组件,可以完成所有繁重的工作,如图表安装等,可以从Java进行寻址和驱动。 I am guessing that that is what you really want. 我猜这就是你真正想要的。

You may follow along at its Github repository . 您可以在其Github存储库中进行操作

we've not created a Java API for helm yet on the fabric8 team. 我们还没有在fabric8团队中为helm创建Java API。

The simplest thing is probably to just use the helm binary for now from your $PATH (or from a docker container if you're using Jenkins Pipeline). 最简单的事情可能是从你的$ PATH(或者如果你使用Jenkins管道,从docker容器)现在使用helm二进制文件。

BTW the fabric8 maven plugin supports generating helm charts: https://maven.fabric8.io/#fabric8:helm BTW fabric8 maven插件支持生成helm图表: https ://maven.fabric8.io/#fabric8 :helm

You can then apply the helm chart via the command line: 然后,您可以通过命令行应用helm图表:

mvn install
helm install target/fabric8/helm/kubernetes/myapp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM