use of io.fabric8.verticalpodautoscaler.api.model.v1.VerticalPodAutoscalerBuilder in project kubernetes-client by fabric8io.
the class V1VerticalPodAutoscalerCrudTest method shouldListAndGetVerticalPodAutoscaler.
@Test
void shouldListAndGetVerticalPodAutoscaler() {
VerticalPodAutoscaler vpa2 = new VerticalPodAutoscalerBuilder().withNewMetadata().withName("vpa2").endMetadata().build();
client.v1().verticalpodautoscalers().inNamespace("ns2").create(vpa2);
VerticalPodAutoscalerList certificateList = client.v1().verticalpodautoscalers().inNamespace("ns2").list();
assertNotNull(certificateList);
assertEquals(1, certificateList.getItems().size());
}
use of io.fabric8.verticalpodautoscaler.api.model.v1.VerticalPodAutoscalerBuilder in project kubernetes-client by fabric8io.
the class V1VerticalPodAutoscalerCrudTest method shouldDeleteAVerticalPodAutoscaler.
@Test
void shouldDeleteAVerticalPodAutoscaler() {
VerticalPodAutoscaler vpa3 = new VerticalPodAutoscalerBuilder().withNewMetadata().withName("vpa3").endMetadata().build();
client.v1().verticalpodautoscalers().inNamespace("ns3").create(vpa3);
Boolean deleted = client.v1().verticalpodautoscalers().inNamespace("ns3").withName("vpa3").delete();
assertTrue(deleted);
}
use of io.fabric8.verticalpodautoscaler.api.model.v1.VerticalPodAutoscalerBuilder in project kubernetes-client by fabric8io.
the class VerticalPodAutoscalerCreate method main.
public static void main(String[] args) {
try (NamespacedVerticalPodAutoscalerClient verticalPodAutoscalerClient = new DefaultVerticalPodAutoscalerClient()) {
String namespace = "default";
VerticalPodAutoscaler verticalPodAutoscaler = new VerticalPodAutoscalerBuilder().build();
// Create VerticalPodAutoscaler
verticalPodAutoscalerClient.v1().verticalpodautoscalers().inNamespace(namespace).create(verticalPodAutoscaler);
System.out.println("Created: " + verticalPodAutoscaler.getMetadata().getName());
// List VerticalPodAutoscaler
VerticalPodAutoscalerList verticalPodAutoscalerList = verticalPodAutoscalerClient.v1().verticalpodautoscalers().inNamespace(namespace).list();
System.out.println("There are " + verticalPodAutoscalerList.getItems().size() + " VerticalPodAutoscaler objects in " + namespace);
}
}
Aggregations