@Override
    public boolean scale(ApiClient apiClient, V1StatefulSet v1StatefulSet, String namespace, int value) throws HyscaleException {
        if (v1StatefulSet == null) {
            LOGGER.error("Cannot scale 'null' deployment");
            return false;
        }
        String name = v1StatefulSet.getMetadata().getName();
        int currentReplicas = v1StatefulSet.getSpec().getReplicas();
        String lastAppliedConfig = v1StatefulSet.getMetadata().getAnnotations()
                .get(AnnotationKey.K8S_HYSCALE_LAST_APPLIED_CONFIGURATION.getAnnotation());
        V1StatefulSet latAppliedStateFulSet = GsonProviderUtil.getPrettyGsonBuilder().fromJson(lastAppliedConfig, V1StatefulSet.class);
        ActivityContext activityContext = new ActivityContext(DeployerActivity.SCALING_SERVICE);
        WorkflowLogger.startActivity(activityContext);
        boolean status = false;
        try {
            if (!(currentReplicas == value && latAppliedStateFulSet.getSpec().getReplicas() == value)) {
                latAppliedStateFulSet.getSpec().setReplicas(value);
                patch(apiClient, name, namespace, latAppliedStateFulSet);
            }
            status = waitForDesiredState(apiClient, name, namespace, activityContext);
        } catch (HyscaleException e) {
            LOGGER.error("Error while applying PATCH scale to {} due to : {} code :{}", name, e.getMessage(), e.getCode(), e);
            WorkflowLogger.endActivity(Status.FAILED);
            HyscaleException ex = new HyscaleException(DeployerErrorCodes.ERROR_WHILE_SCALING, e.getMessage());
            throw ex;
        } finally {
            if (status) {
                if (value < currentReplicas) {
                    WorkflowLogger.persist(DeployerActivity.SCALE_DOWN_VOLUME,
                            v1StatefulSet.getSpec().getVolumeClaimTemplates().stream()
                                    .map(each -> each.getMetadata().getName()).collect(Collectors.joining(",")),
                            namespace);
                }
                WorkflowLogger.endActivity(activityContext, Status.DONE);
            } else {
                WorkflowLogger.endActivity(activityContext, Status.FAILED);
            }
        }
        return status;
    }
@return It will return replica of pod, if replica is not there then it will
return default value 1
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/handler/impl/V1StatefulSetHandler.java