@Override
    public List<ManifestSnippet> build(ManifestContext manifestContext, ServiceSpec serviceSpec) throws HyscaleException {
        List<ManifestSnippet> manifestSnippetList = Lists.newArrayList();
        List<Agent> agents = getAgents(serviceSpec);
        if (agents.isEmpty()) {
            return manifestSnippetList;
        }
        String podSpecOwner = ((String) manifestContext.getGenerationAttribute(ManifestGenConstants.POD_SPEC_OWNER));
        List<Port> portList;
        int agentCount = 1;
        for (Agent agent : agents) {
            portList = agent.getPorts();
            logger.info("Processing Ports for Agent {} ", agent.getName());
            if (portList != null && !portList.isEmpty()) {
                manifestSnippetList.addAll(defaultPortsBuilder.generatePortsManifest(portList, podSpecOwner, agentCount++));
            }
        }
        return manifestSnippetList;
    }
This class generates manifests to
exposes all the Agent Ports.
manifest-generator/generator-services/src/main/java/io/hyscale/generator/services/utils/AgentPortBuilder.java