Description
The Readme for Microsoft.Extensions.ServiceDiscovery.Dns mentions
When deploying to Kubernetes, the DNS SRV service endpoint provider can be used to resolve endpoints. For example, the following resource definition will result in a DNS SRV record being created for an endpoint named "default" and an endpoint named "dashboard", both on the service named "basket".
apiVersion: v1 kind: Service metadata: name: basket spec: selector: name: basket-service clusterIP: None ports: - name: default port: 8080 - name: dashboard port: 8888
However, when using Aspir8 to generate kubernetes deployments (for example in the TestShop project), I get
---
apiVersion: v1
kind: Service
metadata:
name: basketservice
spec:
type: ClusterIP
selector:
app: basketservice
ports:
- name: http
port: 8080
targetPort: 8080
- name: https
port: 8443
targetPort: 8443
Notice that the name of the 8080 port is http
instead of default
, meaning that DNS SRV resolution will attempt to resolve _default._tcp._basketservice
and fail (because there is no "default" port). So the options app developer has are either:
- manually fixup the generated yaml - and risk it being overwritten on next
aspirate generate
invocation - fix all references in code to
http://_http.basketservice
- which does not work well if I want to do local deployment viadotnet run
in AppHost folder.
Furthermore, reading the comments and code:
Specifically note the last sentece: "If serviceName parses as a URI, we use scheme as the port name, otherwise "default""
Bu there is no corresponding code in ServiceEndpointQuery parsing code
Given the comments in the first code snippet, I would expect referencing http://basketservice
to lead to resolving via SRV query for _http._tcp.basketservice
. On the other hand, it is not so clear what should happen with http+https://basketservice
.