Skip to content

Conversation

lixd
Copy link
Contributor

@lixd lixd commented Aug 9, 2022

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:

1.kcctl deploy/join add --fip flags.
2.format kubeclipper-agent.yaml add metadata struct.
3.synchronization update deploy config cmd.

Does this PR introduced a user-facing change?

None

Additional documentation, usage docs, etc.:


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>
@kubeclipper-bot kubeclipper-bot added kind/feature Categorizes issue or PR as related to a new feature. release-note-none dco-signoff: yes size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 9, 2022
@lixd
Copy link
Contributor Author

lixd commented Aug 9, 2022

/assign @x893675

Signed-off-by: lixd <xueduan.li@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2022

Codecov Report

Merging #81 (c2e7967) into master (2b824b0) will increase coverage by 0.12%.
The diff coverage is 32.65%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
pkg/cli/deploy/config.go 0.00% <ø> (ø)
pkg/cli/join/join.go 0.00% <0.00%> (ø)
pkg/cli/deploy/deploy.go 16.28% <11.11%> (+0.15%) ⬆️
pkg/cli/join/agent.go 73.40% <65.90%> (-7.37%) ⬇️
pkg/scheme/core/v1/k8s/node.go 0.38% <0.00%> (-0.03%) ⬇️
pkg/component/nfs/nfs.go 0.58% <0.00%> (-0.02%) ⬇️
pkg/cli/resource/resource.go 0.75% <0.00%> (-0.01%) ⬇️
pkg/apis/core/v1/registry.go 0.00% <0.00%> (ø)
... and 2 more

@x893675
Copy link
Collaborator

x893675 commented Aug 10, 2022

/milestone v1.2.0

@kubeclipper-bot kubeclipper-bot added this to the v1.2.0 milestone Aug 10, 2022
@x893675
Copy link
Collaborator

x893675 commented Aug 15, 2022

/cc @zhuzhenfan @qinyer

@@ -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"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Suggest changing fip to floatIP or extranet IP.
  2. 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Suggest changing fip to floatIP or extranet IP.

region: {{.Region}}
metadata:
region: {{.Region}}
{{- if .FIP}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Suggest changing fip to floatIP or extranet IP.

delete(a, ip)
}

func (a Agents) Add(ip string, metadata Metadata) {
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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) {
Copy link
Contributor

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>
@qinyer
Copy link
Contributor

qinyer commented Aug 15, 2022

/lgtm

@kubeclipper-bot kubeclipper-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2022
@kubeclipper-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: d459397d4619b9f444e884037a6a6ce1744b6121

@lixd
Copy link
Contributor Author

lixd commented Aug 15, 2022

/cc @x893675

@x893675
Copy link
Collaborator

x893675 commented Aug 15, 2022

/lgtm
/approve

@kubeclipper-bot kubeclipper-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 15, 2022
@kubeclipper-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeclipper-bot kubeclipper-bot merged commit 93c50dc into kubeclipper:master Aug 15, 2022
Xvv-v pushed a commit to Xvv-v/kubeclipper that referenced this pull request Aug 15, 2022
* 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>
@lixd lixd deleted the feat_fip branch October 25, 2022 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants