web_backend_develope
wu ming 8 years ago
parent da8124d4a6
commit bc646990e4

@ -0,0 +1,5 @@
package com.platform.kubernetes;
public class BasedPathEntity {
}

@ -4,6 +4,8 @@ import io.fabric8.kubernetes.api.model.Container;
import io.fabric8.kubernetes.api.model.ContainerPort;
import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.api.model.ReplicationController;
import io.fabric8.kubernetes.api.model.Volume;
import io.fabric8.kubernetes.api.model.VolumeMount;
import io.fabric8.kubernetes.client.Client;
import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.ConfigBuilder;
@ -156,4 +158,27 @@ public class SimpleKubeClient {
client.close();
}
/**
*
* @param rcId --> Id
* @param ns -->
* @return
*/
public ReplicationController createReplicas(String rcId, String ns) {
if (checkClientNull())
client = new DefaultKubernetesClient(Configs.KUBE_MASTER_URL);
ReplicationController rc = client.replicationControllers()
.inNamespace(ns).createNew().editMetadata().withName(rcId)
.endMetadata().done();
return rc;
}
public ReplicationController createReplicas(String rcId, String ns, Map<String, String> selector,Volume volume, VolumeMount volumeMounts){
if (checkClientNull())
client = new DefaultKubernetesClient(Configs.KUBE_MASTER_URL);
//Container container = new Container("", "", "", "", "", null, null, "oracle", ports, null, null, null, false, false, null, false, volumeMounts, null);
//container.setName("oracle");
//ReplicationController rController = client.replicationControllers().inNamespace(ns).createNew().editMetadata().withName(rcId).withLabels(selector).endMetadata().editSpec().withReplicas(1).withSelector(selector).editTemplate().editMetadata().withLabels(selector).endMetadata().editSpec().addNewContainer().a.
return null;
}
}

Loading…
Cancel
Save