use of com.marcnuri.yakc.api.core.v1.CoreV1Api in project yakc by manusa.
the class PodQuickstart method main.
public static void main(String[] args) {
System.out.println("Complete POD example:\n" + " - Creates a namespace\n" + " - Deletes POD if exists\n" + " - Creates POD\n" + " - Patches POD's labels\n" + " - Updates POD removing annotations and adding another label\n" + "Starting...\n");
try (KubernetesClient kc = new KubernetesClient()) {
final CoreV1Api api = kc.create(CoreV1Api.class);
final Disposable podMonitor = monitorPods(api);
createNamespace(api);
deletePodIfExists(api);
createPod(api);
final Pod patchedPod = patchPodLabels(api);
System.out.printf("POD labels patched [%s]%n", patchedPod.getMetadata().getLabels());
final Pod updatedPod = replacePod(patchedPod, api);
System.out.printf("POD replaced: annotations removed, labels modified [%s]%n", updatedPod.getMetadata().getLabels());
podMonitor.dispose();
System.out.println("Pod demo concluded successfully!");
} catch (Exception ex) {
ex.printStackTrace();
}
}
Aggregations