Search in sources :

Example 1 with DeploymentSpec

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

the class Deployments method restart.

private int restart(KubernetesClient kc) throws IOException {
    if (params == null || params.length != 1) {
        error("Missing required param <name>");
        return 1;
    }
    final String name = params[0];
    final String applicableNamespace = namespace(kc);
    final Deployment toPatch = new Deployment();
    toPatch.setSpec(new DeploymentSpec());
    toPatch.getSpec().setTemplate(PodTemplateSpec.builder().metadata(ObjectMeta.builder().putInAnnotations("yakc.marcnuri.com/restartedAt", Instant.now().toString()).build()).build());
    kc.create(AppsV1Api.class).patchNamespacedDeployment(name, applicableNamespace, toPatch).get();
    return 0;
}
Also used : DeploymentSpec(com.marcnuri.yakc.model.io.k8s.api.apps.v1.DeploymentSpec) Deployment(com.marcnuri.yakc.model.io.k8s.api.apps.v1.Deployment)

Example 2 with DeploymentSpec

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

the class DeploymentService method emptyDeployment.

private static Deployment emptyDeployment() {
    final Deployment ret = new Deployment();
    ret.setSpec(new DeploymentSpec());
    return ret;
}
Also used : DeploymentSpec(com.marcnuri.yakc.model.io.k8s.api.apps.v1.DeploymentSpec) Deployment(com.marcnuri.yakc.model.io.k8s.api.apps.v1.Deployment)

Aggregations

Deployment (com.marcnuri.yakc.model.io.k8s.api.apps.v1.Deployment)2 DeploymentSpec (com.marcnuri.yakc.model.io.k8s.api.apps.v1.DeploymentSpec)2