Browse Source

Merge "Skip KuryrLoadbalancer creation for Headless Service"

changes/79/753279/3
Zuul 7 months ago
committed by Gerrit Code Review
parent
commit
f852e76056
2 changed files with 5 additions and 1 deletions
  1. +2
    -0
      kuryr_kubernetes/constants.py
  2. +3
    -1
      kuryr_kubernetes/controller/handlers/lbaas.py

+ 2
- 0
kuryr_kubernetes/constants.py View File

@ -69,6 +69,8 @@ K8S_ANNOTATION_OLD_DRIVER = 'old_driver'
K8S_ANNOTATION_CURRENT_DRIVER = 'current_driver'
K8S_ANNOTATION_NEUTRON_PORT = 'neutron_id'
K8S_ANNOTATION_HEADLESS_SERVICE = 'service.kubernetes.io/headless'
POD_FINALIZER = KURYR_FQDN + '/pod-finalizer'
KURYRNETWORK_FINALIZER = 'kuryrnetwork.finalizers.kuryr.openstack.org'
KURYRLB_FINALIZER = 'kuryr.openstack.org/kuryrloadbalancer-finalizers'


+ 3
- 1
kuryr_kubernetes/controller/handlers/lbaas.py View File

@ -272,7 +272,9 @@ class EndpointsHandler(k8s_base.ResourceEventHandler):
k8s = clients.get_kubernetes_client()
loadbalancer_crd = k8s.get_loadbalancer_crd(endpoints)
if not self._has_pods(endpoints):
if (not self._has_pods(endpoints) or
k_const.K8S_ANNOTATION_HEADLESS_SERVICE
in endpoints['metadata'].get('labels', [])):
LOG.debug("Ignoring Kubernetes endpoints %s",
endpoints['metadata']['name'])
return


Loading…
Cancel
Save