Package io.fabric8.kubernetes.api.model

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


    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

                        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

        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

        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

        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

    }

    // Helper methods
    //-------------------------------------------------------------------------
    public ReplicationControllerSchema getReplicationControllerForPod(String podId) {
        PodSchema pod = getPod(podId);
        return getReplicationControllerForPod(pod);
    }
View Full Code Here

    public void applyPod(PodSchema podSchema, String sourceName) {
        if (podMap == null) {
            podMap = getPodMap(kubernetes);
        }
        String id = podSchema.getId();
        PodSchema old = podMap.get(id);
        if (isRunning(old)) {
            LOG.info("Updating a pod from " + sourceName);
            try {
                Object answer = kubernetes.updatePod(id, podSchema);
                LOG.info("Updated pod result: " + answer);
View Full Code Here

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

        ReplicationControllerListSchema replicationControllers = kubernetes.getReplicationControllers();
        printReplicationControllers(replicationControllers, System.out);
        return null;
    }
View Full Code Here

        // populate autocompletion options
        replicationControllerId.setCompleter(new UICompleter<String>() {
            @Override
            public Iterable<String> getCompletionProposals(UIContext context, InputComponent<?, String> input, String value) {
                List<String> list = new ArrayList<String>();
                ReplicationControllerListSchema replicationControllers = getKubernetes().getReplicationControllers();
                if (replicationControllers != null) {
                    List<ReplicationControllerSchema> items = replicationControllers.getItems();
                    if (items != null) {
                        for (ReplicationControllerSchema item : items) {
                            String id = item.getId();
                            list.add(id);
                        }
View Full Code Here

TOP

Related Classes of io.fabric8.kubernetes.api.model.PodSchema

Copyright © 2018 www.massapicom. 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.