private void watchPods(ApiClient apiClient, ServiceMetadata serviceMetadata, String namespace,
                           String latestPodSelector, Integer replicas) throws HyscaleException {
        EventPublisher publisher = EventPublisher.getInstance();
        PodStageEvent.PodStage currentStage = PodStageEvent.PodStage.INITIALIZATION;

        Set<String> readyPods = new HashSet<>();
        Set<String> initializedPods = new HashSet<>();
        Set<String> createdPods = new HashSet<>();

        ActivityContext initializedActivityContext = new ActivityContext(DeployerActivity.POD_INITIALIZED);
        ActivityContext creationActivityContext = new ActivityContext(DeployerActivity.POD_CREATION);
        ActivityContext readyActivityContext = new ActivityContext(DeployerActivity.POD_READINESS);
        ActivityContext currentActivityContext = initializedActivityContext;
        boolean initializationActivityDone = false;
        boolean creationActivityStarted = false;
        boolean creationActivityDone = false;
        boolean readyActivityStarted = false;
        WorkflowLogger.startActivity(initializedActivityContext);
        Long startTime = System.currentTimeMillis();
        boolean isTimeout = true;
        while (System.currentTimeMillis() - startTime < replicas * MAX_TIME_TO_CONTAINER_READY) {
            WorkflowLogger.continueActivity(currentActivityContext);
            try (Watch<V1Pod> watch = getWatch(apiClient, namespace, latestPodSelector)) {
                for (Watch.Response<V1Pod> item : watch) {
                    String status = PodStatusUtil.currentStatusOf(item.object);
                    WorkflowLogger.continueActivity(currentActivityContext);
                    /*if pod  status is failed then watch will exit*/
                    if (PodPredicates.isPodFailed().test(item.object)) {
                        isTimeout = false;
                        break;
                    }

                    /*if pod restart count is reached to specified pod_restart_count then watch will exit*/
                    if (PodPredicates.isPodRestarted().test(item.object, POD_RESTART_COUNT)) {
                        isTimeout = false;
                        break;
                    }

                    if (PodPredicates.isPodInitialized().test(item.object)) {
                        initializedPods.add(item.object.getMetadata().getName());
                        /*pod initialization activity completed*/
                        if (initializedPods.size() == replicas && !initializationActivityDone) {
                            initializationActivityDone = true;
                            WorkflowLogger.endActivity(initializedActivityContext, Status.DONE);
                            publisher.publishEvent(new PodStageEvent(serviceMetadata, namespace, currentStage, status));
                        }
                    }

                    if (initializationActivityDone && !creationActivityStarted) {
                        currentActivityContext = creationActivityContext;
                        WorkflowLogger.startActivity(creationActivityContext);
                        creationActivityStarted = true;
                        currentStage = PodStageEvent.PodStage.CREATION;
                    }
                    if (PodPredicates.isPodCreated().test(item.object)) {
                        createdPods.add(item.object.getMetadata().getName());
                        /*pod creation activity completed*/
                        if (createdPods.size() == replicas && !creationActivityDone) {
                            WorkflowLogger.endActivity(creationActivityContext, Status.DONE);
                            creationActivityDone = true;
                            publisher.publishEvent(new PodStageEvent(serviceMetadata, namespace, currentStage, status));
                        }
                    }

                    if (creationActivityDone && !readyActivityStarted) {
                        currentActivityContext = readyActivityContext;
                        WorkflowLogger.startActivity(readyActivityContext);
                        readyActivityStarted = true;
                        currentStage = PodStageEvent.PodStage.READINESS;
                    }
                    if (PodPredicates.isPodReady().test(item.object)) {
                        readyPods.add(item.object.getMetadata().getName());
                        /*pod readiness activity completed*/
                        if (readyPods.size() == replicas) {
                            WorkflowLogger.endActivity(readyActivityContext, Status.DONE);
                            publisher.publishEvent(new PodStageEvent(serviceMetadata, namespace, currentStage, status));
                            isTimeout = false;
                            break;
                        }
                    }

                    if (readyPods.size() == replicas) {
                        isTimeout = false;
                        break;
                    }

                }
                if (!isTimeout) {
                    break;
                }
            } catch (IOException e) {
                LOGGER.error("Error while watching pods with selector {} in namespace {}", latestPodSelector, namespace, e);
            }
        }
        PodStageEvent event;
        if (isTimeout) {
            WorkflowLogger.endActivity(currentActivityContext, Status.FAILED);
            event = new PodStageEvent(serviceMetadata, namespace, currentStage);
            publisher.publishEvent(event);
            throw new HyscaleException(DeployerErrorCodes.TIMEOUT_WHILE_WAITING_FOR_DEPLOYMENT);
        }

        if (!initializationActivityDone) {
            event = new PodStageEvent(serviceMetadata, namespace, currentStage);
            event.setFailure(true);
            publisher.publishEvent(event);
            WorkflowLogger.endActivity(currentActivityContext, Status.FAILED);
            throw new HyscaleException(DeployerErrorCodes.FAILED_TO_INITIALIZE_POD);
        }
        if (!creationActivityDone) {
            event = new PodStageEvent(serviceMetadata, namespace, currentStage);
            event.setFailure(true);
            publisher.publishEvent(event);
            WorkflowLogger.endActivity(currentActivityContext, Status.FAILED);
            throw new HyscaleException(DeployerErrorCodes.FAILED_TO_CREATE_POD);
        }
        if (readyPods.size() != replicas) {
            event = new PodStageEvent(serviceMetadata, namespace, currentStage);
            event.setFailure(true);
            publisher.publishEvent(event);
            WorkflowLogger.endActivity(currentActivityContext, Status.FAILED);
            throw new HyscaleException(DeployerErrorCodes.POD_FAILED_READINESS);
        }

    }
It will fetch pod parent by using of servicename and namespace, based on pod parent it will get  latestpodselector.
Now it will start watching pod event changes on cluster based on namespace and latestpodselector.
While watching pods it is reading status, here we are mainly reading three status (initialization, creations and readiness),
after completion of each status we are showing status done message, whenever we get any pod has failed status immediately come out from watch
and show deployment fail message.

@param apiClient
@param appName
@param serviceName
@param namespace
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/handler/impl/V1PodHandler.java