Search in sources :

Example 86 with Logger

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());
    }
}
Also used : Deployment(io.fabric8.kubernetes.api.model.extensions.Deployment) DeploymentBuilder(io.fabric8.kubernetes.api.model.extensions.DeploymentBuilder) ResourceContainer(org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)

Aggregations

Test (org.junit.Test)47 File (java.io.File)26 BuildImageConfiguration (io.fabric8.maven.docker.config.BuildImageConfiguration)20 Verifications (mockit.Verifications)17 ArrayList (java.util.ArrayList)15 ImageConfiguration (io.fabric8.maven.docker.config.ImageConfiguration)12 OpenShiftClient (io.fabric8.openshift.client.OpenShiftClient)10 IOException (java.io.IOException)9 Expectations (mockit.Expectations)9 URL (java.net.URL)8 GeneratorContext (io.fabric8.maven.generator.api.GeneratorContext)7 ProcessorConfig (io.fabric8.maven.core.config.ProcessorConfig)6 ResourceValidator (io.fabric8.maven.core.util.validator.ResourceValidator)6 AssemblyConfiguration (io.fabric8.maven.docker.config.AssemblyConfiguration)6 Logger (io.fabric8.maven.docker.util.Logger)6 MojoParameters (io.fabric8.maven.docker.util.MojoParameters)6 Properties (java.util.Properties)6 Util.readAsString (io.fabric8.arquillian.utils.Util.readAsString)5 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)5 Pod (io.fabric8.kubernetes.api.model.Pod)5