예제 #1
0
파일: tiller.py 프로젝트: nuaays/armada
    def _get_tiller_pod(self):
        '''
        Returns tiller pod using the tiller pod labels specified in the Armada
        config
        '''
        pods = self.k8s.get_namespace_pod(CONF.tiller_namespace,
                                          CONF.tiller_pod_labels).items
        # No tiller pods found
        if not pods:
            raise ex.TillerPodNotFoundException(CONF.tiller_pod_labels)

        # Return first tiller pod in running state
        for pod in pods:
            if pod.status.phase == 'Running':
                return pod

        # No tiller pod found in running state
        raise ex.TillerPodNotRunningException()
예제 #2
0
    def _get_tiller_pod(self):
        '''
        Returns Tiller pod using the Tiller pod labels specified in the Armada
        config
        '''
        pods = None
        namespace = self._get_tiller_namespace()
        pods = self.k8s.get_namespace_pod(
            namespace, label_selector=CONF.tiller_pod_labels).items
        # No Tiller pods found
        if not pods:
            raise ex.TillerPodNotFoundException(CONF.tiller_pod_labels)

        # Return first Tiller pod in running state
        for pod in pods:
            if pod.status.phase == 'Running':
                LOG.debug('Found at least one Running Tiller pod.')
                return pod

        # No Tiller pod found in running state
        raise ex.TillerPodNotRunningException()