Search in sources :

Example 6 with DefaultKubernetesClient

use of io.fabric8.kubernetes.client.DefaultKubernetesClient 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 7 with DefaultKubernetesClient

use of io.fabric8.kubernetes.client.DefaultKubernetesClient 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 8 with DefaultKubernetesClient

use of io.fabric8.kubernetes.client.DefaultKubernetesClient 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 9 with DefaultKubernetesClient

use of io.fabric8.kubernetes.client.DefaultKubernetesClient 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 10 with DefaultKubernetesClient

use of io.fabric8.kubernetes.client.DefaultKubernetesClient in project jointware by isdream.

the class JSONToExecutorSampleTest method main.

/**
 ********************************************
 *
 *                Main
 *
 *********************************************
 */
public static void main(String[] args) throws Exception {
    // JsonToMap
    Map<String, Map<String, Object>> originRequest = getClientRequest();
    // getClient
    DefaultKubernetesClient client = (DefaultKubernetesClient) createClient(originRequest.get("target"));
    // toTartgetMap
    Map<String, Map<String, Object>> targetRequest = toTargetMap(originRequest, "jointwareRef");
    // option : test
    ModelGenerator mg = new KubernetesModelGenerator();
    System.out.println(mg.toObject(targetRequest, Deployment.class.getSimpleName()));
    // getExcutor
    ConatinerExecutor executor = (ConatinerExecutor) createExecutor(originRequest.get("target"));
// impl
// executor.create(client, getKind(originRequest.remove("target")), targetRequest);
}
Also used : KubernetesModelGenerator(com.github.isdream.jointware.kubernetes.KubernetesModelGenerator) KubernetesModelGenerator(com.github.isdream.jointware.kubernetes.KubernetesModelGenerator) ModelGenerator(com.github.isdream.jointware.core.ModelGenerator) DefaultKubernetesClient(io.fabric8.kubernetes.client.DefaultKubernetesClient) Map(java.util.Map)

Aggregations

DefaultKubernetesClient (io.fabric8.kubernetes.client.DefaultKubernetesClient)101 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)77 File (java.io.File)27 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)22 FileInputStream (java.io.FileInputStream)22 HashMap (java.util.HashMap)13 Test (org.testng.annotations.Test)12 Config (io.fabric8.kubernetes.client.Config)11 BuildConfig (io.fabric8.openshift.api.model.BuildConfig)11 BeforeClass (org.testng.annotations.BeforeClass)10 Service (io.fabric8.kubernetes.api.model.Service)8 ConfigBuilder (io.fabric8.kubernetes.client.ConfigBuilder)7 KubernetesClientException (io.fabric8.kubernetes.client.KubernetesClientException)7 ObjectMetaBuilder (io.fabric8.kubernetes.api.model.ObjectMetaBuilder)6 TaskAction (org.gradle.api.tasks.TaskAction)6 Pod (io.fabric8.kubernetes.api.model.Pod)5 Map (java.util.Map)5 Test (org.junit.Test)5 KubernetesModelGenerator (com.github.isdream.chameleon.container.kubernetes.KubernetesModelGenerator)4 ImmutableMap (com.google.common.collect.ImmutableMap)4