Пример #1
0
    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()