Search in sources :

Example 6 with Deployment

use of com.marcnuri.yakc.model.io.k8s.api.apps.v1.Deployment in project yakc by manusa.

the class DeploymentService method updateReplicas.

public Deployment updateReplicas(String name, String namespace, Integer replicas) throws IOException {
    final Deployment toPatch = emptyDeployment();
    toPatch.getSpec().setReplicas(replicas);
    return kubernetesClient.create(AppsV1Api.class).patchNamespacedDeployment(name, namespace, toPatch).get();
}
Also used : Deployment(com.marcnuri.yakc.model.io.k8s.api.apps.v1.Deployment)

Example 7 with Deployment

use of com.marcnuri.yakc.model.io.k8s.api.apps.v1.Deployment in project yakc by manusa.

the class DeploymentIT method readNamespacedDeployment.

@Test
@DisplayName("readNamespacedDeployment.stream, should read newly created Deployment")
void readNamespacedDeployment() throws IOException {
    // When
    final Deployment result = KC.create(AppsV1Api.class).readNamespacedDeployment(deploymentName, NAMESPACE).get();
    // Then
    assertThat(result).as("Created Deployment was not found").isNotNull();
}
Also used : Deployment(com.marcnuri.yakc.model.io.k8s.api.apps.v1.Deployment) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

Deployment (com.marcnuri.yakc.model.io.k8s.api.apps.v1.Deployment)7 DeploymentSpec (com.marcnuri.yakc.model.io.k8s.api.apps.v1.DeploymentSpec)2 Test (org.junit.jupiter.api.Test)2 NotFoundException (com.marcnuri.yakc.api.NotFoundException)1 AppsV1Api (com.marcnuri.yakc.api.apps.v1.AppsV1Api)1 ListPodForAllNamespaces (com.marcnuri.yakc.api.core.v1.CoreV1Api.ListPodForAllNamespaces)1 PodList (com.marcnuri.yakc.model.io.k8s.api.core.v1.PodList)1 Random (java.util.Random)1 DisplayName (org.junit.jupiter.api.DisplayName)1