Description of the bug:
We use a headless service (clusterIP: "None") just for the reverse DNS lookup (PTR), so have no need to specify ports. I imagine that that is a reasonably common usecase.
However, the current CDK8+ Service requires ports to be specified. Therefore I'd want that validation to be ignored when given a headless service.
An added bonus would be explicit support for headless services, by making the type of clusterIP be string | "None" | undefined or string | ServiceClusterIP | undefined (where ServiceClusterIP is an enum with a single value HEADLESS that resolves to "None" in the generated manifest).
Reproduction Steps:
Create a headless service:
new Service(this, "headless-svc", {
clusterIP: "None",
selector: deployment,
});
Error Log:
Error: Failed serializing construct at path 'app/traefik-headless-svc/Resource' with name 'traefik-headless': Error: A service must be configured with a port
Environment:
Other:
This is 🐛 Bug Report
Description of the bug:
We use a headless service (
clusterIP: "None") just for the reverse DNS lookup (PTR), so have no need to specify ports. I imagine that that is a reasonably common usecase.However, the current CDK8+ Service requires ports to be specified. Therefore I'd want that validation to be ignored when given a headless service.
An added bonus would be explicit support for headless services, by making the type of
clusterIPbestring | "None" | undefinedorstring | ServiceClusterIP | undefined(whereServiceClusterIPis an enum with a single valueHEADLESSthat resolves to"None"in the generated manifest).Reproduction Steps:
Create a headless service:
Error Log:
Environment:
Other:
This is 🐛 Bug Report