Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotReady = errors.New("datastore is not ready or has not been initialised")
Functions ¶
func Run ¶
Run is the entry point to run a Felix instance.
Its main role is to sequence Felix's startup by:
Initialising early logging config (log format and early debug settings).
Parsing command line parameters.
Loading datastore configuration from the environment or config file.
Loading more configuration from the datastore (this is retried until success).
Starting the configured internal (golang) or external dataplane driver.
Starting the background processing goroutines, which load and keep in sync with the state from the datastore, the "calculation graph".
Starting the usage reporting and prometheus metrics endpoint threads (if configured).
Then, it defers to monitorAndManageShutdown(), which blocks until one of the components fails, then attempts a graceful shutdown. At that point, all the processing is in background goroutines.
To avoid having to maintain rarely-used code paths, Felix handles updates to its main config parameters by exiting and allowing itself to be restarted by the init daemon.
Types ¶
type DataplaneConnector ¶
type DataplaneConnector struct { ToDataplane chan interface{} InSync chan bool // contains filtered or unexported fields }
func (*DataplaneConnector) ApplyNoRestartConfig ¶
func (fc *DataplaneConnector) ApplyNoRestartConfig(old, new *config.Config)
ApplyNoRestartConfig applies the configuration that is owned by this file and that can be handled without a restart.
func (*DataplaneConnector) NewFromDataplaneConsumer ¶
func (fc *DataplaneConnector) NewFromDataplaneConsumer() <-chan interface{}
NewFromDataplaneConsumer creates a channel which receives status updates from the dataplane. Each call creates a new consumer channel, and each consumer is dispatched dataplane msgs in series. So, it's important that all created chans are continuously drained to avoid deadlocking.
func (*DataplaneConnector) Start ¶
func (fc *DataplaneConnector) Start()
Start creates goroutines for: - sending calc-graph messages to the dataplane driver, - reading messages from the dataplane (and broadcasting to all consumers of those messages), - reading wireguard status updates from the dataplane