@Override public void close() throws IOException { this.client.close(); }
@PreDestroy public void shutdown() { // Ensure the kubernetes client is cleaned up from spare threads when shutting // down kubernetesClient.close(); }
@Override public void close() { delegate.close(); }
@PreDestroy public void shutdown() { // Ensure the kubernetes client is cleaned up from spare threads when shutting down kubernetesClient.close(); }
public static synchronized void close() { if (kubernetesClient == null) { return; } kubernetesClient.close(); kubernetesClient = null; }
public static synchronized void close() { if (kubernetesClient == null) { return; } kubernetesClient.close(); kubernetesClient = null; }
@Override public void close() { if (client != null) { client.close(); } }
@Override public void close() { delegate.close(); }
+ podSecurityPolicy1.getMetadata().getName()); client.close();
@PreDestroy public void shutdown() { // Ensure the kubernetes client is cleaned up from spare threads when shutting down kubernetesClient.close(); }
@PreDestroy public void shutdown() { // Ensure the kubernetes client is cleaned up from spare threads when shutting // down kubernetesClient.close(); }
@Override public void stopServer() { timer.cancel(); activeNodes.clear(); kube.close(); }
public static void main(String[] args) throws InterruptedException { Config config = new ConfigBuilder().build(); KubernetesClient client = new DefaultKubernetesClient(config); String namespace = null; if (args.length > 0) { namespace = args[0]; } if (namespace == null) { namespace = client.getNamespace(); } if (namespace == null) { namespace = "default"; } String name = "cheese"; try { Resource<ConfigMap, DoneableConfigMap> configMapResource = client.configMaps().inNamespace(namespace).withName(name); ConfigMap configMap = configMapResource.createOrReplace(new ConfigMapBuilder(). withNewMetadata().withName(name).endMetadata(). addToData("foo", "" + new Date()). addToData("bar", "beer"). build()); log("Upserted ConfigMap at " + configMap.getMetadata().getSelfLink() + " data " + configMap.getData()); } finally { client.close(); } }
@Override protected void doStop() throws Exception { if (controller != null) { controller.stop(); controller = null; kubernetesClient.close(); kubernetesClient = null; } }
@Override protected void doStop() throws Exception { super.doStop(); if (client != null) { client.close(); } }
@Override public void stop(Future<Void> stop) { log.info("Stopping UserOperator for namespace {}", namespace); vertx.cancelTimer(reconcileTimer); if (watch != null) { watch.close(); } client.close(); stop.complete(); }
@Override public void stop(Future<Void> stop) { log.info("Stopping ClusterOperator for namespace {}", namespace); vertx.cancelTimer(reconcileTimer); for (Watch watch : watchByKind.values()) { if (watch != null) { watch.close(); } // TODO remove the watch from the watchByKind } client.close(); stop.complete(); }
public static void main(String[] args) { String master = "https://localhost:8443/"; if (args.length == 1) { master = args[0]; } Config config = new ConfigBuilder().withMasterUrl(master).build(); KubernetesClient client = new DefaultKubernetesClient(config); try { log("Create namespace:", client.namespaces().create(new NamespaceBuilder().withNewMetadata().withName("thisisatest").endMetadata().build())); log("Deleted namespace:", client.namespaces().withName("test").delete()); log("Deleted testPod:", client.pods().inNamespace("thisisatest").withName("testpod").delete()); log("Deleted pod by label:", client.pods().withLabel("this", "works").delete()); } catch (KubernetesClientException e) { logger.error(e.getMessage(), e); } finally { client.namespaces().withName("thisisatest").delete(); client.close(); } }
public static void main(String[] args) { log.info("Init-kafka {} is starting", Main.class.getPackage().getImplementationVersion()); InitWriterConfig config = InitWriterConfig.fromMap(System.getenv()); KubernetesClient client = new DefaultKubernetesClient(); log.info("Init-kafka started with config: {}", config); InitWriter writer = new InitWriter(client, config); if (config.getRackTopologyKey() != null) { if (!writer.writeRack()) { System.exit(1); } } if (config.isExternalAddress()) { if (!writer.writeExternalAddress()) { System.exit(1); } } client.close(); } }
client.close();