Documentation ¶
Index ¶
- func GetEgressFirewallDNSAddrSetDbIDs(dnsName, controller string) *libovsdbops.DbObjectIDs
- type DNSNameResolver
- type EgressDNS
- func (e *EgressDNS) Add(namespace, dnsName string) (addressset.AddressSet, error)
- func (e *EgressDNS) Delete(namespace string) error
- func (e *EgressDNS) DeleteStaleAddrSets(nbClient libovsdbclient.Client) error
- func (e *EgressDNS) Run() error
- func (e *EgressDNS) Shutdown()
- func (e *EgressDNS) Update(dnsName string) (bool, error)
- type ExternalEgressDNS
- func (extEgDNS *ExternalEgressDNS) Add(namespace, dnsName string) (addressset.AddressSet, error)
- func (extEgDNS *ExternalEgressDNS) Delete(namespace string) error
- func (extEgDNS *ExternalEgressDNS) DeleteStaleAddrSets(nbClient libovsdbclient.Client) error
- func (extEgDNS *ExternalEgressDNS) Run() error
- func (extEgDNS *ExternalEgressDNS) Shutdown()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEgressFirewallDNSAddrSetDbIDs ¶
func GetEgressFirewallDNSAddrSetDbIDs(dnsName, controller string) *libovsdbops.DbObjectIDs
Types ¶
type DNSNameResolver ¶
type DNSNameResolver interface { Add(namespace, dnsName string) (addressset.AddressSet, error) Delete(namespace string) error Run() error Shutdown() DeleteStaleAddrSets(nbClient libovsdbclient.Client) error }
type EgressDNS ¶
type EgressDNS struct {
// contains filtered or unexported fields
}
func NewEgressDNS ¶
func NewEgressDNS(addressSetFactory addressset.AddressSetFactory, controllerName string, controllerStop <-chan struct{}, defaultInterval time.Duration) (*EgressDNS, error)
func (*EgressDNS) Add ¶
func (e *EgressDNS) Add(namespace, dnsName string) (addressset.AddressSet, error)
func (*EgressDNS) DeleteStaleAddrSets ¶
func (e *EgressDNS) DeleteStaleAddrSets(nbClient libovsdbclient.Client) error
DeleteStaleAddrSets deletes all the address sets related to EgressFirewall DNS rules which are not referenced by any acl.
func (*EgressDNS) Run ¶
Run spawns a goroutine that handles updates to the dns entries for domain names used in EgressFirewalls. The loop runs after receiving one of three signals:
- time.NewTicker(durationTillNextQuery) times out and the dnsName with the lowest ttl is checked and the durationTillNextQuery is updated
- e.added is received and durationTillNextQuery is recomputed
- e.deleted is received and coincides with dnsName
type ExternalEgressDNS ¶
type ExternalEgressDNS struct {
// contains filtered or unexported fields
}
ExternalEgressDNS keeps track of DNS names and the corresponding IP addresses. For each DNS name, an address set is allocated and the address set is kept updated with the corresponding IP addresses. Whenever a DNS name is removed the corresponding addresset is destroyed.
func NewExternalEgressDNS ¶
func NewExternalEgressDNS( addressSetFactory addressset.AddressSetFactory, controllerName string, ignoreClusterSubnet bool, dnsSharedIndexInformer cache.SharedIndexInformer, efLister egressfirewalllister.EgressFirewallLister, ) (*ExternalEgressDNS, error)
NewExternalEgressDNS initializes and returns a new ExternalEgressDNS instance.
func (*ExternalEgressDNS) Add ¶
func (extEgDNS *ExternalEgressDNS) Add(namespace, dnsName string) (addressset.AddressSet, error)
Add adds the namespace to the set of namespaces where the DNS name is used in the EgressFirewall rules. It also returns the address set corresponding to the DNS name. The address set may be empty at this point if the corresponding DNSNameResolver object's status is still not updated with the associated IP addresses.
func (*ExternalEgressDNS) Delete ¶
func (extEgDNS *ExternalEgressDNS) Delete(namespace string) error
Delete removes the namespace from the set of namespaces where the DNS name is used in the EgressFirewall rules.
func (*ExternalEgressDNS) DeleteStaleAddrSets ¶
func (extEgDNS *ExternalEgressDNS) DeleteStaleAddrSets(nbClient libovsdbclient.Client) error
DeleteStaleAddrSets deletes all the address sets related to EgressFirewall DNS rules which are not referenced by any acl.
func (*ExternalEgressDNS) Run ¶
func (extEgDNS *ExternalEgressDNS) Run() error
Run starts the DNSNameResolver controller.
func (*ExternalEgressDNS) Shutdown ¶
func (extEgDNS *ExternalEgressDNS) Shutdown()
Shutdown stops the DNSNameResolver controller.