Fix fully-qualified dns name#686
Conversation
I'm assuming that a wildcard certificate should also exist so that TLS hostname verification works when connections are made to a pod in a headless service used for either the broker or zookeeper STS. Please adds CI tests to cover possible gaps. |
|
When I tested this locally, the wildcard does not allow me to hit the service using the fully-qualified name. Only removing the wildcard allows the fully-qualified name to work. |
|
I updated the ci tests to use the fully qualified name when testing producer/consumer. Is that sufficient? |
|
Thanks for the clarification @smbecker. I dug into the templates and I think the PR is half-right — it correctly drops Why the wildcard is still needed on the headless lineTLS wildcards (RFC 6125) match only one DNS label, so
Without Suggested change{{- if or (eq .componentConfig.component "broker") (eq .componentConfig.component "zookeeper") }}
- {{ printf "*.%s-%s-headless.%s.svc.%s" ... | quote }} # keep — pod FQDNs
- {{ printf "%s-%s-headless.%s.svc.%s" ... | quote }} # optional — bare headless name
{{- end }}
- {{ printf "%s-%s.%s.svc.%s" ... | quote }} # PR change is correct here
- {{ printf "%s-%s" ... | quote }}The wildcard for the regular service was indeed useless (DNS for CI gapThe current |
…s services used for BK, ZK and broker statefulset pods
Motivation
The generated
dnsNameson certificates were incorrect for fully-qualified service names. The template emitted*.<release>-<component>.<namespace>.svc.<clusterDomain>for every component, but a wildcard subdomain only makes sense for headless services that resolve individual pod hostnames (pod-name.<headless-service>....). For non-headless services (e.g.proxy,standalone) the cert should match the plain<release>-<component>.<namespace>.svc.<clusterDomain>name, and clients connecting via the fully-qualified service name would otherwise fail hostname verification.Modifications
charts/pulsar/templates/_certs.tpl: emit headless SANs (with wildcard) for components backed by a headlessStatefulSet(broker,zookeeper, plusbookkeepervia the existing headless block), and emit the wildcard regular-service SAN only for non-headless components. The plain<release>-<component>.<namespace>.svc.<clusterDomain>SAN is always included so clients can connect via the fully-qualified service name..ci/helm.sh: update the producer/consumer smoke tests to use the fully-qualified DNS names (pulsar-ci-standalone.<namespace>.svc.cluster.local,pulsar-ci-proxy.<namespace>.svc.cluster.local) so TLS hostname verification exercises the corrected cert SANs.Verifying this change