-
Notifications
You must be signed in to change notification settings - Fork 560
Support custom list of services to be added to /etc/hosts in cluster DNS operator - RFE-4145 #2435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -95,6 +95,22 @@ type DNSSpec struct { | |||||||||||||
// +kubebuilder:default=Normal | ||||||||||||||
OperatorLogLevel DNSLogLevel `json:"operatorLogLevel,omitempty"` | ||||||||||||||
|
||||||||||||||
// nodeServices specifies a list of service objects for which host level resolvable entries should be added. | ||||||||||||||
// Services in this list will be added to /etc/hosts on each node in the cluster by the node resolver. | ||||||||||||||
// When not specified, only the default image registry service is resolvable. | ||||||||||||||
// Services in this list will be added in addition to the default "image-registry.openshift-image-registry.svc" service. | ||||||||||||||
// The default image registry service cannot be removed. | ||||||||||||||
// For each service reference, entries will be created using the format "<name>.<namespace>.svc" | ||||||||||||||
// and an alias with the CLUSTER_DOMAIN suffix of cluster.local will also be added. | ||||||||||||||
// | ||||||||||||||
// +optional | ||||||||||||||
// +kubebuilder:validation:MaxItems=20 | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to get input from the network team about the appropriate maximum for this list. 20 sounds ok to me, but I wonder if we can reasonably expand this to account for a larger use case. @Miciah could you or one of your team consider the implications of adding new entries, and what an appropriate maximum scale might be? |
||||||||||||||
// +kubebuilder:validation:MinItems=1 | ||||||||||||||
// +listType=map | ||||||||||||||
// +listMapKey=name | ||||||||||||||
// +listMapKey=namespace | ||||||||||||||
NodeServices []DNSNodeService `json:"nodeServices,omitempty"` | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also add
Suggested change
|
||||||||||||||
|
||||||||||||||
// logLevel describes the desired logging verbosity for CoreDNS. | ||||||||||||||
// Any one of the following values may be specified: | ||||||||||||||
// * Normal logs errors from upstream resolvers. | ||||||||||||||
|
@@ -163,6 +179,27 @@ var ( | |||||||||||||
DNSLogLevelTrace DNSLogLevel = "Trace" | ||||||||||||||
) | ||||||||||||||
|
||||||||||||||
// DNSNodeService represents a Kubernetes service by name and namespace for node services. | ||||||||||||||
type DNSNodeService struct { | ||||||||||||||
// name is the name of the service. | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Service names are validated as DNS 1035 labels, so we should explain that here
Suggested change
|
||||||||||||||
// The name should consist of at most 63 characters, and of only lowercase alphanumeric characters and hyphens, | ||||||||||||||
// and should start with an alphabetic character and end with an alphanumeric character. | ||||||||||||||
// +required | ||||||||||||||
// +kubebuilder:validation:MinLength=1 | ||||||||||||||
// +kubebuilder:validation:MaxLength=63 | ||||||||||||||
// +kubebuilder:validation:XValidation:rule=`!format.dns1035Label().validate(self).hasValue()`,message="a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character" | ||||||||||||||
Name string `json:"name"` | ||||||||||||||
|
||||||||||||||
// namespace is the namespace of the service. | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Namespace names are DNS 1123 Labels, so we will explain that here too
Suggested change
|
||||||||||||||
// The namespace should consist of at most 63 characters, and of only lowercase alphanumeric characters and hyphens, | ||||||||||||||
// and should start and end with an alphanumeric character. | ||||||||||||||
// +required | ||||||||||||||
// +kubebuilder:validation:MinLength=1 | ||||||||||||||
// +kubebuilder:validation:MaxLength=63 | ||||||||||||||
// +kubebuilder:validation:XValidation:rule=`!format.dns1123Label().validate(self).hasValue()`,message="the value must consist of only lowercase alphanumeric characters and hyphens" | ||||||||||||||
Namespace string `json:"namespace"` | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
// Server defines the schema for a server that runs per instance of CoreDNS. | ||||||||||||||
type Server struct { | ||||||||||||||
// name is required and specifies a unique name for the server. Name must comply | ||||||||||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect we probably want to shorten this and drop
CLUSTER_DOMAIN
if it is not configurable, CC @Miciah to confirm