change node-agent-config name
Signed-off-by: Lyndon-Li <yonghui.li@broadcom.com>pull/7265/head
parent
f6dfa8e7b2
commit
58ead55fd1
|
@ -26,11 +26,11 @@ Therefore, in order to gain the optimized performance with the limited resources
|
|||
|
||||
## Solution
|
||||
|
||||
We introduce a configMap named ```node-agent-configs``` for users to specify the node-agent related configurations. This configMap is not created by Velero, users should create it manually on demand. The configMap should be in the same namespace where Velero is installed. If multiple Velero instances are installed in different namespaces, there should be one configMap in each namespace which applies to node-agent in that namespace only.
|
||||
We introduce a configMap named ```node-agent-config``` for users to specify the node-agent related configurations. This configMap is not created by Velero, users should create it manually on demand. The configMap should be in the same namespace where Velero is installed. If multiple Velero instances are installed in different namespaces, there should be one configMap in each namespace which applies to node-agent in that namespace only.
|
||||
Node-agent server checks these configurations at startup time and use it to initiate the related VGDP modules. Therefore, users could edit this configMap any time, but in order to make the changes effective, node-agent server needs to be restarted.
|
||||
The ```node-agent-configs``` configMap may be used for other purpose of configuring node-agent in future, at present, there is only one kind of configuration as the data in the configMap, the name is ```loadConcurrency```.
|
||||
The ```node-agent-config``` configMap may be used for other purpose of configuring node-agent in future, at present, there is only one kind of configuration as the data in the configMap, the name is ```loadConcurrency```.
|
||||
|
||||
The data structure for ```node-agent-configs``` is as below:
|
||||
The data structure for ```node-agent-config``` is as below:
|
||||
```go
|
||||
type Configs struct {
|
||||
// LoadConcurrency is the config for load concurrency per node.
|
||||
|
@ -82,7 +82,7 @@ At least one node is expected to have a label with the specified ```RuledConfigs
|
|||
If one node falls into more than one rules, e.g., if node1 also has the label ```beta.kubernetes.io/instance-type=Standard_B4ms```, the smallest number (3) will be used.
|
||||
|
||||
### Sample
|
||||
A sample of the ```node-agent-configs``` configMap is as below:
|
||||
A sample of the ```node-agent-config``` configMap is as below:
|
||||
```json
|
||||
{
|
||||
"loadConcurrency": {
|
||||
|
@ -110,7 +110,7 @@ A sample of the ```node-agent-configs``` configMap is as below:
|
|||
```
|
||||
To create the configMap, users need to save something like the above sample to a json file and then run below command:
|
||||
```
|
||||
kubectl create cm node-agent-configs -n velero --from-file=<json file name>
|
||||
kubectl create cm node-agent-config -n velero --from-file=<json file name>
|
||||
```
|
||||
|
||||
### Global data path manager
|
||||
|
|
|
@ -35,7 +35,7 @@ import (
|
|||
const (
|
||||
// daemonSet is the name of the Velero node agent daemonset.
|
||||
daemonSet = "node-agent"
|
||||
configName = "node-agent-configs"
|
||||
configName = "node-agent-config"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -241,10 +241,10 @@ func TestGetPodSpec(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestGetConfigs(t *testing.T) {
|
||||
cm := builder.ForConfigMap("fake-ns", "node-agent-configs").Result()
|
||||
cmWithInvalidDataFormat := builder.ForConfigMap("fake-ns", "node-agent-configs").Data("fake-key", "wrong").Result()
|
||||
cmWithoutCocurrentData := builder.ForConfigMap("fake-ns", "node-agent-configs").Data("fake-key", "{\"someothers\":{\"someother\": 10}}").Result()
|
||||
cmWithValidData := builder.ForConfigMap("fake-ns", "node-agent-configs").Data("fake-key", "{\"loadConcurrency\":{\"globalConfig\": 5}}").Result()
|
||||
cm := builder.ForConfigMap("fake-ns", "node-agent-config").Result()
|
||||
cmWithInvalidDataFormat := builder.ForConfigMap("fake-ns", "node-agent-config").Data("fake-key", "wrong").Result()
|
||||
cmWithoutCocurrentData := builder.ForConfigMap("fake-ns", "node-agent-config").Data("fake-key", "{\"someothers\":{\"someother\": 10}}").Result()
|
||||
cmWithValidData := builder.ForConfigMap("fake-ns", "node-agent-config").Data("fake-key", "{\"loadConcurrency\":{\"globalConfig\": 5}}").Result()
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
|
@ -270,7 +270,7 @@ func TestGetConfigs(t *testing.T) {
|
|||
},
|
||||
},
|
||||
},
|
||||
expectErr: "error to get node agent configs node-agent-configs: fake-get-error",
|
||||
expectErr: "error to get node agent configs node-agent-config: fake-get-error",
|
||||
},
|
||||
{
|
||||
name: "cm's data is nil",
|
||||
|
@ -278,7 +278,7 @@ func TestGetConfigs(t *testing.T) {
|
|||
kubeClientObj: []runtime.Object{
|
||||
cm,
|
||||
},
|
||||
expectErr: "data is not available in config map node-agent-configs",
|
||||
expectErr: "data is not available in config map node-agent-config",
|
||||
},
|
||||
{
|
||||
name: "cm's data is with invalid format",
|
||||
|
@ -286,7 +286,7 @@ func TestGetConfigs(t *testing.T) {
|
|||
kubeClientObj: []runtime.Object{
|
||||
cmWithInvalidDataFormat,
|
||||
},
|
||||
expectErr: "error to unmarshall configs from node-agent-configs: invalid character 'w' looking for beginning of value",
|
||||
expectErr: "error to unmarshall configs from node-agent-config: invalid character 'w' looking for beginning of value",
|
||||
},
|
||||
{
|
||||
name: "concurrency configs are not found",
|
||||
|
|
|
@ -8,7 +8,7 @@ Varying from the data size, data complexity, resource availability, the tasks ma
|
|||
|
||||
Node-agent concurrency configurations allow you to configure the concurrent number of node-agent loads per node. When the resources are sufficient in nodes, you can set a large concurrent number, so as to reduce the backup/restore time; otherwise, the concurrency should be reduced, otherwise, the backup/restore may encounter problems, i.e., time lagging, hang or OOM kill.
|
||||
|
||||
To set Node-agent concurrency configurations, a configMap named ```node-agent-configs``` should be created manually. The configMap should be in the same namespace where Velero is installed. If multiple Velero instances are installed in different namespaces, there should be one configMap in each namespace which applies to node-agent in that namespace only.
|
||||
To set Node-agent concurrency configurations, a configMap named ```node-agent-config``` should be created manually. The configMap should be in the same namespace where Velero is installed. If multiple Velero instances are installed in different namespaces, there should be one configMap in each namespace which applies to node-agent in that namespace only.
|
||||
Node-agent server checks these configurations at startup time. Therefore, you could edit this configMap any time, but in order to make the changes effective, node-agent server needs to be restarted.
|
||||
|
||||
### Global concurrent number
|
||||
|
@ -32,7 +32,7 @@ At least one node is expected to have a label with the specified ```RuledConfigs
|
|||
If one node falls into more than one rules, e.g., if node1 also has the label ```beta.kubernetes.io/instance-type=Standard_B4ms```, the smallest number (3) will be used.
|
||||
|
||||
### Sample
|
||||
A sample of the complete ```node-agent-configs``` configMap is as below:
|
||||
A sample of the complete ```node-agent-config``` configMap is as below:
|
||||
```json
|
||||
{
|
||||
"loadConcurrency": {
|
||||
|
@ -60,7 +60,7 @@ A sample of the complete ```node-agent-configs``` configMap is as below:
|
|||
```
|
||||
To create the configMap, save something like the above sample to a json file and then run below command:
|
||||
```
|
||||
kubectl create cm node-agent-configs -n velero --from-file=<json file name>
|
||||
kubectl create cm node-agent-config -n velero --from-file=<json file name>
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue