Documentation ¶
Index ¶
- Constants
- func DefaultImageStoreDir() string
- type AgentConfig
- type AgentLogCfg
- type ApiserverSourceCfg
- type CRIProviderCfg
- type CapacityCfg
- type CertCfg
- type DNSCfg
- type FileSourceCfg
- type FrameworkCfg
- type K8sProviderBackendCfg
- type K8sProviderCfg
- type KubeConnCfg
- type LocalRuntimeCfg
- type NodeCfg
- type PluginCfg
- type ProviderCfg
- type RegistryAuth
- type RegistryCfg
- type ReservedResourcesCfg
- type SourceCfg
Constants ¶
View Source
const ( DefaultReservedCPU = "0.5" DefaultReservedMemory = "500Mi" )
View Source
const ( ContainerRuntime = "runc" K8sRuntime = "runk" ProcessRuntime = "runp" )
Variables ¶
This section is empty.
Functions ¶
func DefaultImageStoreDir ¶
func DefaultImageStoreDir() string
Types ¶
type AgentConfig ¶
type AgentConfig struct { // Root directory of framework. RootDir string `yaml:"rootDir,omitempty"` Namespace string `yaml:"namespace,omitempty"` NodeIP string `yaml:"NodeIP,omitempty"` APIVersion string `yaml:"apiVersion,omitempty"` AgentVersion string `yaml:"agentVersion,omitempty"` // Location to check disk pressure DiskPressurePath string `yaml:"diskPressurePath,omitempty"` // If k3s is built into the node, it is a head node. Head bool `yaml:"head"` // path configuration. LogsPath string `yaml:"logsPath,omitempty"` StdoutPath string `yaml:"stdoutPath,omitempty"` KusciaAPIProtocol common.Protocol // Todo: temporary solution for scql KusciaAPIToken string DomainKeyData string DomainKey *rsa.PrivateKey // CA configuration. DomainCACertFile string DomainCAKey *rsa.PrivateKey DomainCACert *x509.Certificate // AllowPrivileged if true, securityContext.Privileged will work for container. AllowPrivileged bool `yaml:"allowPrivileged,omitempty"` Capacity CapacityCfg `yaml:"capacity,omitempty"` ReservedResources ReservedResourcesCfg `yaml:"reservedResources"` Log AgentLogCfg `yaml:"log,omitempty"` Source SourceCfg `yaml:"source,omitempty"` Framework FrameworkCfg `yaml:"framework,omitempty"` Provider ProviderCfg `yaml:"provider,omitempty"` Node NodeCfg `yaml:"node,omitempty"` Registry RegistryCfg `yaml:"registry,omitempty"` Cert CertCfg `yaml:"cert,omitempty"` Plugins []PluginCfg `yaml:"plugins,omitempty"` }
func DefaultAgentConfig ¶
func DefaultAgentConfig() *AgentConfig
func DefaultStaticAgentConfig ¶
func DefaultStaticAgentConfig() *AgentConfig
func LoadAgentConfig ¶
func LoadAgentConfig(configPath string) (*AgentConfig, error)
LoadAgentConfig loads the given json configuration files.
func LoadOverrideConfig ¶
func LoadOverrideConfig(config *AgentConfig, configPath string) (*AgentConfig, error)
type AgentLogCfg ¶
type AgentLogCfg struct { // Defaults to INFO. LogLevel string `yaml:"level,omitempty"` // Output log to LogsPath/Filename. // if Filename is empty, logs will only output to stdout. // Backup log files will be retained in the same directory. Filename string `yaml:"filename,omitempty"` // MaxFileSizeMB is the maximum size in megabytes of the log file before it gets // rotated. It defaults to 100 megabytes. MaxFileSizeMB int `yaml:"maxFileSizeMB,omitempty"` // MaxFiles is the maximum number of old log files to retain. The default // is to retain all old log files. MaxFiles int `yaml:"maxFiles,omitempty"` }
type ApiserverSourceCfg ¶
type ApiserverSourceCfg struct {
KubeConnCfg `yaml:",inline"`
}
type CRIProviderCfg ¶
type CRIProviderCfg struct { // remoteRuntimeEndpoint is the endpoint of remote runtime service RemoteRuntimeEndpoint string `yaml:"remoteRuntimeEndpoint,omitempty"` // remoteImageEndpoint is the endpoint of remote image service RemoteImageEndpoint string `yaml:"remoteImageEndpoint,omitempty"` // RuntimeRequestTimeout is the timeout for all runtime requests except long running // requests - pull, logs, exec and attach. RuntimeRequestTimeout time.Duration `yaml:"runtimeRequestTimeout,omitempty"` // A quantity defines the maximum size of the container log file before it is rotated. For example: "5Mi" or "256Ki". ContainerLogMaxSize string `yaml:"containerLogMaxSize,omitempty"` // Maximum number of container log files that can be present for a container. ContainerLogMaxFiles int `yaml:"containerLogMaxFiles,omitempty"` // clusterDomain is the DNS domain for this cluster. If set, agent will // configure all containers to search this domain in addition to the // host's search domains. ClusterDomain string `yaml:"clusterDomain,omitempty"` // clusterDNS is a list of IP addresses for a cluster DNS server. If set, // agent will configure all containers to use this for DNS resolution // instead of the host's DNS servers. ClusterDNS []string `yaml:"clusterDNS,omitempty"` // ResolverConfig is the resolver configuration file used as the basis // for the container DNS resolution configuration. ResolverConfig string `yaml:"resolverConfig,omitempty"` LocalRuntime LocalRuntimeCfg `yaml:"localRuntime"` }
type CapacityCfg ¶
type DNSCfg ¶
type DNSCfg struct { // Defines how a pod's DNS will be configured. Default is None. Policy string `yaml:"policy,omitempty"` // List of DNS servers of the cluster. Servers []string `yaml:"servers,omitempty"` // List of DNS search domains of the cluster. Searches []string `yaml:"searches,omitempty"` // ResolverConfig is the resolver configuration file used as the basis // for the container DNS resolution configuration. ResolverConfig string `yaml:"resolverConfig,omitempty"` }
DNSCfg specifies the DNS servers and search domains of a sandbox.
type FileSourceCfg ¶
type FrameworkCfg ¶
type K8sProviderBackendCfg ¶
type K8sProviderBackendCfg struct { Name string `yaml:"name,omitempty"` Config yaml.Node `yaml:"config,omitempty"` }
type K8sProviderCfg ¶
type K8sProviderCfg struct { KubeConnCfg `yaml:",inline"` Namespace string `yaml:"namespace"` DNS DNSCfg `yaml:"dns,omitempty"` Backend K8sProviderBackendCfg `yaml:"backend,omitempty"` LabelsToAdd map[string]string `yaml:"labelsToAdd,omitempty"` AnnotationsToAdd map[string]string `yaml:"annotationsToAdd,omitempty"` RuntimeClassName string `yaml:"runtimeClassName,omitempty"` EnableLogging bool `yaml:"enableLogging,omitempty"` LogDirectory string `yaml:"logDirectory,omitempty"` }
type KubeConnCfg ¶
type KubeConnCfg struct { KubeconfigFile string `yaml:"kubeconfigFile,omitempty"` Endpoint string `yaml:"endpoint,omitempty"` // QPS indicates the maximum QPS to the master from this client. QPS float32 `yaml:"qps,omitempty"` // Maximum burst for throttle. Burst int `yaml:"burst,omitempty"` // The maximum length of time to wait before giving up on a server request. Timeout time.Duration `yaml:"timeout,omitempty"` }
type LocalRuntimeCfg ¶
type PluginCfg ¶
type PluginCfg struct { Name string `yaml:"name,omitempty"` Config yaml.Node `yaml:"config,omitempty"` }
type ProviderCfg ¶
type ProviderCfg struct { Runtime string `yaml:"runtime,omitempty"` CRI CRIProviderCfg `yaml:"cri,omitempty"` K8s K8sProviderCfg `yaml:"k8s,omitempty"` }
type RegistryAuth ¶
type RegistryAuth struct { Repository string `yaml:"repository,omitempty"` SecretName string `yaml:"secretName,omitempty"` Username string `yaml:"username,omitempty"` Password string `yaml:"password,omitempty"` Auth string `yaml:"auth,omitempty"` ServerAddress string `yaml:"serverAddress,omitempty"` // IdentityToken is used to authenticate the user and get // an access token for the registry. IdentityToken string `yaml:"identityToken,omitempty"` // RegistryToken is a bearer token to be sent to a registry. RegistryToken string `yaml:"registryToken,omitempty"` }
type RegistryCfg ¶
type RegistryCfg struct { Default RegistryAuth `yaml:"default,omitempty"` Allows []RegistryAuth `yaml:"allows,omitempty"` }
type ReservedResourcesCfg ¶
type SourceCfg ¶
type SourceCfg struct { Apiserver ApiserverSourceCfg `yaml:"apiserver,omitempty"` File FileSourceCfg `yaml:"file,omitempty"` }
Click to show internal directories.
Click to hide internal directories.