use of io.fabric8.volcano.client.NamespacedVolcanoClient in project kubernetes-client by fabric8io.
the class PodGroupCreate method main.
public static void main(String[] args) {
try (NamespacedVolcanoClient volcanoClient = new DefaultVolcanoClient()) {
String namespace = "default";
String groupName = "group1";
PodGroup podGroup = Utils.buildDefaultPodGroups(namespace, groupName);
// Create PodGroup
volcanoClient.podGroups().inNamespace(namespace).createOrReplace(podGroup);
System.out.println("Created: " + podGroup.getMetadata().getName());
// Wait for status or 5s timeout
volcanoClient.podGroups().inNamespace(namespace).withName(groupName).waitUntilCondition(group -> Objects.nonNull(group.getStatus()) && group.getStatus().getPhase().equals("Running"), 5, TimeUnit.SECONDS);
System.out.println("Created: " + podGroup.getMetadata().getName());
// List PodGroup
PodGroupList podGroupList = volcanoClient.podGroups().inNamespace(namespace).list();
System.out.println("There are " + podGroupList.getItems().size() + " PodGroup objects in " + namespace);
// Delete PodGroup
volcanoClient.podGroups().inNamespace(namespace).withName(groupName).delete();
}
}
use of io.fabric8.volcano.client.NamespacedVolcanoClient in project kubernetes-client by fabric8io.
the class PodGroupCreate method main.
public static void main(String[] args) {
try (NamespacedVolcanoClient volcanoClient = new DefaultVolcanoClient()) {
String namespace = "default";
String groupName = "group1";
PodGroup podGroup = Utils.buildDefaultPodGroups(namespace, groupName);
// Create PodGroup
volcanoClient.v1beta1().podGroups().inNamespace(namespace).createOrReplace(podGroup);
System.out.println("Created: " + podGroup.getMetadata().getName());
// Wait for status or 5s timeout
volcanoClient.v1beta1().podGroups().inNamespace(namespace).withName(groupName).waitUntilCondition(group -> Objects.nonNull(group.getStatus()) && group.getStatus().getPhase().equals("Running"), 5, TimeUnit.SECONDS);
System.out.println("Created: " + podGroup.getMetadata().getName());
// List PodGroup
PodGroupList podGroupList = volcanoClient.v1beta1().podGroups().inNamespace(namespace).list();
System.out.println("There are " + podGroupList.getItems().size() + " PodGroup objects in " + namespace);
// Delete PodGroup
volcanoClient.v1beta1().podGroups().inNamespace(namespace).withName(groupName).delete();
}
}
use of io.fabric8.volcano.client.NamespacedVolcanoClient in project kubernetes-client by fabric8io.
the class QueueCreate method main.
public static void main(String[] args) {
try (NamespacedVolcanoClient volcanoClient = new DefaultVolcanoClient()) {
String queueName = "queue1";
Queue queue = Utils.buildDefaultQueues(queueName);
volcanoClient.queues().createOrReplace(queue);
// Wait for status or 5s timeout
volcanoClient.queues().withName(queueName).waitUntilCondition(q -> Objects.nonNull(q.getStatus()) && q.getStatus().getState().equals("Open"), 5, TimeUnit.SECONDS);
System.out.println("Created: " + queue.getMetadata().getName());
// List queue
QueueList queueList = volcanoClient.queues().list();
System.out.println("There are " + queueList.getItems().size() + " queue objects");
// Delete queue
volcanoClient.queues().withName(queueName).delete();
}
}
use of io.fabric8.volcano.client.NamespacedVolcanoClient in project kubernetes-client by fabric8io.
the class QueueCreate method main.
public static void main(String[] args) {
try (NamespacedVolcanoClient volcanoClient = new DefaultVolcanoClient()) {
String queueName = "queue1";
Queue queue = Utils.buildDefaultQueues(queueName);
volcanoClient.v1beta1().queues().createOrReplace(queue);
// Wait for status or 5s timeout
volcanoClient.v1beta1().queues().withName(queueName).waitUntilCondition(q -> Objects.nonNull(q.getStatus()) && q.getStatus().getState().equals("Open"), 5, TimeUnit.SECONDS);
System.out.println("Created: " + queue.getMetadata().getName());
// List queue
QueueList queueList = volcanoClient.v1beta1().queues().list();
System.out.println("There are " + queueList.getItems().size() + " queue objects");
// Delete queue
volcanoClient.v1beta1().queues().withName(queueName).delete();
}
}
Aggregations