Documentation ¶
Index ¶
- func NewCommand(bf *client.BaseFlags) *cobra.Command
- type ControlPlane
- type Controller
- func (en *Controller) Download(*mpb.DownloadRequest, mpb.Controller_DownloadServer) error
- func (en *Controller) HandlePing(stream mpb.Controller_PollServer, ping *mpb.ClientPing) error
- func (en *Controller) HandleRegister(stream mpb.Controller_PollServer, ping *mpb.ClientRegister) error
- func (en *Controller) Init()
- func (en *Controller) MetricsTargets(w http.ResponseWriter, r *http.Request)
- func (en *Controller) Nodes() []*state.Machine
- func (en *Controller) Poll(stream mpb.Controller_PollServer) error
- func (en *Controller) ServeAllAndInfoRecords(killChannel chan struct{}, killChannelAck chan struct{})
- func (en *Controller) Upload(mpb.Controller_UploadServer) error
- func (en *Controller) WriteState()
- type ControllerModifier
- type Modifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ControlPlane ¶
type ControlPlane struct { Controller *Controller *config.Common // contains filtered or unexported fields }
func New ¶
func New(mods ...Modifier) (*ControlPlane, error)
func (*ControlPlane) MachinistCommon ¶
func (s *ControlPlane) MachinistCommon() *config.Common
func (*ControlPlane) Run ¶
func (s *ControlPlane) Run() error
func (*ControlPlane) Stop ¶
func (s *ControlPlane) Stop() error
type Controller ¶
type Controller struct { Log logger.Logger State *state.MachineController // contains filtered or unexported fields }
func NewController ¶
func NewController(mods ...ControllerModifier) (*Controller, error)
func (*Controller) Download ¶
func (en *Controller) Download(*mpb.DownloadRequest, mpb.Controller_DownloadServer) error
func (*Controller) HandlePing ¶
func (en *Controller) HandlePing(stream mpb.Controller_PollServer, ping *mpb.ClientPing) error
func (*Controller) HandleRegister ¶
func (en *Controller) HandleRegister(stream mpb.Controller_PollServer, ping *mpb.ClientRegister) error
func (*Controller) Init ¶
func (en *Controller) Init()
Init is designed to run after all components have been started up before running itself as a server
func (*Controller) MetricsTargets ¶
func (en *Controller) MetricsTargets(w http.ResponseWriter, r *http.Request)
MetricsTargets is an HTTP handler that satisfies https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config.
func (*Controller) Nodes ¶
func (en *Controller) Nodes() []*state.Machine
func (*Controller) Poll ¶
func (en *Controller) Poll(stream mpb.Controller_PollServer) error
func (*Controller) ServeAllAndInfoRecords ¶
func (en *Controller) ServeAllAndInfoRecords(killChannel chan struct{}, killChannelAck chan struct{})
ServeAllAndInfoRecords will continuously poll Nodes() and create multiple _all.<domain> records containing the ip addresses of all machines attached. It also serves the current state of the dns server via the _info record. TODO(adam): be able to pass in a wrapped ticker for testing intervals
func (*Controller) Upload ¶
func (en *Controller) Upload(mpb.Controller_UploadServer) error
func (*Controller) WriteState ¶
func (en *Controller) WriteState()
WriteState writes state to the specified state file every 2 seconds. Will not exit or error out unless no statefile is provided.
type ControllerModifier ¶
type ControllerModifier func(*Controller) error
func WithAllRecordsRefreshRate ¶
func WithAllRecordsRefreshRate(duration string) ControllerModifier
func WithKDnsFlags ¶
func WithKDnsFlags(mods ...kdns.DNSModifier) ControllerModifier
func WithStateFile ¶
func WithStateFile(filepath string) ControllerModifier
func WithStateWriteDuration ¶
func WithStateWriteDuration(duration string) ControllerModifier
type Modifier ¶
type Modifier func(s *ControlPlane) error
func WithController ¶
func WithController(controller *Controller) Modifier
func WithMachinistFlags ¶
func WithMachinistFlags(mods ...config.CommonModifier) Modifier