use of io.fabric8.arquillian.kubernetes.log.Logger in project iobserve-analysis by research-iobserve.
the class AllocationExecutor method execute.
@Override
public void execute(final AllocateNodeAction action) {
final ResourceContainer resourceContainer = action.getTargetResourceContainer();
final String rcName = this.normalizeComponentName(resourceContainer.getEntityName());
final Map<String, String> labels = this.computeDeploymentLabels(resourceContainer);
// Build deployment blueprint
final Deployment podDeployment = //
new DeploymentBuilder().withApiVersion(//
AllocationExecutor.API_VERSION).withKind(//
"Deployment").withNewMetadata().withLabels(//
labels).withName(//
rcName).endMetadata().withNewSpec().withReplicas(//
1).withNewSelector().addToMatchLabels(AllocationExecutor.COMPONENT_LABEL_KEY, //
rcName).endSelector().withNewTemplate().withNewMetadata().addToLabels(AllocationExecutor.COMPONENT_LABEL_KEY, //
rcName).withName(//
rcName).endMetadata().withNewSpec().withHostname(//
rcName).withSubdomain(//
this.subdomain).addNewContainer().withImage(//
this.imageLocator).withName(//
"").withNewResources().endResources().addNewEnv().withName(//
"LOGGER").withValue(//
"%LOGGER%").endEnv().endContainer().endSpec().endTemplate().endSpec().build();
this.podsToDeploy.put(rcName, podDeployment);
if (AllocationExecutor.LOGGER.isDebugEnabled()) {
AllocationExecutor.LOGGER.debug("Created blueprint for pod deployment " + podDeployment.getMetadata().getName());
}
}
Aggregations