Search in sources :

Example 1 with Generator

use of io.fabric8.maven.generator.api.Generator in project jointware by isdream.

the class NamespaceTest method testCreateNamespace.

public void testCreateNamespace() throws Exception {
    DefaultKubernetesClient client = new DefaultKubernetesClient("http://118.190.46.58:9888");
    KubernetesModelGenerator generator = new KubernetesModelGenerator();
    generator.create(client, "Namespace", params);
}
Also used : KubernetesModelGenerator(com.github.isdream.chameleon.container.kubernetes.KubernetesModelGenerator) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient)

Example 2 with Generator

use of io.fabric8.maven.generator.api.Generator in project jointware by isdream.

the class NamespaceTest method testDeleteNamespace.

public void testDeleteNamespace() throws Exception {
    DefaultKubernetesClient client = new DefaultKubernetesClient("http://118.190.46.58:9888");
    KubernetesModelGenerator generator = new KubernetesModelGenerator();
    generator.delete(client, "Namespace", "test431");
}
Also used : KubernetesModelGenerator(com.github.isdream.chameleon.container.kubernetes.KubernetesModelGenerator) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient)

Example 3 with Generator

use of io.fabric8.maven.generator.api.Generator in project jointware by isdream.

the class DeploymentTest method testUpdateDeployment.

// public void testCreateDeployment() throws Exception {
// DefaultKubernetesClient client = new DefaultKubernetesClient("http://118.190.46.58:9888");
// KubernetesModelParametersGenerator generator = new KubernetesModelParametersGenerator();
// generator.create(client, KubernetesConstants.KIND_DEPLOYMENT, params);
// 
// }
public void testUpdateDeployment() throws Exception {
    DefaultKubernetesClient client = new DefaultKubernetesClient("http://118.190.46.58:9888");
    KubernetesModelGenerator generator = new KubernetesModelGenerator();
    generator.scaleTo(client, "Deployment", "default", "busybox-dm", 4);
}
Also used : KubernetesModelGenerator(com.github.isdream.chameleon.container.kubernetes.KubernetesModelGenerator) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient)

Example 4 with Generator

use of io.fabric8.maven.generator.api.Generator in project jointware by isdream.

the class DeploymentTest method testDeleteDeployment.

public void testDeleteDeployment() throws Exception {
    DefaultKubernetesClient client = new DefaultKubernetesClient("http://118.190.46.58:9888");
    KubernetesModelGenerator generator = new KubernetesModelGenerator();
    generator.delete(client, "Deployment", "default", "busybox-dm");
}
Also used : KubernetesModelGenerator(com.github.isdream.chameleon.container.kubernetes.KubernetesModelGenerator) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient)

Example 5 with Generator

use of io.fabric8.maven.generator.api.Generator in project jointware by isdream.

the class KubernetesExecutor method doCreateOrReplace.

@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
protected Object doCreateOrReplace(Object client, String kind, Map<String, Map<String, Object>> params) throws Exception {
    CreateOrReplaceable instance = (CreateOrReplaceable) getKindModel(client, kind);
    KubernetesModelGenerator generator = new KubernetesModelGenerator(getObjectRef());
    Object param = generator.toObject(params, kind);
    return instance.createOrReplace(param);
}
Also used : KubernetesModelGenerator(com.github.isdream.jointware.kubernetes.KubernetesModelGenerator) CreateOrReplaceable(io.fabric8.kubernetes.client.dsl.CreateOrReplaceable)

Aggregations

Test (org.junit.Test)9 BuildImageConfiguration (io.fabric8.maven.docker.config.BuildImageConfiguration)7 GeneratorContext (io.fabric8.maven.generator.api.GeneratorContext)7 ImageConfiguration (io.fabric8.maven.docker.config.ImageConfiguration)6 ProcessorConfig (io.fabric8.maven.core.config.ProcessorConfig)5 Properties (java.util.Properties)5 KubernetesModelGenerator (com.github.isdream.chameleon.container.kubernetes.KubernetesModelGenerator)4 DefaultKubernetesClient (io.fabric8.kubernetes.client.DefaultKubernetesClient)4 ArrayList (java.util.ArrayList)4 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)3 MavenProject (org.apache.maven.project.MavenProject)3 KubernetesModelGenerator (com.github.isdream.jointware.kubernetes.KubernetesModelGenerator)2 KubernetesResource (io.fabric8.kubernetes.api.model.KubernetesResource)2 StringWriter (java.io.StringWriter)2 Method (java.lang.reflect.Method)2 MojoFailureException (org.apache.maven.plugin.MojoFailureException)2 Visitable (io.fabric8.kubernetes.api.builder.Visitable)1 Visitor (io.fabric8.kubernetes.api.builder.Visitor)1 KubernetesList (io.fabric8.kubernetes.api.model.KubernetesList)1 KubernetesListBuilder (io.fabric8.kubernetes.api.model.KubernetesListBuilder)1