Documentation ¶
Index ¶
- Constants
- type Manager
- type MultusConf
- type Option
- func WithAdditionalBinaryFileDir(directoryPath string) Option
- func WithGlobalNamespaces(globalNamespaces string) Option
- func WithLogFile(logFile string) Option
- func WithLogLevel(logLevel string) Option
- func WithLogToStdErr() Option
- func WithNamespaceIsolation() Option
- func WithOverriddenName(networkName string) Option
- func WithPodCIDR(podCIDR string) Option
- func WithReadinessFileIndicator(path string) Option
- func WithServiceCIDR(serviceCIDR string) Option
Constants ¶
const (
MultusDefaultNetworkName = "multus-cni-network"
)
MultusDefaultNetworkName holds the default name of the multus network
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager monitors the configuration of the primary CNI plugin, and regenerates multus configuration whenever it gets updated.
func NewManager ¶
func NewManager(config MultusConf, multusAutoconfigDir string) (*Manager, error)
NewManager returns a config manager object, configured to persist the configuration to `multusAutoconfigDir`. This constructor will auto-discover the primary CNI for which it will delegate.
func NewManagerWithExplicitPrimaryCNIPlugin ¶
func NewManagerWithExplicitPrimaryCNIPlugin(config MultusConf, multusAutoconfigDir string, primaryCNIPluginName string) (*Manager, error)
NewManagerWithExplicitPrimaryCNIPlugin returns a config manager object, configured to persist the configuration to `multusAutoconfigDir`. This constructor will use the primary CNI plugin indicated by the user, via the primaryCNIPluginName variable.
func (Manager) GenerateConfig ¶
GenerateConfig generates a multus configuration from its current state
func (Manager) MonitorDelegatedPluginConfiguration ¶
func (m Manager) MonitorDelegatedPluginConfiguration(shutDown chan struct{}, done chan struct{}) error
MonitorDelegatedPluginConfiguration monitors the configuration file pointed to by the primaryCNIPluginName attribute, and re-generates the multus configuration whenever the primary CNI config is updated.
func (*Manager) OverrideNetworkName ¶
OverrideNetworkName overrides the name of the multus configuration with the name of the delegated primary CNI.
func (Manager) PersistMultusConfig ¶
PersistMultusConfig persists the provided configuration to the disc, with Read / Write permissions. The output file path is `<multus auto config dir>/00-multus.conf`
type MultusConf ¶
type MultusConf struct { BinDir string `json:"binDir,omitempty"` Capabilities map[string]bool `json:"capabilities,omitempty"` CNIVersion string `json:"cniVersion"` Delegates []interface{} `json:"delegates"` LogFile string `json:"logFile,omitempty"` LogLevel string `json:"logLevel,omitempty"` LogToStderr bool `json:"logToStderr,omitempty"` Kubeconfig string `json:"kubeconfig"` Name string `json:"name"` NamespaceIsolation bool `json:"namespaceIsolation,omitempty"` RawNonIsolatedNamespaces string `json:"globalNamespaces,omitempty"` ReadinessIndicatorFile string `json:"readinessindicatorfile,omitempty"` Type string `json:"type"` PodCIDR string `json:"podCIDR,omitempty"` ServiceCIDR string `json:"serviceCIDR,omitempty"` }
MultusConf holds the multus configuration, and persists it to disk
func NewMultusConfig ¶
func NewMultusConfig(pluginName string, cniVersion string, kubeconfig string, configurationOptions ...Option) *MultusConf
NewMultusConfig creates a basic configuration generator. It can be mutated via the `With...` methods.
func (*MultusConf) Generate ¶
func (mc *MultusConf) Generate() (string, error)
Generate generates the multus configuration from whatever state is currently held
func (*MultusConf) Mutate ¶
func (mc *MultusConf) Mutate(configurationOptions ...Option)
Mutate updates the MultusConf attributes according to the provided configuration `Option`s
type Option ¶
type Option func(conf *MultusConf)
Option mutates the `conf` object
func WithAdditionalBinaryFileDir ¶
WithAdditionalBinaryFileDir mutates the inner state to set the BinDir attribute
func WithGlobalNamespaces ¶
WithGlobalNamespaces mutates the inner state to set the RawNonIsolatedNamespaces attribute
func WithLogFile ¶
WithLogFile mutates the inner state to set the logFile attribute
func WithLogLevel ¶
WithLogLevel mutates the inner state to set the LogLevel attribute
func WithLogToStdErr ¶
func WithLogToStdErr() Option
WithLogToStdErr mutates the inner state to enable the WithLogToStdErr attribute
func WithNamespaceIsolation ¶
func WithNamespaceIsolation() Option
WithNamespaceIsolation mutates the inner state to enable the NamespaceIsolation attribute
func WithOverriddenName ¶
WithOverriddenName mutates the inner state to set the Name attribute
func WithPodCIDR ¶
WithPodCIDR mutates the inner state to set the PodCIDR attribute
func WithReadinessFileIndicator ¶
WithReadinessFileIndicator mutates the inner state to set the ReadinessIndicatorFile attribute
func WithServiceCIDR ¶
WithServiceCIDR mutates the inner state to set the ServiceCIDR attribute