settingsLogin | Registersettings

[openstack-community] [openstack-dev][kuryr] kuryr-cni watch question

0 votes


I have one question about kuryr-cni watch for pod.

Kuryr-k8s-controller will watch pod resource, if founded, then it will request resource from neutron, and annotation the pod object.

Kuryr-cni will watch the pod, if the metadata of the pod changed, then it will create pod network on host computer.

Then my question is: Before kuryr-cni starting to watch the pod, Kuryr-k8s-controller have annotated the pod, does it mean kuryr-cni will not get the changing event forever?

class K8sClient(object):

def watch(self, path):
    params = {'watch': 'true'}
    url = self._base_url + path
    header = {}
    if self.token:
        header.update({'Authorization': 'Bearer %s' % self.token})

    # TODO(ivc): handle connection errors and retry on failure
    while True:
        with contextlib.closing(
                requests.get(url, params=params, stream=True,
                             cert=self.cert, verify=self.verify_server,
                             headers=header)) as response:
            if not response.ok:
                raise exc.K8sClientException(response.text)
            for line in response.iter_lines(delimiter='\n'):
                line = line.strip()
                if line:
                    yield jsonutils.loads(line)


Community mailing list

asked Aug 31, 2017 in openstack-community by Keon_Tang (140 points)  

1 Response

0 votes

On 08/30/2017 09:42 PM, Keon Tang wrote:
I have one question about kuryr-cni watch for pod.

wrong mailing list.

For technical questions use Ask OpenStack or
the general mailing list

More resources, also in different languages:


Community mailing list
responded Aug 31, 2017 by Stefano_Maffulli (11,060 points)   4 8 11