Monthly Archives: July 2017

MicroBean Helm: Charts.install(URL) now works

I’ve just released another snapshot of my microbean-helm project.

The latest addition is a façade class named Charts.

Among other things, it functions as a simple entry point into the common Helm-like operations you might want to do from within your Java program or library.

Have a look at the install() methods.  These install a Helm chart into a Kubernetes cluster given a URL to the chart location in one relatively easy invocation.  Happy Helming from Java!

Advertisements

MicroBean Helm: Helm from Java

I’ve just released another snapshot version of my MicroBean Helm project on the way to another real release.  (Helm is the package manager for Kubernetes.)

With this latest snapshot, you can install Tiller into your Kubernetes cluster like this (as before):

final TillerInstaller tillerInstaller = new TillerInstaller();
tillerInstaller.init(true /* yes, upgrade if a new version is available */)

Then you can load a chart from a directory like this:

final ChartLoader chartLoader = new DirectoryChartLoader();
final Chart chart = chartLoader.load(someChartDirectory);

…or from a tarball like this:

final ChartLoader chartLoader = new TapeArchiveChartLoader();
final Chart chart = chartLoader.load(new TarInputStream(new GZIPInputStream(Files.newInputStream("someChart.tgz"))));

Then, armed with that Chart, you can create an InstallReleaseRequest with it (as before):

final InstallReleaseRequest.Builder builder = InstallReleaseRequest.newBuilder();
builder.setChart(theChartYouLoaded);
builder.setValues(someConfigYouBuilt);
builder.setNamespace(whereYouWantIt);
final InstallReleaseRequest request = builder.build();

Then you can install the chart (as before):

final Tiller tiller = new Tiller(new DefaultKubernetesClient());
final ReleaseServiceGrpc.ReleaseServiceBlockingStub stub = tiller.getReleaseServiceBlockingStub();
final Tiller.InstallReleaseResponse response = stub.installRelease(request);
final ReleaseOuterClass.Release release = response.getRelease();

Full API documentation is online. More on the way. Teaser: there are many ways in the Java ecosystem to load a chart.