Examples of ManifestContainer


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

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

        ManifestContainer manifestContainer = new ManifestContainer();
        manifestContainer.setName(name);
        manifestContainer.setImage(image);

        List<ManifestContainer> containers = new ArrayList<>();
        containers.add(manifestContainer);
        manifest.setContainers(containers);
View Full Code Here

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

                if (desiredState != null) {
                    ManifestSchema manifest = desiredState.getManifest();
                    if (manifest != null) {
                        List<ManifestContainer> containers = manifest.getContainers();
                        if (containers != null && containers.size() > 0) {
                            ManifestContainer container1 = containers.get(0);
                            List<Env> envList = container1.getEnv();
                            for (Env env : envList) {
                                environmentVariables.put(env.getName(), env.getValue());
                                environmentVariables.put(env.getName(), env.getValue());
                            }
                        }
View Full Code Here

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

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

        ManifestContainer manifestContainer = new ManifestContainer();
        manifestContainer.setName(name);
        manifestContainer.setImage(image);
        List<String> cmd = options.getCmd();
        if (cmd != null && !cmd.isEmpty()) {
            manifestContainer.setCommand(cmd);
        }
        manifestContainer.setWorkingDir(options.getWorkingDir());
        manifestContainer.setEnv(KubernetesHelper.createEnv(environmentVariables));

        // TODO
        //manifestContainer.setVolumeMounts();

        Map<String, String> portConfigurations = Profiles.getOverlayConfiguration(service, profileIds, versionId, Constants.PORTS_PID, "kubernetes");
        if (portConfigurations != null && portConfigurations.size() > 0) {
            List<Port> ports = new ArrayList<>();
            Set<Map.Entry<String, String>> entries = portConfigurations.entrySet();
            for (Map.Entry<String, String> entry : entries) {
                String portName = entry.getKey();
                String defaultPortValue = entry.getValue();
                if (Strings.isNotBlank(defaultPortValue)) {
                    Integer portNumber = null;
                    try {
                        portNumber = Integer.parseInt(defaultPortValue);
                    } catch (NumberFormatException e) {
                        LOG.warn("Could not parse '" + defaultPortValue
                                + "' as integer for port " + portName
                                + " for profiles " + profileIds + " " + versionId + ". " + e, e);
                    }
                    String hostPortText = environmentVariables.get("FABRIC8_" + portName + "_PROXY_PORT");
                    Integer hostPort = null;
                    if (hostPortText != null) {
                        try {
                            hostPort = Integer.parseInt(hostPortText);
                        } catch (NumberFormatException e) {
                            LOG.warn("Could not parse '" + hostPortText
                                    + "' as integer for port " + portName
                                    + " for profiles " + profileIds + " " + versionId + ". " + e, e);
                        }
                    }
                    if (portNumber != null && hostPort != null) {
                        Port port = new Port();
                        //port.setName(portName);
                        //port.setProtocol(portName.toLowerCase());
                        //port.setProtocol("tcp");
                        port.setContainerPort(portNumber);
                        port.setHostPort(hostPort);
                        ports.add(port);
                    }
                }
            }
            manifestContainer.setPorts(ports);
        }

        List<ManifestContainer> containers = new ArrayList<>();
        containers.add(manifestContainer);
        manifest.setContainers(containers);
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.