featbit / featbit-charts

Helm Charts for FeatBit
MIT License
5 stars 3 forks source link

Support dnsConfig for pods #35

Open krokofant opened 1 month ago

krokofant commented 1 month ago

I'd like to be able to change the dnsConfig and underlying ndots. Please expose this as a configurable object.

Example configuration:

# ...
dnsConfig:
  options:
    - name: ndots
      value: "2"
containers:
# ...
dsun0720 commented 1 month ago

Hello @krokofant can you explain me why you wanna add this configuration. you will use it only in UI or all the featbit services ?

krokofant commented 3 weeks ago

@dsun0720 All the featbit pods! When implementing CNIs like Cilium and utilizing FQDN matching rules there can be cases where the pods try to resolve and connect to a url like (made up example) www.featbit.co.svc.cluster.local and when that turns up empty it further down the resolve tries comes to www.featbit.co and passes. This is the case with an ndots of 3-5.

www.featbit.co.svc.cluster.local can be listed as errored, blocked etc. and it's not intended to actually be resolved. www.featbit.co returns as expected.

If ndots is adjusted, with this example, to 2 then the pod will not try to resolve any dns with 2+ dots in the name against the internal cluster "shorthands", but rather interpret it as a fully qualified domain. This along with any service cluster-service reference being fully qualified like els.featbit.svc.cluster.local makes the configuration more strict and more predictable.

krokofant commented 3 weeks ago

Real example els looks up both of these

  1. featbit-featbit-mongodb.featbit.svc.cluster.local
  2. featbit-featbit-mongodb.featbit.svc.cluster.local.featbit.svc.cluster.local

And as you can see the second one is rather funny looking since svc.cluster.local is already specified. The first has 4 dots in the domain and is not interpreted as an FQDN, changing the ndots to 2 will treat it as a FQDN and will not lookup the second longer (and invalid) version.

dsun0720 commented 3 weeks ago

@krokofant Thanks for your feedback. I'll add this conf in the pods of featbit services. I'll release the new version very soon