'Match the pods labels with services\' label selectors to determine the list
of services that point to that pod. Returns an array of service uids or names.
Pass names=True if you want the service name instead of the uids
Pass refresh=True if you want to bypass the cached cid->services mapping (after a service change)'

def match_services_for_pod(self, pod_metadata, refresh=False, names=False):

    matches = []
    if self._403_disable:
        return matches
    try:
        pod_id = pod_metadata['uid']
        pod_labels = pod_metadata.get('labels', {})
        self._pod_labels_cache[pod_id] = pod_labels
        if ((refresh is False) and (pod_id in self._pod_services_mapping)):
            matches = self._pod_services_mapping[pod_id]
        else:
            if (self._service_cache_invalidated is True):
                self._fill_services_cache()
            for (service_uid, label_selectors) in self._service_cache_selectors.iteritems():
                if self._does_pod_fulfill_selectors(pod_labels, label_selectors):
                    matches.append(service_uid)
            self._pod_services_mapping[pod_id] = matches
        if names:
            return [self._service_cache_names.get(uid) for uid in matches]
        else:
            return matches
    except Exception as e:
        log.exception('Error    while    matching    k8s    services:    %s', e)
        return []
