flask mongodb ServerSelectionTimeoutError running on kubernetes

Solution
~$ kubectl explain service.spec.selector
KIND:     Service
VERSION:  v1

FIELD:    selector 

DESCRIPTION:
     Route service traffic to pods with label keys and values matching this
     selector. If empty or not present, the service is assumed to have an
     external process managing its endpoints, which Kubernetes will not modify.
     Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if
     type is ExternalName. More info:
     https://kubernetes.io/docs/concepts/services-networking/service/
~$ kubectl get endpoints mongodb-service
selector:
  name: mongodb
labels:
  app: mongodb
MONGODB_SETTINGS = {'db': 'mongodb', 'host': '10.97.8.16', 'port': 27017}