github.com/jingruilea/kubeedge@v1.2.0-beta.0.0.20200410162146-4bb8902b3879/docs/proposals/configuration.md (about)

     1  ---
     2  title: KubeEdge Component Config Proposal
     3  
     4  authors:
     5    - "@kadisi"
     6    - "@fisherxu"
     7    
     8  approvers:
     9    - "@kevin-wangzefeng"
    10    - "@sids-b"
    11  
    12  creation-date: 2019-10-02
    13  
    14  status: implemented
    15  
    16  ---
    17  * [KubeEdge Component Config Proposal](#kubeedge-component-config-proposal)
    18     * [Terminology](#terminology)
    19     * [Proposal](#proposal)
    20     * [Goals](#goals)
    21     * [Principle](#principle)
    22     * [How to do](#how-to-do)
    23        * [KubeEdge component config apis definition](#kubeedge-component-config-apis-definition)
    24           * [meta config apis](#meta-config-apis)
    25           * [cloudcore config apis](#cloudcore-config-apis)
    26           * [edgecore config apis](#edgecore-config-apis)
    27           * [edgesite config apis](#edgesite-config-apis)
    28        * [Default config file locations](#default-config-file-locations)
    29        * [Use --defaultconfig flag to generate full component config with default values](#use---defaultconfig-flag-to-generate-full-component-config-with-default-values)
    30        * [Compatible with old configuration files](#compatible-with-old-configuration-files)
    31        * [new config file need version number](#new-config-file-need-version-number)
    32        * [How to pass the configuration to each module](#how-to-pass-the-configuration-to-each-module)
    33        * [Use keadm to install and configure KubeEdge components](#use-keadm-to-install-and-configure-kubeedge-components)
    34     * [Task list tracking](#task-list-tracking)
    35  
    36  # KubeEdge Component Config Proposal 
    37  
    38  ## Terminology
    39  
    40  * **KubeEdge components:** refers to binaries e.g. cloudcore, admission, edgecore, edgesite, etc.
    41  
    42  * **KubeEdge modules:** refers to modules e.g. cloudhub, edgecontroller, devicecontroller, devicetwin, edged, edgehub, eventbus, metamanager, servicebus, etc.
    43  
    44  ## Proposal 
    45  
    46  Currently, KubeEdge components' configuration files are in the conf directory at the same level and have 3 configuration files, it is difficult to maintain and extend. 
    47  
    48  KubeEdge uses beehive package to analyse configuration files, when the program is running, it will print a lot of logs first. When we add subcommands to the program, such as `--version` , it will still print a lot of configuration information and then output the version information.
    49  
    50  We recommend referring to the kubernetes component config api design to redesign the definition of the KubeEdge component configuration file:
    51  
    52  [kubelet config file](https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/)
    53  
    54  [kubelet api config definition](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/config/types.go)
    55  
    56  ## Goals
    57  
    58  * KubeEdge components use one configuration file instead of the original 3 configuration files. It support json or yaml format, defaut is yaml.
    59  
    60  * Start the KubeEdge component with the --config flag, this flag set to the path of the component's config file. The component will then load its config from this file, if --config flag not set, component will read a default configuration file.
    61  
    62  * Configuration file's definition refers to the kubernetes component config api design, which needs to be with a version number for future version management. 
    63  
    64  * Need to abstract the apis for KubeEdge component configuration file  and defined in `pkg/apis/{components}/` dir.
    65  
    66  * keadm uses the KubeEdge component config api to generate  configuration file for each component, and allows additional command line flags to override the configuration of each component. This will make it easier to install and configure KubeEdge components.
    67  
    68  * After KubeEdge component starts, it will first load its config from configfile, verifies the legality, and then passes the corresponding config to the KubeEdge modules through the Register method of each module.
    69  
    70  * New configuration files should consider backward compatibility in future upgrades
    71  
    72  * Support conversion of 3 old configfiles to one new configfile. 
    73    
    74    take cloudcore as an example: now cloudcore has 3 configfiles: `controller.yaml,logging.yaml,modules.yaml`, We need to convert those three old configuration files into one new configuration file in one way.
    75  
    76  
    77  ## Principle  
    78  
    79  * **Backward compatibility**
    80  
    81  	`keadm` provides subcommands for conversion
    82  
    83  * **Forward compatibility** 
    84  	
    85  	For configuration file, support addition/deprecattion of some fields, **Modify field not allowed**. 
    86  	Configuration need a version field.
    87  
    88  
    89  ## How to do
    90  
    91  ### KubeEdge component config apis definition
    92  
    93  #### meta config apis 
    94  
    95  defined in `pkg/apis/meta/v1alpha1/types.go`
    96  
    97  ```go
    98  
    99  package v1alpha1
   100  
   101  type ModuleName string
   102  type GroupName string
   103  
   104  // Available modules for CloudCore
   105  const (
   106  	ModuleNameEdgeController   ModuleName = "edgecontroller"
   107  	ModuleNameDeviceController ModuleName = "devicecontroller"
   108  	ModuleNameCloudHub         ModuleName = "cloudhub"
   109  )
   110  
   111  // Available modules for EdgeCore
   112  const (
   113  	ModuleNameEventBus   ModuleName = "eventbus"
   114  	ModuleNameServiceBus ModuleName = "servicebus"
   115  	// TODO @kadisi change websocket to edgehub
   116  	ModuleNameEdgeHub     ModuleName = "websocket"
   117  	ModuleNameMetaManager ModuleName = "metaManager"
   118  	ModuleNameEdged       ModuleName = "edged"
   119  	ModuleNameTwin        ModuleName = "twin"
   120  	ModuleNameDBTest      ModuleName = "dbTest"
   121  	ModuleNameEdgeMesh    ModuleName = "edgemesh"
   122  )
   123  
   124  // Available modules group
   125  const (
   126  	GroupNameHub            GroupName = "hub"
   127  	GroupNameEdgeController GroupName = "edgecontroller"
   128  	GroupNameBus            GroupName = "bus"
   129  	GroupNameTwin           GroupName = "twin"
   130  	GroupNameMeta           GroupName = "meta"
   131  	GroupNameEdged          GroupName = "edged"
   132  	GroupNameUser           GroupName = "user"
   133  	GroupNameMesh           GroupName = "mesh"
   134  )
   135  
   136  
   137  ```
   138  
   139  #### cloudcore config apis 
   140  
   141  defined in `pkg/apis/cloudcore/v1alpha1/types.go`
   142  
   143  ```go
   144  
   145  package v1alpha1
   146  
   147  import (
   148  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
   149  
   150  	metaconfig "github.com/kubeedge/kubeedge/pkg/apis/componentconfig/meta/v1alpha1"
   151  )
   152  
   153  // CloudCoreConfig indicates the config of cloudcore which get from cloudcore config file
   154  type CloudCoreConfig struct {
   155  	metav1.TypeMeta
   156  	// KubeAPIConfig indicates the kubernetes cluster info which cloudcore will connected
   157  	// +Required
   158  	KubeAPIConfig *KubeAPIConfig `json:"kubeAPIConfig,omitempty"`
   159  	// Modules indicates cloudcore modules config
   160  	// +Required
   161  	Modules *Modules `json:"modules,omitempty"`
   162  }
   163  
   164  // KubeAPIConfig indicates the configuration for interacting with k8s server
   165  type KubeAPIConfig struct {
   166  	// Master indicates the address of the Kubernetes API server (overrides any value in Kubeconfig)
   167  	// such as https://127.0.0.1:8443
   168  	// default ""
   169  	// Note: Can not use "omitempty" option,  It will affect the output of the default configuration file
   170  	Master string `json:"master"`
   171  	// ContentType indicates the ContentType of message transmission when interacting with k8s
   172  	// default application/vnd.kubernetes.protobuf
   173  	ContentType string `json:"contentType,omitempty"`
   174  	// QPS to while talking with kubernetes apiserve
   175  	// default 100
   176  	QPS int32 `json:"qps,omitempty"`
   177  	// Burst to use while talking with kubernetes apiserver
   178  	// default 200
   179  	Burst int32 `json:"burst,omitempty"`
   180  	// Kubeconfig indicates the path to kubeconfig file with authorization and master location information.
   181  	// default "/root/.kube/config"
   182  	// +Required
   183  	KubeConfig string `json:"kubeConfig"`
   184  }
   185  
   186  // Modules indicates the modules of cloudcore will be use
   187  type Modules struct {
   188  	// CloudHub indicates cloudhub module config
   189  	CloudHub *CloudHub `json:"cloudhub,omitempty"`
   190  	// EdgeController indicates edgecontroller module config
   191  	EdgeController *EdgeController `json:"edgecontroller,omitempty"`
   192  	// DeviceController indicates devicecontroller module config
   193  	DeviceController *DeviceController `json:"devicecontroller,omitempty"`
   194  }
   195  
   196  // CloudHub indicates the config of cloudhub module.
   197  // CloudHub is a web socket or quic server responsible for watching changes at the cloud side, caching and sending messages to EdgeHub.
   198  type CloudHub struct {
   199  	// Enable indicates whether cloudhub is enabled, if set to false (for debugging etc.), skip checking other cloudhub configs.
   200  	// default true
   201  	Enable bool `json:"enable,omitempty"`
   202  	// KeepaliveInterval indicates keep-alive interval (second)
   203  	// default 30
   204  	KeepaliveInterval int32 `json:"keepaliveInterval,omitempty"`
   205  	// NodeLimit indicates node limit
   206  	// default 10
   207  	NodeLimit int32 `json:"nodeLimit,omitempty"`
   208  	// TLSCAFile indicates ca file path
   209  	// default /etc/kubeedge/ca/rootCA.crt
   210  	TLSCAFile string `json:"tlsCAFile,omitempty"`
   211  	// TLSCertFile indicates cert file path
   212  	// default /etc/kubeedge/certs/edge.crt
   213  	TLSCertFile string `json:"tlsCertFile,omitempty"`
   214  	// TLSPrivateKeyFile indicates key file path
   215  	// default /etc/kubeedge/certs/edge.key
   216  	TLSPrivateKeyFile string `json:"tlsPrivateKeyFile,omitempty"`
   217  	// WriteTimeout indicates write time (second)
   218  	// default 30
   219  	WriteTimeout int32 `json:"writeTimeout,omitempty"`
   220  	// Quic indicates quic server info
   221  	Quic *CloudHubQUIC `json:"quic,omitempty"`
   222  	// UnixSocket set unixsocket server info
   223  	UnixSocket *CloudHubUnixSocket `json:"unixsocket,omitempty"`
   224  	// WebSocket indicates websocket server info
   225  	// +Required
   226  	WebSocket *CloudHubWebSocket `json:"websocket,omitempty"`
   227  }
   228  
   229  // CloudHubQUIC indicates the quic server config
   230  type CloudHubQUIC struct {
   231  	// Enable indicates whether enable quic protocol
   232  	// default false
   233  	Enable bool `json:"enable,omitempty"`
   234  	// Address set server ip address
   235  	// default 0.0.0.0
   236  	Address string `json:"address,omitempty"`
   237  	// Port set open port for quic server
   238  	// default 10001
   239  	Port uint32 `json:"port,omitempty"`
   240  	// MaxIncomingStreams set the max incoming stream for quic server
   241  	// default 10000
   242  	MaxIncomingStreams int32 `json:"maxIncomingStreams,omitempty"`
   243  }
   244  
   245  // CloudHubUnixSocket indicates the unix socket config
   246  type CloudHubUnixSocket struct {
   247  	// Enable indicates whether enable unix domain socket protocol
   248  	// default true
   249  	Enable bool `json:"enable,omitempty"`
   250  	// Address indicates unix domain socket address
   251  	// default unix:///var/lib/kubeedge/kubeedge.sock
   252  	Address string `json:"address,omitempty"`
   253  }
   254  
   255  // CloudHubWebSocket indicates the websocket config of cloudhub
   256  type CloudHubWebSocket struct {
   257  	// Enable indicates whether enable websocket protocol
   258  	// default true
   259  	Enable bool `json:"enable,omitempty"`
   260  	// Address indicates server ip address
   261  	// default 0.0.0.0
   262  	Address string `json:"address,omitempty"`
   263  	// Port indicates the open port for websocket server
   264  	// default 10000
   265  	Port uint32 `json:"port,omitempty"`
   266  }
   267  
   268  // EdgeController indicates the config of edgecontroller module
   269  type EdgeController struct {
   270  	// Enable indicates whether edgecontroller is enabled, if set to false (for debugging etc.), skip checking other edgecontroller configs.
   271  	// default true
   272  	Enable bool `json:"enable,omitempty"`
   273  	// NodeUpdateFrequency indicates node update frequency (second)
   274  	// default 10
   275  	NodeUpdateFrequency int32 `json:"nodeUpdateFrequency,omitempty"`
   276  	// Buffer indicates k8s resource buffer
   277  	Buffer *EdgeControllerBuffer `json:"buffer,omitempty"`
   278  	// Context indicates send,receive,response modules for edgecontroller module
   279  	Context *EdgeControllerContext `json:"context,omitempty"`
   280  	// Load indicates edgecontroller load
   281  	Load *EdgeControllerLoad `json:"load,omitempty"`
   282  }
   283  
   284  // EdgeControllerBuffer indicates the edgecontroller buffer
   285  type EdgeControllerBuffer struct {
   286  	// UpdatePodStatus indicates the buffer of pod status
   287  	// default 1024
   288  	UpdatePodStatus int32 `json:"updatePodStatus,omitempty"`
   289  	// UpdateNodeStatus indicates the buffer of update node status
   290  	// default 1024
   291  	UpdateNodeStatus int32 `json:"updateNodeStatus,omitempty"`
   292  	// QueryConfigmap indicates the buffer of query configmap
   293  	// default 1024
   294  	QueryConfigmap int32 `json:"queryConfigmap,omitempty"`
   295  	// QuerySecret indicates the buffer of query secret
   296  	// default 1024
   297  	QuerySecret int32 `json:"querySecret,omitempty"`
   298  	// QueryService indicates the buffer of query service
   299  	// default 1024
   300  	QueryService int32 `json:"queryService,omitempty"`
   301  	// QueryEndpoints indicates the buffer of query endpoint
   302  	// default 1024
   303  	QueryEndpoints int32 `json:"queryEndpoints,omitempty"`
   304  	// PodEvent indicates the buffer of pod event
   305  	// default 1
   306  	PodEvent int32 `json:"podEvent,omitempty"`
   307  	// ConfigmapEvent indicates the buffer of config map event
   308  	// default 1
   309  	ConfigmapEvent int32 `json:"configmapEvent,omitempty"`
   310  	// SecretEvent indicates the buffer of secret event
   311  	// default 1
   312  	SecretEvent int32 `json:"secretEvent,omitempty"`
   313  	// ServiceEvent indicates the buffer of service event
   314  	// default 1
   315  	ServiceEvent int32 `json:"serviceEvent,omitempty"`
   316  	// EndpointsEvent indicates the buffer of endpoint event
   317  	// default 1
   318  	EndpointsEvent int32 `json:"endpointsEvent,omitempty"`
   319  	// QueryPersistentVolume indicates the buffer of query persistent volume
   320  	// default 1024
   321  	QueryPersistentVolume int32 `json:"queryPersistentvolume,omitempty"`
   322  	// QueryPersistentVolumeClaim indicates the buffer of query persistent volume claim
   323  	// default 1024
   324  	QueryPersistentVolumeClaim int32 `json:"queryPersistentvolumeclaim,omitempty"`
   325  	// QueryVolumeAttachment indicates the buffer of query volume attachment
   326  	// default 1024
   327  	QueryVolumeAttachment int32 `json:"queryVolumeattachment,omitempty"`
   328  	// QueryNode indicates the buffer of query node
   329  	// default 1024
   330  	QueryNode int32 `json:"queryNode,omitempty"`
   331  	// UpdateNode indicates the buffer of update node
   332  	// default 1024
   333  	UpdateNode int32 `json:"updateNode,omitempty"`
   334  }
   335  
   336  // EdgeControllerContext indicates the edgecontroller context
   337  type EdgeControllerContext struct {
   338  	// SendModule indicates which module will send message to
   339  	SendModule metaconfig.ModuleName `json:"sendModule,omitempty"`
   340  	// ReceiveModule indicates which module will receive message from
   341  	ReceiveModule metaconfig.ModuleName `json:"receiveModule,omitempty"`
   342  	// ResponseModule indicates which module will response message to
   343  	ResponseModule metaconfig.ModuleName `json:"responseModule,omitempty"`
   344  }
   345  
   346  // EdgeControllerLoad indicates the edgecontroller load
   347  type EdgeControllerLoad struct {
   348  	// UpdatePodStatusWorkers indicates the load of update pod status workers
   349  	// default 1
   350  	UpdatePodStatusWorkers int32 `json:"updatePodStatusWorkers,omitempty"`
   351  	// UpdateNodeStatusWorkers indicates the load of update node status workers
   352  	// default 1
   353  	UpdateNodeStatusWorkers int32 `json:"updateNodeStatusWorkers,omitempty"`
   354  	// QueryConfigmapWorkers indicates the load of query config map workers
   355  	// default 1
   356  	QueryConfigmapWorkers int32 `json:"queryConfigmapWorkers,omitempty"`
   357  	// QuerySecretWorkers indicates the load of query secret workers
   358  	// default 4
   359  	QuerySecretWorkers int32 `json:"querySecretWorkers,omitempty"`
   360  	// QueryServiceWorkers indicates the load of query service workers
   361  	// default 4
   362  	QueryServiceWorkers int32 `json:"queryServiceWorkers,omitempty"`
   363  	// QueryEndpointsWorkers indicates the load of query endpointer workers
   364  	// default 4
   365  	QueryEndpointsWorkers int32 `json:"queryEndpointsWorkers,omitempty"`
   366  	// QueryPersistentVolumeWorkers indicates the load of query persistent volume workers
   367  	// default 4
   368  	QueryPersistentVolumeWorkers int32 `json:"queryPersistentVolumeWorkers,omitempty"`
   369  	// QueryPersistentVolumeClaimWorkers indicates the load of query persistent volume claim workers
   370  	// default 4
   371  	QueryPersistentVolumeClaimWorkers int32 `json:"queryPersistentColumeClaimWorkers,omitempty"`
   372  	// QueryVolumeAttachmentWorkers indicates the load of query volume attachment workers
   373  	// default 4
   374  	QueryVolumeAttachmentWorkers int32 `json:"queryVolumeAttachmentWorkers,omitempty"`
   375  	// QueryNodeWorkers indicates the load of query node workers
   376  	// default 4
   377  	QueryNodeWorkers int32 `json:"queryNodeWorkers,omitempty"`
   378  	// UpdateNodeWorkers indicates the load of update node workers
   379  	// default 4
   380  	UpdateNodeWorkers int32 `json:"updateNodeWorkers,omitempty"`
   381  }
   382  
   383  // DeviceController indicates the device controller
   384  type DeviceController struct {
   385  	// Enable indicates whether devicecontroller is enabled, if set to false (for debugging etc.), skip checking other devicecontroller configs.
   386  	// default true
   387  	Enable bool `json:"enable,omitempty"`
   388  	// Context indicates send,receive,response modules for devicecontroller module
   389  	Context *DeviceControllerContext `json:"context,omitempty"`
   390  	// Buffer indicates Device controller buffer
   391  	Buffer *DeviceControllerBuffer `json:"buffer,omitempty"`
   392  	// Load indicates DeviceController Load
   393  	Load *DeviceControllerLoad `json:"load,omitempty"`
   394  }
   395  
   396  // DeviceControllerContext indicates the device controller context
   397  type DeviceControllerContext struct {
   398  	// SendModule indicates which module will send message to
   399  	SendModule metaconfig.ModuleName `json:"sendModule,omitempty"`
   400  	// ReceiveModule indicates which module will receive message from
   401  	ReceiveModule metaconfig.ModuleName `json:"receiveModule,omitempty"`
   402  	// ResponseModule indicates which module will response message to
   403  	ResponseModule metaconfig.ModuleName `json:"responseModule,omitempty"`
   404  }
   405  
   406  // DeviceControllerBuffer indicates devicecontroller buffer
   407  type DeviceControllerBuffer struct {
   408  	// UpdateDeviceStatus indicates the buffer of update device status
   409  	// default 1024
   410  	UpdateDeviceStatus int32 `json:"updateDeviceStatus,omitempty"`
   411  	// DeviceEvent indicates the buffer of divice event
   412  	// default 1
   413  	DeviceEvent int32 `json:"deviceEvent,omitempty"`
   414  	// DeviceModelEvent indicates the buffer of device model event
   415  	// default 1
   416  	DeviceModelEvent int32 `json:"deviceModelEvent,omitempty"`
   417  }
   418  
   419  // DeviceControllerLoad indicates the devicecontroller load
   420  type DeviceControllerLoad struct {
   421  	// UpdateDeviceStatusWorkers indicates the load of update device status workers
   422  	// default 1
   423  	UpdateDeviceStatusWorkers int32 `json:"updateDeviceStatusWorkers,omitempty"`
   424  }
   425  
   426  ```
   427  
   428  #### edgecore config apis
   429  
   430  defined in `pkg/apis/edgecore/v1alpha1/types.go`
   431  
   432  ```go
   433  
   434  package v1alpha1
   435  
   436  import (
   437  	metaconfig "github.com/kubeedge/kubeedge/pkg/apis/componentconfig/meta/v1alpha1"
   438  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
   439  )
   440  
   441  const (
   442  	LoadBalanceStrategNameRoundRobin string = "RoundRobin"
   443  )
   444  
   445  const (
   446  	MqttModeInternal MqttMode = 0
   447  	MqttModeBoth     MqttMode = 1
   448  	MqttModeExternal MqttMode = 2
   449  )
   450  
   451  const (
   452  	CGroupDriverCGroupFS = "cgroupfs"
   453  	CGroupDriverSystemd  = "systemd"
   454  )
   455  
   456  const (
   457  	// DataBaseDriverName is sqlite3
   458  	DataBaseDriverName = "sqlite3"
   459  	// DataBaseAliasName is default
   460  	DataBaseAliasName = "default"
   461  	// DataBaseDataSource is edge.db
   462  	DataBaseDataSource = "/var/lib/kubeedge/edgecore.db"
   463  )
   464  
   465  type ProtocolName string
   466  type MqttMode int
   467  
   468  // EdgeCoreConfig indicates the edgecore config which read from edgecore config file
   469  type EdgeCoreConfig struct {
   470  	metav1.TypeMeta
   471  	// DataBase indicates database info
   472  	// +Required
   473  	DataBase *DataBase `json:"database,omitempty"`
   474  	// Modules indicates cloudcore modules config
   475  	// +Required
   476  	Modules *Modules `json:"modules,omitempty"`
   477  }
   478  
   479  // DataBase indicates the datebase info
   480  type DataBase struct {
   481  	// DriverName indicates database driver name
   482  	// default sqlite3
   483  	DriverName string `json:"driverName,omitempty"`
   484  	// AliasName indicates alias name
   485  	// default default
   486  	AliasName string `json:"aliasName,omitempty"`
   487  	// DataSource indicates the data source path
   488  	// default /var/lib/kubeedge/edge.db
   489  	// Note: Can not use "omitempty" option,  It will affect the output of the default configuration file
   490  	DataSource string `json:"dataSource,omitempty"`
   491  }
   492  
   493  // Modules indicates the modules which edgecore will be used
   494  type Modules struct {
   495  	// Edged indicates edged module config
   496  	// +Required
   497  	Edged *Edged `json:"edged,omitempty"`
   498  	// EdgeHub indicates edgehub module config
   499  	// +Required
   500  	EdgeHub *EdgeHub `json:"edgehub,omitempty"`
   501  	// EventBus indicates eventbus config for edgecore
   502  	// +Required
   503  	EventBus *EventBus `json:"eventbus,omitempty"`
   504  	// MetaManager indicates meta module config
   505  	// +Required
   506  	MetaManager *MetaManager `json:"metamanager,omitempty"`
   507  	// ServiceBus indicates module config
   508  	ServiceBus *ServiceBus `json:"servicebus,omitempty"`
   509  	// DeviceTwin indicates module config
   510  	DeviceTwin *DeviceTwin `json:"devicetwin,omitempty"`
   511  	// DBTest indicates module config
   512  	DBTest *DBTest `json:"dbtest,omitempty"`
   513  	// Mesh indicates mesh module config
   514  	// +Required
   515  	EdgeMesh *EdgeMesh `json:"edgemesh,omitempty"`
   516  }
   517  
   518  // Edged indicates the config fo edged module
   519  // edged is lighted-kubelet
   520  type Edged struct {
   521  	// Enable indicates whether edged is enabled, if set to false (for debugging etc.), skip checking other edged configs.
   522  	// default true
   523  	Enable bool `json:"enable,omitempty"`
   524  	// NodeStatusUpdateFrequency indicates node status update frequency (second)
   525  	// default 10
   526  	NodeStatusUpdateFrequency int32 `json:"nodeStatusUpdateFrequency,omitempty"`
   527  	// RuntimeType indicates cri runtime ,support: docker, remote
   528  	// default docker
   529  	RuntimeType string `json:"runtimeType,omitempty"`
   530  	// DockerAddress indicates docker server address
   531  	// default unix:///var/run/docker.sock
   532  	DockerAddress string `json:"dockerAddress,omitempty"`
   533  	// RemoteRuntimeEndpoint indicates remote runtime endpoint
   534  	// default unix:///var/run/dockershim.sock
   535  	RemoteRuntimeEndpoint string `json:"remoteRuntimeEndpoint,omitempty"`
   536  	// RemoteImageEndpoint indicates remote image endpoint
   537  	// default unix:///var/run/dockershim.sock
   538  	RemoteImageEndpoint string `json:"remoteImageEndpoint,omitempty"`
   539  	// NodeIP indicates current node ip
   540  	// default get local host ip
   541  	NodeIP string `json:"nodeIP"`
   542  	// ClusterDNS indicates cluster dns
   543  	// Note: Can not use "omitempty" option,  It will affect the output of the default configuration file
   544  	// +Required
   545  	ClusterDNS string `json:"clusterDNS"`
   546  	// ClusterDomain indicates cluster domain
   547  	// Note: Can not use "omitempty" option,  It will affect the output of the default configuration file
   548  	ClusterDomain string `json:"clusterDomain"`
   549  	// EdgedMemoryCapacity indicates memory capacity (byte)
   550  	// default 7852396000
   551  	EdgedMemoryCapacity int64 `json:"edgedMemoryCapacity,omitempty"`
   552  	// PodSandboxImage is the image whose network/ipc namespaces containers in each pod will use.
   553  	// +Required
   554  	// kubeedge/pause:3.1 for x86 arch
   555  	// kubeedge/pause-arm:3.1 for arm arch
   556  	// kubeedge/pause-arm64 for arm64 arch
   557  	// default kubeedge/pause:3.1
   558  	PodSandboxImage string `json:"podSandboxImage,omitempty"`
   559  	// ImagePullProgressDeadline indicates image pull progress dead line (second)
   560  	// default 60
   561  	ImagePullProgressDeadline int32 `json:"imagePullProgressDeadline,omitempty"`
   562  	// RuntimeRequestTimeout indicates runtime request timeout (second)
   563  	// default 2
   564  	RuntimeRequestTimeout int32 `json:"runtimeRequestTimeout,omitempty"`
   565  	// HostnameOverride indicates hostname
   566  	// default os.Hostname()
   567  	HostnameOverride string `json:"hostnameOverride,omitempty"`
   568  	//RegisterNodeNamespace indicates register node namespace
   569  	// default default
   570  	RegisterNodeNamespace string `json:"registerNodeNamespace,omitempty"`
   571  	// InterfaceName indicates interface name
   572  	// default eth0
   573  	InterfaceName string `json:"interfaceName,omitempty"`
   574  	// DevicePluginEnabled indicates enable device plugin
   575  	// default false
   576  	// Note: Can not use "omitempty" option,  It will affect the output of the default configuration file
   577  	DevicePluginEnabled bool `json:"devicePluginEnabled"`
   578  	// GPUPluginEnabled indicates enable gpu gplugin
   579  	// default false,
   580  	// Note: Can not use "omitempty" option,  It will affect the output of the default configuration file
   581  	GPUPluginEnabled bool `json:"gpuPluginEnabled"`
   582  	// ImageGCHighThreshold indicates image gc high threshold (percent)
   583  	// default 80
   584  	ImageGCHighThreshold int32 `json:"imageGCHighThreshold,omitempty"`
   585  	// ImageGCLowThreshold indicates image gc low threshold (percent)
   586  	// default 40
   587  	ImageGCLowThreshold int32 `json:"imageGCLowThreshold,omitempty"`
   588  	// MaximumDeadContainersPerPod indicates max num dead containers per pod
   589  	// default 1
   590  	MaximumDeadContainersPerPod int32 `json:"maximumDeadContainersPerPod,omitempty"`
   591  	// CGroupDriver indicates container cgroup driver, support: cgroupfs,systemd
   592  	// default cgroupfs
   593  	// +Required
   594  	CGroupDriver string `json:"cgroupDriver,omitempty"`
   595  	// RegisterNode enables automatic registration
   596  	// default true
   597  	RegisterNode bool `json:"registerNode,omitempty"`
   598  }
   599  
   600  // EdgeHub indicates the edgehub module config
   601  type EdgeHub struct {
   602  	// Enable indicates whether edgehub is enabled, if set to false (for debugging etc.), skip checking other edgehub configs.
   603  	// default true
   604  	Enable bool `json:"enable,omitempty"`
   605  	// Heartbeat indicates heart beat (second)
   606  	// default 15
   607  	Heartbeat int32 `json:"heartbeat,omitempty"`
   608  	// ProjectID indicates project id
   609  	// default e632aba927ea4ac2b575ec1603d56f10
   610  	ProjectID string `json:"projectID,omitempty"`
   611  	// TLSCAFile set ca file path
   612  	// default /etc/kubeedge/ca/rootCA.crt
   613  	TLSCAFile string `json:"tlsCaFile,omitempty"`
   614  	// TLSCertFile indicates the file containing x509 Certificate for HTTPS
   615  	// default /etc/kubeedge/certs/edge.crt
   616  	TLSCertFile string `json:"tlsCertFile,omitempty"`
   617  	// TLSPrivateKeyFile indicates the file containing x509 private key matching tlsCertFile
   618  	// default /etc/kubeedge/certs/edge.key
   619  	TLSPrivateKeyFile string `json:"tlsPrivateKeyFile,omitempty"`
   620  	// Quic indicates quic config for edgehub module
   621  	// Optional if websocket is configured
   622  	Quic *EdgeHubQUIC `json:"quic,omitempty"`
   623  	// WebSocket indicates websocket config for edgehub module
   624  	// Optional if quic  is configured
   625  	WebSocket *EdgeHubWebSocket `json:"websocket,omitempty"`
   626  }
   627  
   628  // EdgeHubQUIC indicates the quic client config
   629  type EdgeHubQUIC struct {
   630  	// Enable indicates whether enable this protocol
   631  	// default true
   632  	Enable bool `json:"enable,omitempty"`
   633  	// HandshakeTimeout indicates hand shake timeout (second)
   634  	// default 30
   635  	HandshakeTimeout int32 `json:"handshakeTimeout,omitempty"`
   636  	// ReadDeadline indicates read dead line (second)
   637  	// default 15
   638  	ReadDeadline int32 `json:"readDeadline,omitempty"`
   639  	// Server indicates quic server addres (ip:port)
   640  	// +Required
   641  	Server string `json:"server,omitempty"`
   642  	// WriteDeadline indicates write dead line (second)
   643  	// default 15
   644  	WriteDeadline int32 `json:"writeDeadline,omitempty"`
   645  }
   646  
   647  // EdgeHubWebSocket indicates the websocket client config
   648  type EdgeHubWebSocket struct {
   649  	// Enable indicates whether enable this protocol
   650  	// default true
   651  	Enable bool `json:"enable,omitempty"`
   652  	// HandshakeTimeout indicates handshake timeout (second)
   653  	// default  30
   654  	HandshakeTimeout int32 `json:"handshakeTimeout,omitempty"`
   655  	// ReadDeadline indicates read dead line (second)
   656  	// default 15
   657  	ReadDeadline int32 `json:"readDeadline,omitempty"`
   658  	// Server indicates websocket server address (ip:port)
   659  	// +Required
   660  	Server string `json:"server,omitempty"`
   661  	// WriteDeadline indicates write dead line (second)
   662  	// default 15
   663  	WriteDeadline int32 `json:"writeDeadline,omitempty"`
   664  }
   665  
   666  // EventBus indicates the event bus module config
   667  type EventBus struct {
   668  	// Enable indicates whether eventbus is enabled, if set to false (for debugging etc.), skip checking other eventbus configs.
   669  	// default true
   670  	Enable bool `json:"enable,omitempty"`
   671  	// MqttQOS indicates mqtt qos
   672  	// 0: QOSAtMostOnce, 1: QOSAtLeastOnce, 2: QOSExactlyOnce
   673  	// default 0
   674  	// Note: Can not use "omitempty" option,  It will affect the output of the default configuration file
   675  	MqttQOS uint8 `json:"mqttQOS"`
   676  	// MqttRetain indicates whether server will store the message and can be delivered to future subscribers
   677  	// if this flag set true, sever will store the message and can be delivered to future subscribers
   678  	// default false
   679  	// Note: Can not use "omitempty" option,  It will affect the output of the default configuration file
   680  	MqttRetain bool `json:"mqttRetain"`
   681  	// MqttSessionQueueSize indicates the size of how many sessions will be handled.
   682  	// default 100
   683  	MqttSessionQueueSize int32 `json:"mqttSessionQueueSize,omitempty"`
   684  	// MqttServerInternal indicates internal mqtt broker url
   685  	// default tcp://127.0.0.1:1884
   686  	MqttServerInternal string `json:"mqttServerInternal,omitempty"`
   687  	// MqttServerExternal indicates external mqtt broker url
   688  	// default tcp://127.0.0.1:1883
   689  	MqttServerExternal string `json:"mqttServerExternal,omitempty"`
   690  	// MqttMode indicates which broker type will be choose
   691  	// 0: internal mqtt broker enable only. 1: internal and external mqtt broker enable. 2: external mqtt broker enable only
   692  	// +Required
   693  	// default: 2
   694  	MqttMode MqttMode `json:"mqttMode"`
   695  }
   696  
   697  // MetaManager indicates the metamanager module config
   698  type MetaManager struct {
   699  	// Enable indicates whether metamanager is enabled, if set to false (for debugging etc.), skip checking other metamanager configs.
   700  	// default true
   701  	Enable bool `json:"enable,omitempty"`
   702  	// ContextSendGroup indicates send group
   703  	ContextSendGroup metaconfig.GroupName `json:"contextSendGroup,omitempty"`
   704  	// ContextSendModule indicates send module
   705  	ContextSendModule metaconfig.ModuleName `json:"contextSendModule,omitempty"`
   706  	// PodStatusSyncInterval indicates pod status sync
   707  	PodStatusSyncInterval int32 `json:"podStatusSyncInterval,omitempty"`
   708  }
   709  
   710  // ServiceBus indicates the servicebus module config
   711  type ServiceBus struct {
   712  	// Enable indicates whether servicebus is enabled, if set to false (for debugging etc.), skip checking other servicebus configs.
   713  	// default true
   714  	Enable bool `json:"enable,omitempty"`
   715  }
   716  
   717  // DeviceTwin indicates the servicebus module config
   718  type DeviceTwin struct {
   719  	// Enable indicates whether devicetwin is enabled, if set to false (for debugging etc.), skip checking other devicetwin configs.
   720  	// default true
   721  	Enable bool `json:"enable,omitempty"`
   722  }
   723  
   724  // DBTest indicates the DBTest module config
   725  type DBTest struct {
   726  	// Enable indicates whether dbtest is enabled, if set to false (for debugging etc.), skip checking other dbtest configs.
   727  	// default false
   728  	Enable bool `json:"enable"`
   729  }
   730  
   731  // EdgeMesh indicates the edgemesh module config
   732  type EdgeMesh struct {
   733  	// Enable indicates whether edgemesh is enabled, if set to false (for debugging etc.), skip checking other edgemesh configs.
   734  	// default true
   735  	Enable bool `json:"enable,omitempty"`
   736  	// lbStrategy indicates loadbalance stragety name
   737  	LBStrategy string `json:"lbStrategy,omitempty"`
   738  }
   739  
   740  ```
   741  
   742  #### edgesite config apis
   743  
   744  defined in `pkg/apis/edgesite/v1alpha1/types.go`
   745  
   746  ```go
   747  
   748  package v1alpha1
   749  
   750  import (
   751  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
   752  
   753  	cloudcoreconfig "github.com/kubeedge/kubeedge/pkg/apis/componentconfig/cloudcore/v1alpha1"
   754  	edgecoreconfig "github.com/kubeedge/kubeedge/pkg/apis/componentconfig/edgecore/v1alpha1"
   755  )
   756  
   757  const (
   758  	// DataBaseDriverName is sqlite3
   759  	DataBaseDriverName = "sqlite3"
   760  	// DataBaseAliasName is default
   761  	DataBaseAliasName = "default"
   762  	// DataBaseDataSource is edge.db
   763  	DataBaseDataSource = "/var/lib/kubeedge/edgesite.db"
   764  )
   765  
   766  // EdgeSiteConfig indicates the edgesite config which read from edgesite config file
   767  type EdgeSiteConfig struct {
   768  	metav1.TypeMeta
   769  	// DataBase indicates database info
   770  	// +Required
   771  	DataBase *edgecoreconfig.DataBase `json:"database,omitempty"`
   772  	// KubeAPIConfig indicates the kubernetes cluster info which cloudcore will connected
   773  	// +Required
   774  	KubeAPIConfig *cloudcoreconfig.KubeAPIConfig `json:"kubeAPIConfig,omitempty"`
   775  	// Modules indicates cloudcore modules config
   776  	// +Required
   777  	Modules *Modules `json:"modules,omitempty"`
   778  }
   779  
   780  // Modules indicates the modules which edgesite will be used
   781  type Modules struct {
   782  	// EdgeController indicates edgecontroller module config
   783  	EdgeController *cloudcoreconfig.EdgeController `json:"edgecontroller,omitempty"`
   784  	// Edged indicates edged module config
   785  	// +Required
   786  	Edged *edgecoreconfig.Edged `json:"edged,omitempty"`
   787  	// MetaManager indicates meta module config
   788  	// +Required
   789  	MetaManager *edgecoreconfig.MetaManager `json:"metamanager,omitempty"`
   790  }
   791  
   792  ```
   793  
   794  ### Default config file locations
   795  
   796  KubeEdge components would load config files in path `/etc/kubeedge/config/` by default, and users can customize the locations with `--config` flag:
   797  
   798  * **cloudcore**
   799  
   800  default load  `/etc/kubeedge/config/cloudcore.yaml` configfile
   801  start cloudcore with specific config file location
   802  `cloudcore --config "/<your-path-to-cloudcore-config>/cloudcore.yaml"`
   803  
   804  * **edgecore**
   805  
   806  default load  `/etc/kubeedge/config/edgecore.yaml` configfile
   807  
   808  * **edgeside**
   809  
   810  default load `/etc/kubeedge/config/edgesite.yaml` configfile
   811  
   812  ### Use `--defaultconfig` and `--minconfig` flag to generate default full and common config component config with default values
   813  
   814  
   815   With `--dfaultconfig` flag, users can easily get a default full config file as reference, with all fields (and field descriptions) included and default values set. It's useful to users that are new to KubeEdge, and they can modify/create their own configs accordingly. Because it is a full configuration, it is more suitable for advanced users.
   816  
   817   With `--minconfig` flag, users can easily get min used configurations as reference. It's useful to users that are new to KubeEdge, and they can modify/create their own configs accordingly. This configuration is suitable for beginners.
   818  
   819  * cloudcore 
   820  
   821  `# cloudcore --defaultconfig` 
   822  
   823  ```yaml
   824  
   825  apiVersion: cloudcore.config.kubeedge.io/v1alpha1
   826  kind: CloudCore
   827  kubeAPIConfig:
   828    burst: 200
   829    contentType: application/vnd.kubernetes.protobuf
   830    kubeConfig: /root/.kube/config
   831    master: ""
   832    qps: 100
   833  modules:
   834    cloudhub:
   835      enable: true
   836      keepaliveInterval: 30
   837      nodeLimit: 10
   838      quic:
   839        address: 0.0.0.0
   840        maxIncomingStreams: 10000
   841        port: 10001
   842      tlsCAFile: /etc/kubeedge/ca/rootCA.crt
   843      tlsCertFile: /etc/kubeedge/certs/edge.crt
   844      tlsPrivateKeyFile: /etc/kubeedge/certs/edge.key
   845      unixsocket:
   846        address: unix:///var/lib/kubeedge/kubeedge.sock
   847        enable: true
   848      websocket:
   849        address: 0.0.0.0
   850        enable: true
   851        port: 10000
   852      writeTimeout: 30
   853    devicecontroller:
   854      buffer:
   855        deviceEvent: 1
   856        deviceModelEvent: 1
   857        updateDeviceStatus: 1024
   858      context:
   859        receiveModule: devicecontroller
   860        responseModule: cloudhub
   861        sendModule: cloudhub
   862      enable: true
   863      load:
   864        updateDeviceStatusWorkers: 1
   865    edgecontroller:
   866      buffer:
   867        configmapEvent: 1
   868        endpointsEvent: 1
   869        podEvent: 1
   870        queryConfigmap: 1024
   871        queryEndpoints: 1024
   872        queryNode: 1024
   873        queryPersistentvolume: 1024
   874        queryPersistentvolumeclaim: 1024
   875        querySecret: 1024
   876        queryService: 1024
   877        queryVolumeattachment: 1024
   878        secretEvent: 1
   879        serviceEvent: 1
   880        updateNode: 1024
   881        updateNodeStatus: 1024
   882        updatePodStatus: 1024
   883      context:
   884        receiveModule: edgecontroller
   885        responseModule: cloudhub
   886        sendModule: cloudhub
   887      enable: true
   888      load:
   889        queryConfigmapWorkers: 4
   890        queryEndpointsWorkers: 4
   891        queryNodeWorkers: 4
   892        queryPersistentColumeClaimWorkers: 4
   893        queryPersistentVolumeWorkers: 4
   894        querySecretWorkers: 4
   895        queryServiceWorkers: 4
   896        queryVolumeAttachmentWorkers: 4
   897        updateNodeStatusWorkers: 1
   898        updateNodeWorkers: 4
   899        updatePodStatusWorkers: 1
   900      nodeUpdateFrequency: 10
   901  
   902  
   903  ```
   904  
   905  
   906  `# cloudcore --minconfig` 
   907  
   908  ```yaml
   909  
   910  apiVersion: cloudcore.config.kubeedge.io/v1alpha1
   911  kind: CloudCore
   912  kubeAPIConfig:
   913    kubeConfig: /root/.kube/config
   914    master: ""
   915  modules:
   916    cloudhub:
   917      nodeLimit: 10
   918      tlsCAFile: /etc/kubeedge/ca/rootCA.crt
   919      tlsCertFile: /etc/kubeedge/certs/edge.crt
   920      tlsPrivateKeyFile: /etc/kubeedge/certs/edge.key
   921      unixsocket:
   922        address: unix:///var/lib/kubeedge/kubeedge.sock
   923        enable: true
   924      websocket:
   925        address: 0.0.0.0
   926        enable: true
   927        port: 10000
   928  
   929  
   930  ```
   931  
   932  
   933  * edgecore
   934  
   935  `# edgecore --defaultconfig` 
   936  
   937  ```yaml
   938  
   939  apiVersion: edgecore.config.kubeedge.io/v1alpha1
   940  database:
   941    aliasName: default
   942    dataSource: /var/lib/kubeedge/edgecore.db
   943    driverName: sqlite3
   944  kind: EdgeCore
   945  modules:
   946    dbtest:
   947      enable: false
   948    devicetwin:
   949      enable: true
   950    edged:
   951      cgroupDriver: cgroupfs
   952      clusterDNS: ""
   953      clusterDomain: ""
   954      devicePluginEnabled: false
   955      dockerAddress: unix:///var/run/docker.sock
   956      edgedMemoryCapacity: 7852396000
   957      enable: true
   958      gpuPluginEnabled: false
   959      hostnameOverride: zhangjiedeMacBook-Pro.local
   960      imageGCHighThreshold: 80
   961      imageGCLowThreshold: 40
   962      imagePullProgressDeadline: 60
   963      interfaceName: eth0
   964      maximumDeadContainersPerPod: 1
   965      nodeIP: 192.168.4.3
   966      nodeStatusUpdateFrequency: 10
   967      podSandboxImage: kubeedge/pause:3.1
   968      registerNode: true
   969      registerNodeNamespace: default
   970      remoteImageEndpoint: unix:///var/run/dockershim.sock
   971      remoteRuntimeEndpoint: unix:///var/run/dockershim.sock
   972      runtimeRequestTimeout: 2
   973      runtimeType: docker
   974    edgehub:
   975      enable: true
   976      heartbeat: 15
   977      projectID: e632aba927ea4ac2b575ec1603d56f10
   978      quic:
   979        handshakeTimeout: 30
   980        readDeadline: 15
   981        server: 127.0.0.1:10001
   982        writeDeadline: 15
   983      tlsCaFile: /etc/kubeedge/ca/rootCA.crt
   984      tlsCertFile: /etc/kubeedge/certs/edge.crt
   985      tlsPrivateKeyFile: /etc/kubeedge/certs/edge.key
   986      websocket:
   987        enable: true
   988        handshakeTimeout: 30
   989        readDeadline: 15
   990        server: 127.0.0.1:10000
   991        writeDeadline: 15
   992    edgemesh:
   993      enable: true
   994      lbStrategy: RoundRobin
   995    eventbus:
   996      enable: true
   997      mqttMode: 2
   998      mqttQOS: 0
   999      mqttRetain: false
  1000      mqttServerExternal: tcp://127.0.0.1:1883
  1001      mqttServerInternal: tcp://127.0.0.1:1884
  1002      mqttSessionQueueSize: 100
  1003    metamanager:
  1004      contextSendGroup: hub
  1005      contextSendModule: websocket
  1006      enable: true
  1007      podStatusSyncInterval: 60
  1008    servicebus: 
  1009      enable: false 
  1010  
  1011  ```
  1012  
  1013  `# edgecore --minconfig` 
  1014  
  1015  ```yaml
  1016  
  1017  apiVersion: edgecore.config.kubeedge.io/v1alpha1
  1018  database:
  1019    dataSource: /var/lib/kubeedge/edgecore.db
  1020  kind: EdgeCore
  1021  modules:
  1022    edged:
  1023      cgroupDriver: cgroupfs
  1024      clusterDNS: ""
  1025      clusterDomain: ""
  1026      devicePluginEnabled: false
  1027      dockerAddress: unix:///var/run/docker.sock
  1028      gpuPluginEnabled: false
  1029      hostnameOverride: zhangjiedeMacBook-Pro.local
  1030      interfaceName: eth0
  1031      nodeIP: 192.168.4.3
  1032      podSandboxImage: kubeedge/pause:3.1
  1033      remoteImageEndpoint: unix:///var/run/dockershim.sock
  1034      remoteRuntimeEndpoint: unix:///var/run/dockershim.sock
  1035      runtimeType: docker
  1036    edgehub:
  1037      heartbeat: 15
  1038      tlsCaFile: /etc/kubeedge/ca/rootCA.crt
  1039      tlsCertFile: /etc/kubeedge/certs/edge.crt
  1040      tlsPrivateKeyFile: /etc/kubeedge/certs/edge.key
  1041      websocket:
  1042        enable: true
  1043        handshakeTimeout: 30
  1044        readDeadline: 15
  1045        server: 127.0.0.1:10000
  1046        writeDeadline: 15
  1047    eventbus:
  1048      mqttMode: 2
  1049      mqttQOS: 0
  1050      mqttRetain: false
  1051      mqttServerExternal: tcp://127.0.0.1:1883
  1052      mqttServerInternal: tcp://127.0.0.1:1884
  1053  
  1054  
  1055  ```
  1056  
  1057  
  1058  
  1059  * edgesite
  1060  
  1061  `# edgesite --defaultconfig` 
  1062  
  1063  ```yaml
  1064  
  1065  apiVersion: edgesite.config.kubeedge.io/v1alpha1
  1066  database:
  1067    aliasName: default
  1068    dataSource: /var/lib/kubeedge/edgesite.db
  1069    driverName: sqlite3
  1070  kind: EdgeSite
  1071  kubeAPIConfig:
  1072    burst: 200
  1073    contentType: application/vnd.kubernetes.protobuf
  1074    kubeConfig: /root/.kube/config
  1075    master: ""
  1076    qps: 100
  1077  modules:
  1078    edgecontroller:
  1079      buffer:
  1080        configmapEvent: 1
  1081        endpointsEvent: 1
  1082        podEvent: 1
  1083        queryConfigmap: 1024
  1084        queryEndpoints: 1024
  1085        queryNode: 1024
  1086        queryPersistentvolume: 1024
  1087        queryPersistentvolumeclaim: 1024
  1088        querySecret: 1024
  1089        queryService: 1024
  1090        queryVolumeattachment: 1024
  1091        secretEvent: 1
  1092        serviceEvent: 1
  1093        updateNode: 1024
  1094        updateNodeStatus: 1024
  1095        updatePodStatus: 1024
  1096      context:
  1097        receiveModule: edgecontroller
  1098        responseModule: metaManager
  1099        sendModule: metaManager
  1100      enable: true
  1101      load:
  1102        queryConfigmapWorkers: 4
  1103        queryEndpointsWorkers: 4
  1104        queryNodeWorkers: 4
  1105        queryPersistentColumeClaimWorkers: 4
  1106        queryPersistentVolumeWorkers: 4
  1107        querySecretWorkers: 4
  1108        queryServiceWorkers: 4
  1109        queryVolumeAttachmentWorkers: 4
  1110        updateNodeStatusWorkers: 1
  1111        updateNodeWorkers: 4
  1112        updatePodStatusWorkers: 1
  1113      nodeUpdateFrequency: 10
  1114    edged:
  1115      cgroupDriver: cgroupfs
  1116      clusterDNS: ""
  1117      clusterDomain: ""
  1118      devicePluginEnabled: false
  1119      dockerAddress: unix:///var/run/docker.sock
  1120      edgedMemoryCapacity: 7852396000
  1121      enable: true
  1122      gpuPluginEnabled: false
  1123      hostnameOverride: zhangjiedeMacBook-Pro.local
  1124      imageGCHighThreshold: 80
  1125      imageGCLowThreshold: 40
  1126      imagePullProgressDeadline: 60
  1127      interfaceName: eth0
  1128      maximumDeadContainersPerPod: 1
  1129      nodeIP: 192.168.4.3
  1130      nodeStatusUpdateFrequency: 10
  1131      podSandboxImage: kubeedge/pause:3.1
  1132      registerNode: true
  1133      registerNodeNamespace: default
  1134      remoteImageEndpoint: unix:///var/run/dockershim.sock
  1135      remoteRuntimeEndpoint: unix:///var/run/dockershim.sock
  1136      runtimeRequestTimeout: 2
  1137      runtimeType: docker
  1138    metamanager:
  1139      contextSendGroup: edgecontroller
  1140      contextSendModule: edgecontroller
  1141      enable: true
  1142      podStatusSyncInterval: 60
  1143  
  1144  ```
  1145  
  1146  `# edgesite --minconfig` 
  1147  
  1148  ```yaml
  1149  
  1150  apiVersion: edgesite.config.kubeedge.io/v1alpha1
  1151  database:
  1152    dataSource: /var/lib/kubeedge/edgesite.db
  1153  kind: EdgeSite
  1154  kubeAPIConfig:
  1155    kubeConfig: /root/.kube/config
  1156    master: ""
  1157  modules:
  1158    edged:
  1159      cgroupDriver: cgroupfs
  1160      clusterDNS: ""
  1161      clusterDomain: ""
  1162      devicePluginEnabled: false
  1163      dockerAddress: unix:///var/run/docker.sock
  1164      gpuPluginEnabled: false
  1165      hostnameOverride: zhangjiedeMacBook-Pro.local
  1166      interfaceName: eth0
  1167      nodeIP: 192.168.4.3
  1168      podSandboxImage: kubeedge/pause:3.1
  1169      remoteImageEndpoint: unix:///var/run/dockershim.sock
  1170      remoteRuntimeEndpoint: unix:///var/run/dockershim.sock
  1171      runtimeType: docker
  1172  
  1173  ```
  1174  
  1175  
  1176  ### Compatible with old configuration files
  1177  
  1178  In order to support the old configuration file , there are 2 options:
  1179  
  1180  1. KubeEdge components support the old configuration file at runtime, when the component is running, if component find that the configuration file does not have a version number, it is considered to be the old configuration file, and the internal convert method will convert the configuration to the corresponding new configuration.
  1181  
  1182  2. keadm provides a conversion command to convert the old configuration file to new configuration. When the component is running, only support the new configuration file.
  1183  
  1184  We use the second option, because:
  1185  
  1186  * There are 3 old configuration files for each component, it is quite different from the new configuration definition and they are eventually discarded in the near future.
  1187  
  1188  * If the component supports the old configuration file, it will add configuration-compatible logic inside the component. We might as well let keadm do this. such as:
  1189  
  1190  ```
  1191  keadm convertconfig --component=<cloudcore,edgecore,edgesite> --srcdir=<old config dir> --desdir=<new config dir> 
  1192  
  1193  ```
  1194  
  1195  `srcdir` flag set the dir of the old 2 configfiles. 
  1196  `desdir` flag set the dir of the new configfile. if `despath` is not set, keadm only print new config, user can create config file by those print info.
  1197  
  1198  keadm first load the old two configfiles and create the new config for each component.
  1199  
  1200  We can gradually abandon this command after the release of several stable versions.
  1201  
  1202  
  1203  ### new config file need version number 
  1204  
  1205  Just like kubernetes component config, KubeEdge component config need `apiVersion` to define config version schema .
  1206  
  1207  * cloudcore
  1208  
  1209  ```yaml
  1210  apiVersion: cloudcore.config.kubeedge.io/v1alpha1
  1211  ```
  1212  
  1213  * edgecore
  1214  
  1215  ```yaml
  1216  apiVersion: edgecore.config.kubeedge.io/v1alpha1
  1217  ```
  1218  
  1219  * edgsite
  1220  
  1221  ```yaml
  1222  apiVersion: edgesite.config.kubeedge.io/v1alpha1
  1223  ```
  1224  
  1225  ### How to pass the configuration to each module
  1226  
  1227  After the program runs, load the configuration file and use the Register method of each module to pass the configuration to the global variables of each module.
  1228  
  1229  
  1230  ### Use keadm to install and configure KubeEdge components
  1231  
  1232  `keadm` can use the KubeEdge components config api to generate configuration files for each component and allows additional command line flags to override the configuration of each component. This will make it easier to install and configure KubeEdge components.
  1233  
  1234  ## Task list tracking
  1235  
  1236  [Task List](https://github.com/kubeedge/kubeedge/issues/1171)