@Override
    public void unDeploy(DeploymentContext context) throws HyscaleException {
        String appName = context.getAppName();
        String serviceName = context.getServiceName();
        String namespace = context.getNamespace();

        ServiceMetadata serviceMetadata = new ServiceMetadata();
        serviceMetadata.setAppName(appName);
        serviceMetadata.setServiceName(serviceName);
        UnDeployEvent event = new UnDeployEvent(ActivityState.STARTED, serviceMetadata, namespace);
        publisher.publishEvent(event);
        K8sResourceDispatcher resourceDispatcher = new K8sResourceDispatcher(
                clientProvider.get((K8sAuthorisation) context.getAuthConfig()));
        try {
            if(serviceName!=null && !serviceName.isBlank()){
                resourceDispatcher.withNamespace(namespace).undeployService(appName, serviceName);
            }else{
                resourceDispatcher.withNamespace(namespace).undeployApp(appName);
            }
            event = new UnDeployEvent(ActivityState.DONE, serviceMetadata, namespace);
        } catch (HyscaleException e) {
            logger.error("Error while undeploying service in namespace {} , error {} ", namespace, e.toString());
            event = new UnDeployEvent(ActivityState.FAILED, serviceMetadata, namespace);
            throw e;
        } finally {
            publisher.publishEvent(event);
        }
    }
Wait for Pod scheduled, creation and Readiness state
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/deployer/impl/KubernetesDeployer.java