Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // The inclusion of TypeMeta is to ensure future compatibility if the // Config object was populated directly via a Kubernetes API mechanism. // // For example, instead of the custom implementation here, the // configuration could be obtained from an API that unifies // command-line flags, config-map, etc mechanisms. types.TypeMeta // Map of federation names that the cluster in which this kube-dns // is running belongs to, to the corresponding domain names. Federations map[string]string `json:"federations"` // Map of stub domain to nameserver IP. The key is the domain name suffix, // e.g. "acme.local". Key cannot be equal to the cluster domain. Value is // the IP of the nameserver to send DNS request for the given subdomain. StubDomains map[string][]string `json:"stubDomains"` // List of upstream nameservers to use. Overrides nameservers inherited // from the node. UpstreamNameservers []string `json:"upstreamNameservers"` }
Config populated either from the configuration source (command line flags or via the config map mechanism).
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
func (*Config) ValidateNodeLocalCacheConfig ¶
ValidateNodeLocalCacheConfig returns nil if the config can be compiled to a valid Corefile.
type MockSync ¶
type MockSync struct { // Config that will be returned from Once(). Config *Config // Error that will be returned from Once(). Error error // Chan to send new configurations on. Chan chan *Config }
MockSync is a testing mock.
func NewMockSync ¶
type Sync ¶
type Sync interface { // Once does a blocking synchronization of the config map. If the // ConfigMap fails to validate, this method will return nil, err. Once() (*Config, error) // Start a periodic synchronization of the configuration map. When a // successful configuration map update is detected, the // configuration will be sent to the channel. // // It is an error to call this more than once. Periodic() <-chan *Config }
Sync manages synchronization of the config map.
func NewConfigMapSync ¶
func NewConfigMapSync(client kubernetes.Interface, ns string, name string) Sync
NewConfigMapSync returns a Sync that watches a config map in the API
func NewFileSync ¶
NewFileSync returns a Sync that scans the given dir periodically for config data
func NewNopSync ¶
Click to show internal directories.
Click to hide internal directories.