<dependency>
<groupId>org.microbean</groupId>
<artifactId>microbean-helm</artifactId>
<version>2.8.2.1.1.0</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</exclusion>
</exclusions>
<type>jar</type>
</dependency>
final URI uri = URI.create("https://kubernetes-charts.storage.googleapis.com/wordpress-0.6.6.tgz");
final URL url = uri.toURL();
Chart.Builder chart = null;
try (final URLChartLoader chartLoader = new URLChartLoader()) {
chart = chartLoader.load(url);
}
try (final DefaultKubernetesClient client = new DefaultKubernetesClient();
final Tiller tiller = new Tiller(client);
final ReleaseManager releaseManager = new ReleaseManager(tiller)) {
final InstallReleaseRequest.Builder requestBuilder = InstallReleaseRequest.newBuilder();
assert requestBuilder != null;
requestBuilder.setTimeout(300L);
requestBuilder.setName("test-charts"); // Set the Helm release name
requestBuilder.setWait(true); // Wait for Pods to be ready
final Map<String, Object> yaml = new LinkedHashMap<>();
yaml.put("wordpressEmail", "sample@example.com");
final String yamlString = new Yaml().dump(yaml);
requestBuilder.getValuesBuilder().setRaw(yamlString);
// Install the loaded chart with the user-supplied overrides.
final Future<InstallReleaseResponse> releaseFuture = releaseManager.install(requestBuilder, chart);
运行时可能会报NoSuchMethodError,原因大部分是他的包太老了,自己导入新的grpc包使用即可
原文:https://www.cnblogs.com/wpyblog/p/14370058.html