@Override
    public boolean delete(ApiClient apiClient, String name, String namespace, boolean wait) throws HyscaleException {
        ActivityContext activityContext = new ActivityContext(DeployerActivity.DELETING_HORIZONTAL_POD_AUTOSCALER);
        WorkflowLogger.startActivity(activityContext);
        try {
            delete(apiClient, name, namespace);
            List<String> pendingHPAs = Lists.newArrayList();
            pendingHPAs.add(name);
            if (wait) {
                waitForResourceDeletion(apiClient, pendingHPAs, namespace, activityContext);
            }
        } catch (ApiException e) {
            if (e.getCode() == 404) {
                WorkflowLogger.endActivity(activityContext, Status.NOT_FOUND);
                return false;
            }
            HyscaleException ex = new HyscaleException(e, DeployerErrorCodes.FAILED_TO_DELETE_RESOURCE,
                    ExceptionHelper.getExceptionMessage(getKind(), e, ResourceOperation.DELETE));
            logger.error("Error while deleting HorizontalPodAutoScaler {} in namespace {}, error {} ", name, namespace,
                    ex.toString());
            WorkflowLogger.endActivity(activityContext, Status.FAILED);
            throw ex;
        }
        WorkflowLogger.endActivity(activityContext, Status.DONE);
        return true;
    }
This class is responsible for the lifecycle operations of resource
HorizontalPodAutoScaler in kubernetes cluster. It creates resource of
apiVersion: autoscaling/v1
kind: HorizontalPodAutoScaler
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/handler/impl/V1HorizontalPodAutoScalerHandler.java