-
Notifications
You must be signed in to change notification settings - Fork 55
feat: add node metadata. #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1.kcctl deploy/join add --fip flags. 2.format kubeclipper-agent.yaml,add metadata struct. 3.synchronization update deploy config cmd. Signed-off-by: lixd <xueduan.li@gmail.com>
/assign @x893675 |
Signed-off-by: lixd <xueduan.li@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #81 +/- ##
==========================================
+ Coverage 11.66% 11.79% +0.12%
==========================================
Files 98 98
Lines 15009 15096 +87
==========================================
+ Hits 1751 1780 +29
- Misses 13029 13082 +53
- Partials 229 234 +5
|
/milestone v1.2.0 |
/cc @zhuzhenfan @qinyer |
pkg/agent/config/config.go
Outdated
@@ -60,6 +60,11 @@ type Config struct { | |||
ImageProxyOptions *imageproxy.Options `json:"imageProxy,omitempty" yaml:"imageProxy,omitempty" mapstructure:"imageProxy"` | |||
} | |||
|
|||
type MetaData struct { | |||
Region string `json:"region,omitempty" yaml:"region,omitempty"` | |||
FIP string `json:"fip,omitempty" yaml:"fip,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Suggest changing fip to floatIP or extranet IP.
- add comment to explain
@@ -42,6 +42,7 @@ const ( | |||
LabelBackupPoint = "kubeclipper.io/backupPoint" | |||
LabelCronBackupDisable = "kubeclipper.io/cronBackupDisable" | |||
LabelCronBackupEnable = "kubeclipper.io/cronBackupEnable" | |||
LabelMetadataFIP = "metadata.kubeclipper.io/fip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Suggest changing fip to floatIP or extranet IP.
pkg/cli/config/template.go
Outdated
region: {{.Region}} | ||
metadata: | ||
region: {{.Region}} | ||
{{- if .FIP}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Suggest changing fip to floatIP or extranet IP.
delete(a, ip) | ||
} | ||
|
||
func (a Agents) Add(ip string, metadata Metadata) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variables using pointers
_, ok := a[ip] | ||
return ok | ||
} | ||
func (a Agents) Delete(ip string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variables using pointers
if a.Exists(ip) { | ||
return | ||
} | ||
a[region] = append(a[region], ip) | ||
} | ||
|
||
func (a Agents) Delete(ip string) { | ||
func (a AgentRegions) Delete(ip string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variables using pointers
set := sets.NewString() | ||
for _, v := range a { | ||
set.Insert(v...) | ||
} | ||
return set.List() | ||
} | ||
|
||
func (a Agents) Add(region, ip string) { | ||
func (a AgentRegions) Add(region, ip string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variables using pointers
Signed-off-by: lixd <xueduan.li@gmail.com>
/lgtm |
LGTM label has been added. Git tree hash: d459397d4619b9f444e884037a6a6ce1744b6121
|
/cc @x893675 |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lixd, qinyer, x893675 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* feat: add node metadata. 1.kcctl deploy/join add --fip flags. 2.format kubeclipper-agent.yaml,add metadata struct. 3.synchronization update deploy config cmd. Signed-off-by: lixd <xueduan.li@gmail.com> * fix: update kubeconfig when master config fip. Signed-off-by: lixd <xueduan.li@gmail.com> * fix: rename fip to floatIP. Signed-off-by: lixd <xueduan.li@gmail.com> Signed-off-by: lixd <xueduan.li@gmail.com>
What type of PR is this?
/kind feature
What this PR does / why we need it:
add node metadata,config in kubeclipper-agent.yaml report to kc-server by kc-agent.
Which issue(s) this PR fixes:
Fixes #
Special notes for reviewers:
Does this PR introduced a user-facing change?
Additional documentation, usage docs, etc.: