datawire / ambassador-pro

Other
2 stars 0 forks source link

Make it so the ConsulResolver "address" field can refer to the Host IP of the Kubernetes Node #17

Closed plombardi89 closed 5 years ago

plombardi89 commented 5 years ago

Typical Consul Deployment puts the servers in a StatefulSet and the clients in DaemonSet. From a Kubernetes Pod someone would talk to Consul by configuring an environment variable like shown:

image: "consul:latest"
env:
- name: HOST_IP
  valueFrom:
    fieldRef:
      fieldPath: status.hostIP

However, our ConsulResolver CRD expects a known address to be placed in the address field. One option would be to allow a dynamic string substitution when reading the CRD... e.g. address: "${env HOST_IP}"