private boolean portValidation(ServiceSpec serviceSpec, LoadBalancer loadBalancer) throws HyscaleException {

        List<String> portNumbersList = portsProvider.getExposedPorts(serviceSpec, true);
        List<String> lbPorts = new ArrayList<>();
        loadBalancer.getMapping().forEach(e -> lbPorts.add(e.getPort()));
        for (String lbPort : lbPorts) {
            lbPort = defaultPortsBuilder.updatePortProtocol(lbPort);
            if (!portNumbersList.contains(lbPort)) {
                WorkflowLogger.persist(ValidatorActivity.PORTS_MISMATCH, LoggerTags.ERROR, lbPort);
                addErrorMessage(ValidatorActivity.PORTS_MISMATCH.getActivityMessage(), lbPort);
                return false;
            }
        }
        return true;
    }
Checks for Ports mismatch
@param serviceSpec
@param loadBalancer
@return
@throws HyscaleException
workflow-controller/controller-service/src/main/java/io/hyscale/controller/validator/impl/LoadBalancerValidator.java