public static LoadBalancer getLoadBalancerSpec(PodParent podParent) {
        try {
            V1ObjectMeta metadata = null;
            if (ResourceKind.DEPLOYMENT.getKind().equalsIgnoreCase(podParent.getKind())) {
                metadata = ((V1Deployment) podParent.getParent()).getMetadata();
            }
            if (ResourceKind.STATEFUL_SET.getKind().equalsIgnoreCase(podParent.getKind())) {
                metadata = ((V1StatefulSet) podParent.getParent()).getMetadata();
            }
            if (metadata != null) {
                JsonParser jsonParser = new JsonParser();
                JsonObject serviceSpec = (JsonObject) jsonParser.parse(metadata.getAnnotations().get(AnnotationKey.HYSCALE_SERVICE_SPEC.getAnnotation()));
                if (serviceSpec.get("loadBalancer") != null) {
                    return GsonProviderUtil.getPrettyGsonBuilder().fromJson(serviceSpec.get("loadBalancer"), LoadBalancer.class);
                }
            }
        } catch (Exception e) {
            logger.error("Error while retrieving loadBalancer configuration in service spec. Reason :", e);
        }
        return null;
    }
This method is responsible for retrieving loadBalancer spec from 'hyscale.io/service-spec' annotation present in deployed Pod Parent resource.
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/processor/PodParentUtil.java