Reference HostIP for KongPlugin Declarations

KongPlugin CRD

Any plugin dependent on a DaemonSet needs to be able to reference the HostIP to be able to interface with the dependent service (Datadog Plugin is the primary use case for this requirement)

Datadog Agent no longer supports Deployments with attached Services and instead only offers a DaemonSet. The Kong Datadog Plugin host field will be required to point to the HostIP to send metrics to dogstatsd.

If there is an alternative working solution to being able to reference HostIP variables in the KongPlugin CRD I would be open to that as well.

This is something we’re aware of, but there are some issues that make it difficult to fix right now. We need some way to make the host IP accessible to Kong, and while the downward API can provide this, limitations on both our and Kubernetes’ end prevent us from getting it:

  • Although the downward API allows access through either files or environment variables, there’s an apparent bug that prevents accessing the host IP (and several other things) through files: https://github.com/kubernetes/kubernetes/issues/64168
  • It’s not possible to access environment variables directly through Lua (i.e. the plugin code): the underlying NGINX server needs to expose them in advance. We’re working on changes that should allow us to handle these more effectively, so we’ll probably revisit this issue once that becomes available.

Thank you for the prompt reply.

I also requested that https://github.com/kubernetes/kubernetes/issues/74265 be revisited so that the burden does not necessarily have to be on the application.


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ