conf

package
Version: v0.0.0-...-4cca708 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagsForAranyaAppConfig

func FlagsForAranyaAppConfig(prefix string, config *AppConfig) *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 *VirtualnodeConfig) *pflag.FlagSet

func FlagsForVirtualnodeConnectivityConfig

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

func FlagsForVirtualnodeNodeConfig

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

func FlagsForVirtualnodeNodeStorageConfig

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

func FlagsForVirtualnodePodConfig

func FlagsForVirtualnodePodConfig(prefix string, config *VirtualnodePodConfig) *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 {
	CIDR  string `json:"cidr"`
	Start string `json:"start"`
	End   string `json:"end"`
}

type AppConfig

type AppConfig struct {
	kubehelper.ControllerConfig `json:",inline" yaml:",inline"`

	RunAsCloudProvider bool `json:"runAsCloudProvider" yaml:"runAsCloudProvider"`

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

		StorageService struct {
			// aranya will only manage Service.spec.{selector, ports[].{name, port, targetPort}}
			Name string `json:"name" yaml:"name"`
		} `json:"storageService" 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 `json:"nodeClusterRoles" yaml:"nodeClusterRoles"`
		PodRoles         map[string]aranyaapi.PodRolePermissions         `json:"podRoles" yaml:"podRoles"`
		VirtualPodRoles  map[string]aranyaapi.PodRolePermissions         `json:"virtualPodRoles" yaml:"virtualPodRoles"`
	} `json:"managed" yaml:"managed"`
}

nolint:lll

type Config

type Config struct {
	Aranya      AppConfig         `json:"aranya" yaml:"aranya"`
	VirtualNode VirtualnodeConfig `json:"virtualnode" yaml:"virtualnode"`
}

type VirtualnodeConfig

type VirtualnodeConfig struct {
	KubeClient   kubehelper.KubeClientConfig   `json:"kubeClient" yaml:"kubeClient"`
	Node         VirtualnodeNodeConfig         `json:"node" yaml:"node"`
	Pod          VirtualnodePodConfig          `json:"pod" yaml:"pod"`
	Storage      VirtualnodeStorageConfig      `json:"storage" yaml:"storage"`
	Network      VirtualnodeNetworkConfig      `json:"network" yaml:"network"`
	Connectivity VirtualnodeConnectivityConfig `json:"connectivity" yaml:"connectivity"`
}

VirtualnodeConfig the virtual node config

func (*VirtualnodeConfig) OverrideWith

OverrideWith a config with higher priority (config from EdgeDevices)

type VirtualnodeConnectivityConfig

type VirtualnodeConnectivityConfig struct {
	Timers struct {
		UnarySessionTimeout time.Duration `json:"unarySessionTimeout" yaml:"unarySessionTimeout"`
	} `json:"timers" yaml:"timers"`

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

type VirtualnodeNetworkAbbotServiceConfig

type VirtualnodeNetworkAbbotServiceConfig struct {
	Name     string `json:"name" yaml:"name"`
	PortName string `json:"portName" yaml:"portName"`
}

type VirtualnodeNetworkBackendConfig

type VirtualnodeNetworkBackendConfig struct {
	Driver string `json:"driver" yaml:"driver"`

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

type VirtualnodeNetworkConfig

type VirtualnodeNetworkConfig struct {
	Enabled bool `json:"enabled" yaml:"enabled"`

	AbbotService   VirtualnodeNetworkAbbotServiceConfig `json:"abbotService" yaml:"abbotService"`
	NetworkService VirtualnodeNetworkServiceConfig      `json:"networkService" yaml:"networkService"`
	Mesh           VirtualnodeNetworkMeshConfig         `json:"mesh" yaml:"mesh"`
	Backend        VirtualnodeNetworkBackendConfig      `json:"backend" yaml:"backend"`
}

type VirtualnodeNetworkMeshConfig

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

type VirtualnodeNetworkServiceConfig

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

type VirtualnodeNodeConfig

type VirtualnodeNodeConfig struct {
	RecreateIfPatchFailed bool `json:"recreateIfPatchFailed" yaml:"recreateIfPatchFailed"`

	Timers struct {
		MirrorSyncInterval time.Duration `json:"mirrorSyncInterval" yaml:"mirrorSyncInterval"`
		ForceSyncInterval  time.Duration `json:"forceSyncInterval" yaml:"forceSyncInterval"`
	} `json:"timers" yaml:"timers"`

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

	Lease struct {
		Enabled bool `json:"enabled" yaml:"enabled"`

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

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

VirtualnodeNodeConfig the virtual node status update config nolint:maligned

type VirtualnodeNodeMetricsConfig

type VirtualnodeNodeMetricsConfig struct {
	// OS name, metrics differs from different OSes
	OS string `json:"os" yaml:"os"`

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

type VirtualnodePodConfig

type VirtualnodePodConfig struct {
	LogDir string `json:"logDir" yaml:"logDir"`
	Timers struct {
		ForceSyncInterval     time.Duration `json:"forceSyncInterval" yaml:"forceSyncInterval"`
		StreamCreationTimeout time.Duration `json:"streamCreationTimeout" yaml:"streamCreationTimeout"`
		StreamIdleTimeout     time.Duration `json:"streamIdleTimeout" yaml:"streamIdleTimeout"`
	} `json:"timers" yaml:"timers"`

	DNS struct {
		aranyaapi.PodDNSConfig `json:",inline" yaml:",inline"`
		ClusterDomain          string `json:"clusterDomain" yaml:"clusterDomain"`
	} `json:"dns" yaml:"dns"`

	Allocatable int `json:"allocatable" yaml:"allocatable"`

	Metrics aranyaapi.MetricsConfig `json:"metrics" yaml:"metrics"`
}

VirtualnodePodConfig of pod manager

type VirtualnodeStorageConfig

type VirtualnodeStorageConfig struct {
	Enabled                bool   `json:"enabled" yaml:"enabled"`
	RootDir                string `json:"rootDir" yaml:"rootDir"`
	KubeletPluginsDir      string `json:"kubeletPluginsDir" yaml:"kubeletPluginsDir"`
	KubeletRegistrationDir string `json:"kubeletRegistrationDir" yaml:"kubeletRegistrationDir"`
	SFTP                   struct {
		Enabled     bool   `json:"enabled" yaml:"enabled"`
		HostKeyFile string `json:"hostKey" yaml:"hostKey"`
	} `json:"sftp" yaml:"sftp"`
}

Jump to

Keyboard shortcuts

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