conf

package
v0.0.0-...-735b8cc Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagsForAranyaAppConfig

func FlagsForAranyaAppConfig(prefix string, config *Aranya) *pflag.FlagSet

func FlagsForMetricsConfig

func FlagsForMetricsConfig(prefix string, config *aranyaapi.MetricsConfig) *pflag.FlagSet

func FlagsForPodDNSConfig

func FlagsForPodDNSConfig(prefix string, config *aranyaapi.PodDNSConfig) *pflag.FlagSet

func FlagsForVirtualnode

func FlagsForVirtualnode(prefix string, config *VN) *pflag.FlagSet

func FlagsForVirtualnodeConnectivityConfig

func FlagsForVirtualnodeConnectivityConfig(prefix string, config *VNConnectivity) *pflag.FlagSet

func FlagsForVirtualnodeNodeConfig

func FlagsForVirtualnodeNodeConfig(prefix string, config *VNNode) *pflag.FlagSet

func FlagsForVirtualnodeNodeStorageConfig

func FlagsForVirtualnodeNodeStorageConfig(prefix string, config *VNStorage) *pflag.FlagSet

func FlagsForVirtualnodePodConfig

func FlagsForVirtualnodePodConfig(prefix string, config *VNPod) *pflag.FlagSet

func ReadConfig

func ReadConfig(
	cmd *cobra.Command,
	configFile *string,
	cliLogConfig *log.Config,
	config *Config,
) (context.Context, error)

Types

type AddressBlock

type AddressBlock struct {
	rs.BaseField

	CIDR  string `json:"cidr"`
	Start string `json:"start"`
	End   string `json:"end"`
}

type Aranya

type Aranya struct {
	rs.BaseField

	kubehelper.ControllerConfig `yaml:",inline"`

	RunAsCloudProvider bool `yaml:"runAsCloudProvider"`

	Managed ManagedResources `yaml:"managed"`
}

type Config

type Config struct {
	rs.BaseField

	Aranya      Aranya `yaml:"aranya"`
	VirtualNode VN     `yaml:"virtualnode"`
}

type ManagedResources

type ManagedResources struct {
	rs.BaseField

	ConnectivityService ManagedService `yaml:"connectivityService"`
	StorageService      ManagedService `yaml:"storageService"`

	// NodeClusterRoles managed for node access
	// aranya will add nodes related to the edgedevices in watch namespace to this cluster role
	NodeClusterRoles map[string]aranyaapi.NodeClusterRolePermissions `yaml:"nodeClusterRoles"`
	PodRoles         map[string]aranyaapi.PodRolePermissions         `yaml:"podRoles"`
	VirtualPodRoles  map[string]aranyaapi.PodRolePermissions         `yaml:"virtualPodRoles"`
}

type ManagedService

type ManagedService struct {
	// aranya will only manage Service.spec.{selector, ports[].{name, port, targetPort}}
	Name string `yaml:"name"`
}

type VN

type VN struct {
	rs.BaseField

	KubeClient   kubehelper.KubeClientConfig `yaml:"kubeClient"`
	Node         VNNode                      `yaml:"node"`
	Pod          VNPod                       `yaml:"pod"`
	Storage      VNStorage                   `yaml:"storage"`
	Network      VNNetwork                   `yaml:"network"`
	Connectivity VNConnectivity              `yaml:"connectivity"`
}

VN is the config for virtualnodes

func (*VN) OverrideWith

func (c *VN) OverrideWith(spec *aranyaapi.EdgeDeviceSpec) (newConfig VN)

OverrideWith a config with higher priority (config from EdgeDevices)

type VNConnectivity

type VNConnectivity struct {
	rs.BaseField

	Timers struct {
		rs.BaseField

		UnarySessionTimeout time.Duration `yaml:"unarySessionTimeout"`
	} `yaml:"timers"`

	Backoff struct {
		rs.BaseField

		InitialDelay time.Duration `yaml:"initialDelay"`
		MaxDelay     time.Duration `yaml:"maxDelay"`
		Factor       float64       `yaml:"factor"`
	} `yaml:"backoff"`
}

type VNNetwork

type VNNetwork struct {
	rs.BaseField

	Enabled bool `yaml:"enabled"`

	AbbotService   VNNetworkAbbotService `yaml:"abbotService"`
	NetworkService VNNetworkService      `yaml:"networkService"`
	Mesh           VNNetworkMesh         `yaml:"mesh"`
	Backend        VNNetworkBackend      `yaml:"backend"`
}

type VNNetworkAbbotService

type VNNetworkAbbotService struct {
	rs.BaseField

	Name     string `yaml:"name"`
	PortName string `yaml:"portName"`
}

type VNNetworkBackend

type VNNetworkBackend struct {
	rs.BaseField

	Driver string `yaml:"driver"`

	Wireguard VNNetworkBackendWireguard `yaml:"wireguard"`
}

type VNNetworkBackendWireguard

type VNNetworkBackendWireguard struct {
	rs.BaseField

	Name         string        `yaml:"name"`
	MTU          int           `yaml:"mtu"`
	ListenPort   int           `yaml:"listenPort"`
	PrivateKey   string        `yaml:"privateKey"`
	PreSharedKey string        `yaml:"preSharedKey"`
	Keepalive    time.Duration `yaml:"keepalive"`
}

type VNNetworkMesh

type VNNetworkMesh struct {
	rs.BaseField

	// allocate ip addresses to mesh network device
	IPv4Blocks []AddressBlock `yaml:"ipv4Blocks"`
	IPv6Blocks []AddressBlock `yaml:"ipv6Blocks"`
}

type VNNetworkService

type VNNetworkService struct {
	rs.BaseField

	Name      string   `yaml:"name"`
	Type      string   `yaml:"type"`
	Addresses []string `yaml:"addresses"`
	Port      int      `yaml:"port"`
}

type VNNode

type VNNode struct {
	rs.BaseField

	RecreateIfPatchFailed bool `yaml:"recreateIfPatchFailed"`

	Timers struct {
		rs.BaseField

		MirrorSyncInterval time.Duration `yaml:"mirrorSyncInterval"`
		ForceSyncInterval  time.Duration `yaml:"forceSyncInterval"`
	} `yaml:"timers"`

	Cert struct {
		rs.BaseField

		AutoApprove   bool     `yaml:"autoApprove"`
		MinTLSVersion string   `yaml:"minTLSVersion"`
		MaxTLSVersion string   `yaml:"maxTLSVersion"`
		CipherSuites  []string `yaml:"cipherSuites"`
	} `yaml:"cert"`

	Lease struct {
		rs.BaseField

		Enabled bool `yaml:"enabled"`

		Duration       time.Duration `yaml:"duration"`
		UpdateInterval time.Duration `yaml:"updateInterval"`
	} `yaml:"lease"`

	Metrics []VirtualnodeNodeMetricsConfig `yaml:"metrics"`
}

VNNode the virtual node status update config nolint:maligned

type VNPod

type VNPod struct {
	rs.BaseField

	LogDir      string                  `yaml:"logDir"`
	Timers      VNPodTimers             `yaml:"timers"`
	DNS         VNPodDNS                `yaml:"dns"`
	Allocatable int                     `yaml:"allocatable"`
	Metrics     aranyaapi.MetricsConfig `yaml:"metrics"`
}

VNPod of pod manager

type VNPodDNS

type VNPodDNS struct {
	rs.BaseField

	aranyaapi.PodDNSConfig `yaml:",inline"`
	ClusterDomain          string `yaml:"clusterDomain"`
}

type VNPodTimers

type VNPodTimers struct {
	rs.BaseField

	ForceSyncInterval     time.Duration `yaml:"forceSyncInterval"`
	StreamCreationTimeout time.Duration `yaml:"streamCreationTimeout"`
	StreamIdleTimeout     time.Duration `yaml:"streamIdleTimeout"`
}

type VNStorage

type VNStorage struct {
	rs.BaseField

	Enabled                bool   `yaml:"enabled"`
	RootDir                string `yaml:"rootDir"`
	KubeletPluginsDir      string `yaml:"kubeletPluginsDir"`
	KubeletRegistrationDir string `yaml:"kubeletRegistrationDir"`

	SFTP VNStorageSFTP `yaml:"sftp"`
}

type VNStorageSFTP

type VNStorageSFTP struct {
	rs.BaseField

	Enabled     bool   `yaml:"enabled"`
	HostKeyFile string `yaml:"hostKey"`
}

type VirtualnodeNodeMetricsConfig

type VirtualnodeNodeMetricsConfig struct {
	rs.BaseField

	// OS name, metrics differs from different OSes
	OS string `yaml:"os"`

	aranyaapi.MetricsConfig `yaml:",inline"`
}

Jump to

Keyboard shortcuts

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