@Override
    public V1HorizontalPodAutoscaler create(ApiClient apiClient, V1HorizontalPodAutoscaler resource, String namespace) throws HyscaleException {
        if (resource == null) {
            logger.debug("Cannot create null HorizontalPodAutoScaler");
            return resource;
        }
        WorkflowLogger.startActivity(DeployerActivity.DEPLOYING_HORIZONTAL_AUTO_SCALER);
        AutoscalingV1Api autoscalingV1Api = new AutoscalingV1Api(apiClient);
        V1HorizontalPodAutoscaler v1HorizontalPodAutoscaler = null;
        try {
            resource.getMetadata().putAnnotationsItem(
                    AnnotationKey.K8S_HYSCALE_LAST_APPLIED_CONFIGURATION.getAnnotation(), GsonProviderUtil.getPrettyGsonBuilder().toJson(resource));
            v1HorizontalPodAutoscaler = autoscalingV1Api.createNamespacedHorizontalPodAutoscaler(namespace, resource, DeployerConstants.TRUE, null, null);
        } catch (ApiException e) {
            HyscaleException ex = new HyscaleException(e, DeployerErrorCodes.FAILED_TO_CREATE_RESOURCE,
                    ExceptionHelper.getExceptionMessage(getKind(), e, ResourceOperation.CREATE));
            logger.error("Error while creating HorizontalPodAutoScaler {} in namespace {}, error {}", v1HorizontalPodAutoscaler, namespace,
                    ex.toString());
            WorkflowLogger.endActivity(Status.FAILED);
            throw ex;
        }
        WorkflowLogger.endActivity(Status.DONE);
        return v1HorizontalPodAutoscaler;
    }
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