lxd: github.com/lxc/lxd/lxd/node Index | Files

package node

import "github.com/lxc/lxd/lxd/node"

Index

Package Files

config.go raft.go

Variables

var ConfigSchema = config.Schema{

    "core.https_address": {},

    "cluster.https_address": {},

    "core.debug_address": {},

    "maas.machine": {},

    "storage.backups_volume": {},
    "storage.images_volume":  {},
}

ConfigSchema defines available server configuration keys.

func ClusterAddress Uses

func ClusterAddress(node *db.Node) (string, error)

ClusterAddress is a convenience for loading the node configuration and returning the value of cluster.https_address.

func DebugAddress Uses

func DebugAddress(node *db.Node) (string, error)

DebugAddress is a convenience for loading the node configuration and returning the value of core.debug_address.

func DetermineRaftNode Uses

func DetermineRaftNode(tx *db.NodeTx) (*db.RaftNode, error)

DetermineRaftNode figures out what raft node ID and address we have, if any.

This decision is based on the value of the cluster.https_address config key and on the rows in the raft_nodes table, both stored in the node-level SQLite database.

The following rules are applied:

- If no cluster.https_address config key is set, this is a non-clustered node

and the returned RaftNode will have ID 1 but no address, to signal that
the node should setup an in-memory raft cluster where the node itself
is the only member and leader.

- If cluster.https_address config key is set, but there is no row in the

raft_nodes table, this is a brand new clustered node that is joining a
cluster, and same behavior as the previous case applies.

- If cluster.https_address config key is set and there is at least one row

in the raft_nodes table, then this node is considered a raft node if
cluster.https_address matches one of the rows in raft_nodes. In that case,
the matching db.RaftNode row is returned, otherwise nil.

func HTTPSAddress Uses

func HTTPSAddress(node *db.Node) (string, error)

HTTPSAddress is a convenience for loading the node configuration and returning the value of core.https_address.

type Config Uses

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

Config holds node-local configuration values for a certain LXD instance.

func ConfigLoad Uses

func ConfigLoad(tx *db.NodeTx) (*Config, error)

ConfigLoad loads a new Config object with the current node-local configuration values fetched from the database. An optional list of config value triggers can be passed, each config key must have at most one trigger.

func (*Config) ClusterAddress Uses

func (c *Config) ClusterAddress() string

ClusterAddress returns the address and port this LXD node should use for cluster communication.

func (*Config) DebugAddress Uses

func (c *Config) DebugAddress() string

DebugAddress returns the address and port to setup the pprof listener on

func (*Config) Dump Uses

func (c *Config) Dump() map[string]interface{}

Dump current configuration keys and their values. Keys with values matching their defaults are omitted.

func (*Config) HTTPSAddress Uses

func (c *Config) HTTPSAddress() string

HTTPSAddress returns the address and port this LXD node should expose its API to, if any.

func (*Config) MAASMachine Uses

func (c *Config) MAASMachine() string

MAASMachine returns the MAAS machine this instance is associated with, if any.

func (*Config) Patch Uses

func (c *Config) Patch(patch map[string]interface{}) (map[string]string, error)

Patch changes only the configuration keys in the given map.

func (*Config) Replace Uses

func (c *Config) Replace(values map[string]interface{}) (map[string]string, error)

Replace the current configuration with the given values.

func (*Config) StorageBackupsVolume Uses

func (c *Config) StorageBackupsVolume() string

StorageBackupsVolume returns the name of the pool/volume to use for storing backup tarballs

func (*Config) StorageImagesVolume Uses

func (c *Config) StorageImagesVolume() string

StorageImagesVolume returns the name of the pool/volume to use for storing image tarballs

Package node imports 3 packages (graph) and is imported by 12 packages. Updated 2019-08-20. Refresh now. Tools for package owners.