dns

package
v0.0.0-...-eaca31d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	INGRESS_NAMESPACE        = os.Getenv("INGRESS_NAMESPACE")
	INGRESS_CONTROLLER_NAME  = os.Getenv("INGRESS_CONTROLLER_NAME")
	INGRESS_CONTROLLER_LABEL = "app.kubernetes.io/name"
	INGRESS_DNS_ANNOTATION   = os.Getenv("INGRESS_DNS_ANNOTATION")
)
View Source
var (
	DNS_SERVER          = os.Getenv("DNS_SERVER")
	DNS_SERVER_PORT     = os.Getenv("DNS_SERVER_PORT")
	DNS_SERVER_USERNAME = os.Getenv("DNS_SERVER_USERNAME")
	DNS_SERVER_PASSWORD = os.Getenv("DNS_SERVER_PASSWORD")
	DNS_VERSION         = os.Getenv("DNS_VERSION")
	DNS_VIEW            = os.Getenv("DNS_VIEW") //default.container-dev
	DNS_ZONE            = os.Getenv("DNS_ZONE") //k8s.localdev.me
)
View Source
var (
	GRID_URL = "https://" + os.Getenv("DNS_SERVER") + "/wapi/" + os.Getenv("DNS_VERSION") + "/"
)

Functions

func RestK8sClient

func RestK8sClient() (*kubernetes.Clientset, error)

Types

type DNSController

type DNSController struct {
	// contains filtered or unexported fields
}

func NewDNSController

func NewDNSController(clientset *kubernetes.Clientset, dnsProvider DNSProvider) *DNSController

func (*DNSController) CreateRecord

func (c *DNSController) CreateRecord(ingress *v1.Ingress)

func (*DNSController) CreateRecordHttp

func (c *DNSController) CreateRecordHttp(ingress *v1.Ingress)

func (*DNSController) DeleteRecord

func (c *DNSController) DeleteRecord(ingress *v1.Ingress)

func (*DNSController) Run

func (c *DNSController) Run(ctx context.Context)

func (*DNSController) SearchRecord

func (c *DNSController) SearchRecord(name string) bool

func (*DNSController) SearchRecordHttp

func (c *DNSController) SearchRecordHttp(name string) (SeaRecord, error)

func (*DNSController) UpdateRecord

func (c *DNSController) UpdateRecord(ingress *v1.Ingress) error

type DNSProvider

type DNSProvider interface {
	CreateRecord(name, value string) error
	CreateRecordHttp(name, value string) error
	DeleteRecord(name, value string) error
	SearchRecord(name string) (bool, error)
	SearchRecordHttp(name string) (SeaRecord, error)
	UpdateRecord(name string) error
}

type IPv4Addr

type IPv4Addr struct {
	Ref              string `json:"_ref"`
	IPv4Addr         string `json:"ipv4addr"`
	ConfigureForDHCP bool   `json:"configure_for_dhcp"`
	Host             string `json:"host"`
}

Define structs for Record data from search operation

type InfoBloxServer

type InfoBloxServer struct {
	Server   string `json:"server,omitempty"`
	Protocol string `json:"protocol,omitempty"`
	Insecure bool   `json:"insecure,omitempty"`
	UserName string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	Zone     string `json:"filter,omitempty"`
	View     string `json:"view,omitempty"`
}

type Infoblox

type Infoblox struct {
	InfobloxServer        string
	InfobloxServerPort    string
	InfobloxUsername      string
	InfobloxPassword      string
	InfoBloxServerVersion string
}

func NewInfoBloxServer

func NewInfoBloxServer(server, port, version string) Infoblox

type InfobloxProvider

type InfobloxProvider struct {
	// contains filtered or unexported fields
}

func NewInfobloxProvider

func NewInfobloxProvider() (*InfobloxProvider, error)

func (*InfobloxProvider) CreateRecord

func (i *InfobloxProvider) CreateRecord(name, ipAddress string) error

func (*InfobloxProvider) CreateRecordHttp

func (i *InfobloxProvider) CreateRecordHttp(name, ipAddress string) error

func (*InfobloxProvider) DeleteRecord

func (i *InfobloxProvider) DeleteRecord(name, value string) error

func (*InfobloxProvider) SearchRecord

func (i *InfobloxProvider) SearchRecord(name string) (bool, error)

func (*InfobloxProvider) SearchRecordHttp

func (i *InfobloxProvider) SearchRecordHttp(name string) (SeaRecord, error)

func (*InfobloxProvider) UpdateRecord

func (i *InfobloxProvider) UpdateRecord(name string) error

type IpAddrs

type IpAddrs struct {
	Ipv4addr string `json:"ipv4addr"`
}

type Record

type Record struct {
	Name      string    `json:"name"`
	Ipv4addrs []IpAddrs `json:"ipv4addrs"`
	Comment   string    `json:"comment"`
	View      string    `json:"view"`
}

type SeaRecord

type SeaRecord struct {
	Ref       string     `json:"_ref"`
	IPv4Addrs []IPv4Addr `json:"ipv4addrs"`
	Name      string     `json:"name"`
	View      string     `json:"view"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL