settingsLogin | Registersettings

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

0 votes

Hi,

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)

BR

Keon_______________________________________________
Community mailing list
Community@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/community

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 https://ask.openstack.org/ or
the general mailing list
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

More resources, also in different languages:
https://openstack.org/community/#help

regards,
Stef


Community mailing list
Community@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/community
responded Aug 31, 2017 by Stefano_Maffulli (11,060 points)   3 6 10
...