Examples of PodSchema


Examples of io.fabric8.kubernetes.api.model.PodSchema

    @Override
    public Result execute(UIExecutionContext context) throws Exception {
        Kubernetes kubernetes = getKubernetes();

        String podIdText = podId.getValue();
        PodSchema podInfo = kubernetes.getPod(podIdText);
        if (podInfo == null) {
            System.out.println("No pod for id: " + podIdText);
        } else {
            executePod(podInfo, podIdText);
        }
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.PodSchema

public class KubernetesHelperTest {

  @Test
  public void testRemoveEmptyPods() throws Exception {
   
    PodSchema pod1 = new PodSchema();
    pod1.setId("test1");
   
    PodSchema pod2 = new PodSchema();
   
    PodListSchema podSchema = new PodListSchema();
    podSchema.getItems().add(pod1);
    podSchema.getItems().add(pod2);
   
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.PodSchema

    protected static void createPod(Kubernetes kubernetes, KubernetesFactory kubernetesFactory) throws Exception {
        String name = "cheese";
        String image = "fabric8/fabric8";

        PodSchema pod = new PodSchema();
        pod.setId(name);

        Map<String, String> labels = new HashMap<>();
        labels.put("fabric8", "true");
        labels.put("container", name);

        pod.setLabels(labels);
        DesiredState desiredState = new DesiredState();
        pod.setDesiredState(desiredState);
        Manifest manifest = new Manifest();
        manifest.setVersion(Manifest.Version.V_1_BETA_1);
        desiredState.setManifest(manifest);

        ManifestContainer manifestContainer = new ManifestContainer();
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.PodSchema

                    CreateKubernetesContainerMetadata kubernetesContainerMetadata = (CreateKubernetesContainerMetadata) metadata;
                    String status = Container.PROVISION_SUCCESS;
                    List<String> podIds = notNullList(kubernetesContainerMetadata.getPodIds());
                    List<String> errors = new ArrayList<>();
                    for (String id : podIds) {
                        PodSchema pod = podMap.get(id);
                        String kubeletStatus = checkStatus(id, pod, errors);
                        if (!isProvisionSuccess(kubeletStatus)) {
                            status = kubeletStatus;
                        }
                    }
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.PodSchema

    protected Object doExecute() throws Exception {
        Kubernetes kubernetes = kubernetesService.getKubernetes();
        Objects.notNull(kubernetes, "kubernetes");
        Objects.notNull(pod, "pod");

        PodSchema podInfo = kubernetes.getPod(pod);
        if (podInfo == null) {
            System.out.println("No pod for id: " + pod);
        } else {
            printPodInfo(podInfo);
        }
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.PodSchema

                        if (tree != null) {
                            JsonNode kindNode = tree.get("kind");
                            if (kindNode != null) {
                                String kind = kindNode.asText();
                                if (Objects.equal("Pod", kind)) {
                                    PodSchema podSchema = objectMapper.reader(PodSchema.class).readValue(json);
                                    configurePod(podSchema, service, options, metadata);
                                    answer.put(definition, podSchema);
                                } else if (Objects.equal("ReplicationController", kind)) {
                                    ReplicationControllerSchema replicationControllerSchema = objectMapper.reader(ReplicationControllerSchema.class).readValue(json);
                                    configureReplicationController(replicationControllerSchema, service, options, metadata);
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.PodSchema

        Set<Map.Entry<String, Object>> entries = kubelets.entrySet();
        for (Map.Entry<String, Object> entry : entries) {
            String definition = entry.getKey();
            Object kubelet = entry.getValue();
            if (kubelet instanceof PodSchema) {
                PodSchema podSchema = (PodSchema) kubelet;
                if (podMap == null) {
                    podMap = getPodMap(kubernetes);
                }
                String id = podSchema.getId();
                PodSchema old = podMap.get(id);
                if (isRunning(old)) {
                    LOG.info("Not creating pod for " + id + " from definition " + definition + " as its already running");
                } else {
                    LOG.info("Creating a pod from " + definition);
                    try {
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.PodSchema

        Set<Map.Entry<String, Object>> entries = kubelets.entrySet();
        for (Map.Entry<String, Object> entry : entries) {
            String definition = entry.getKey();
            Object kubelet = entry.getValue();
            if (kubelet instanceof PodSchema) {
                PodSchema podSchema = (PodSchema) kubelet;
                if (podMap == null) {
                    podMap = getPodMap(kubernetes);
                }
                String id = podSchema.getId();
                PodSchema old = podMap.get(id);
                if (isRunning(old)) {
                    try {
                        deletePod(id);
                    } catch (Exception e) {
                        LOG.error("Failed to delete pod " + id + " from " + definition + ": " + e + ". ", e);
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.PodSchema

        String image = containerConfig.getImage();
        Set<String> profileIds = options.getProfiles();
        String versionId = options.getVersion();
        FabricService service = getFabricService();

        PodSchema pod = new PodSchema();
        pod.setId(KubernetesHelpers.containerNameToPodId(name));

        Map<String, String> labels = updateLabels(null, service, name, profileIds, versionId);

        pod.setLabels(labels);
        DesiredState desiredState = new DesiredState();
        pod.setDesiredState(desiredState);
        ManifestSchema manifest = new ManifestSchema();
        manifest.setVersion(ManifestSchema.Version.V_1_BETA_1);
        desiredState.setManifest(manifest);

        ManifestContainer manifestContainer = new ManifestContainer();
View Full Code Here

Examples of io.fabric8.kubernetes.api.model.PodSchema

    }

    // Helper methods
    //-------------------------------------------------------------------------
    public ReplicationControllerSchema getReplicationControllerForPod(String podId) {
        PodSchema pod = getPod(podId);
        return getReplicationControllerForPod(pod);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.