'Extract labels + creator and service tags from a list of
pods coming from the kubelet API.
:param excluded_keys: labels to skip
:param label_prefix: prefix for label->tag conversion, None defaults
to the configuration option label_to_tag_prefix
Returns a dict{namespace/podname: [tags]}'

def extract_kube_pod_tags(self, pods_list, excluded_keys=None, label_prefix=None):

    excluded_keys = (excluded_keys or [])
    kube_labels = defaultdict(list)
    pod_items = (pods_list.get('items') or [])
    label_prefix = (label_prefix or self.kube_label_prefix)
    for pod in pod_items:
        metadata = pod.get('metadata', {})
        name = metadata.get('name')
        namespace = metadata.get('namespace')
        labels = metadata.get('labels', {})
        if (name and namespace):
            key = ('%s/%s' % (namespace, name))
            podtags = self.get_pod_creator_tags(metadata)
            if self.collect_service_tag:
                for service in self.match_services_for_pod(metadata):
                    if (service is not None):
                        podtags.append((u'kube_service:%s' % service))
            for (k, v) in labels.iteritems():
                if (k in excluded_keys):
                    continue
                podtags.append((u'%s%s:%s' % (label_prefix, k, v)))
            kube_labels[key] = podtags
    return kube_labels
