Skip to content

Commit

Permalink
Merge pull request #1031 from miheer/dns-logging
Browse files Browse the repository at this point in the history
Add logLevel and operatorLogLevel APIs for DNS https://issues.redhat.com/browse/NE-367
  • Loading branch information
openshift-merge-robot authored Oct 28, 2021
2 parents a11323c + b606c85 commit c497013
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ spec:
description: spec is the specification of the desired behavior of the DNS.
type: object
properties:
logLevel:
description: 'logLevel describes the desired logging verbosity for CoreDNS. Any one of the following values may be specified: * Normal logs errors from upstream resolvers. * Debug logs errors, NXDOMAIN responses, and NODATA responses. * Trace logs errors and all responses. Setting logLevel: Trace will produce extremely verbose logs. Valid values are: "Normal", "Debug", "Trace". Defaults to "Normal".'
type: string
default: Normal
enum:
- Normal
- Debug
- Trace
managementState:
description: managementState indicates whether the DNS operator should manage cluster DNS
type: string
Expand Down Expand Up @@ -74,6 +82,14 @@ spec:
value:
description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.
type: string
operatorLogLevel:
description: 'operatorLogLevel controls the logging level of the DNS Operator. Valid values are: "Normal", "Debug", "Trace". Defaults to "Normal". setting operatorLogLevel: Trace will produce extremely verbose logs.'
type: string
default: Normal
enum:
- Normal
- Debug
- Trace
servers:
description: "servers is a list of DNS resolvers that provide name query delegation for one or more subdomains outside the scope of the cluster domain. If servers consists of more than one Server, longest suffix match will be used to determine the Server. \n For example, if there are two Servers, one for \"foo.com\" and another for \"a.foo.com\", and the name query is for \"www.a.foo.com\", it will be routed to the Server with Zone \"a.foo.com\". \n If this field is nil, no servers are created."
type: array
Expand Down
34 changes: 34 additions & 0 deletions operator/v1/types_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,42 @@ type DNSSpec struct {
// DNS
// +optional
ManagementState ManagementState `json:"managementState,omitempty"`

// operatorLogLevel controls the logging level of the DNS Operator.
// Valid values are: "Normal", "Debug", "Trace".
// Defaults to "Normal".
// setting operatorLogLevel: Trace will produce extremely verbose logs.
// +optional
// +kubebuilder:default=Normal
OperatorLogLevel DNSLogLevel `json:"operatorLogLevel,omitempty"`

// logLevel describes the desired logging verbosity for CoreDNS.
// Any one of the following values may be specified:
// * Normal logs errors from upstream resolvers.
// * Debug logs errors, NXDOMAIN responses, and NODATA responses.
// * Trace logs errors and all responses.
// Setting logLevel: Trace will produce extremely verbose logs.
// Valid values are: "Normal", "Debug", "Trace".
// Defaults to "Normal".
// +optional
// +kubebuilder:default=Normal
LogLevel DNSLogLevel `json:"logLevel,omitempty"`
}

// +kubebuilder:validation:Enum:=Normal;Debug;Trace
type DNSLogLevel string

var (
// Normal is the default. Normal, working log information, everything is fine, but helpful notices for auditing or common operations. In kube, this is probably glog=2.
DNSLogLevelNormal DNSLogLevel = "Normal"

// Debug is used when something went wrong. Even common operations may be logged, and less helpful but more quantity of notices. In kube, this is probably glog=4.
DNSLogLevelDebug DNSLogLevel = "Debug"

// Trace is used when something went really badly and even more verbose logs are needed. Logging every function call as part of a common operation, to tracing execution of a query. In kube, this is probably glog=6.
DNSLogLevelTrace DNSLogLevel = "Trace"
)

// 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
Expand Down
10 changes: 6 additions & 4 deletions operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c497013

Please sign in to comment.