private K8sServiceType getServiceType(ServiceSpec serviceSpec) throws HyscaleException {
        Boolean external = serviceSpec.get(HyscaleSpecFields.external, Boolean.class);
        if (BooleanUtils.toBoolean(external)) {
            if (checkForLoadBalancer(serviceSpec)) {
                return K8sServiceType.CLUSTER_IP;
            } else {
                return K8sServiceType.LOAD_BALANCER;
            }
        } else {
            return K8sServiceType.CLUSTER_IP;
        }
    }
If loadBalancer is configured and external is specified as true in hspec, then Service type could be CLUSTER_IP.
If loadBalancer is not configured and external is true then service type could be LOAD_BALANCER.
manifest-generator/generator-services/src/main/java/io/hyscale/generator/services/plugins/ServiceTypeHandler.java