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;
}
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;
}
Aggregations