proxyDefaults for Envoy - Kubernetes with External Consul server

I’m trying to expose the prometheus metrics endpoint similar to:

I cannot get the proxyDefaults configuration applied anywhere in order to bind prometheus to 9012.

I’ve viewed webpage with the envoy config per the tutorial and never see my config being passed.

I see on Helm Chart Configuration | Consul by HashiCorp that some of this can’t be changed after a helm install, so I’ve delete and recreated it a few times with tweaks to try things. Given the note about how changing it requires using the Consul API I’m wondering if this is something that normally is read from the server but since this is an external non-K8s consul server if it is not seeing that.

If there is another place I can add my config (e.g. in K8s) that would be fine as well. I tried creating a ProxyDefaults resource manually but it didn’t seem to have any affect.

Update: I tried with every component in K8s and in that case the proxyDefaults to work.

Thanks!



Hi, your ProxyDefaults should look like:

apiVersion: consul.hashicorp.com/v1alpha1
kind: ProxyDefaults
metadata:
  name: global
spec:
  config:
    envoy_prometheus_bind_addr: "0.0.0.0:9102"

I think you have another key under config that shouldn’t be there.

1 Like

You are right! I was pointed in the right direction but no idea what I was thinking with those entries, it was late.

This looks perfect. Thank you so much!

Great to hear it! Our next release we’ll be removing the Helm config and better documenting the ProxyDefaults support so the next folks will have a better experience.

1 Like