实现基本的集群DNS列表、设置、简单数据同步

This commit is contained in:
刘祥超
2020-11-13 18:23:06 +08:00
parent 5820354c90
commit 3e4a50e564
74 changed files with 3533 additions and 2115 deletions

View File

@@ -519,42 +519,41 @@ var file_service_node_group_proto_rawDesc = []byte{
0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x32, 0xa3, 0x04, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65,
0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x32, 0x91, 0x04, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0f,
0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12,
0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47,
0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62,
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61,
0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x2e, 0x70, 0x62,
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a,
0x0f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70,
0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70,
0x62, 0x2e, 0x52, 0x50, 0x43, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x25, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e,
0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x57,
0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x2e, 0x70,
0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c,
0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31,
0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c,
0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x57, 0x69, 0x74, 0x68,
0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x4f, 0x0a, 0x15, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47,
0x72, 0x6f, 0x75, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f,
0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70,
0x62, 0x2e, 0x52, 0x50, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x12, 0x59, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e,
0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47,
0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62,
0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53,
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x25, 0x66, 0x69, 0x6e, 0x64, 0x41,
0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f,
0x75, 0x70, 0x73, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64,
0x12, 0x30, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x57, 0x69,
0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x31, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45,
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73,
0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x15, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e,
0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x20,
0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72,
0x6f, 0x75, 0x70, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
0x12, 0x59, 0x0a, 0x14, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e,
0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69,
0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72, 0x6f,
0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x46,
0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x47, 0x72,
0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -581,8 +580,7 @@ var file_service_node_group_proto_goTypes = []interface{}{
(*FindEnabledNodeGroupRequest)(nil), // 7: pb.FindEnabledNodeGroupRequest
(*FindEnabledNodeGroupResponse)(nil), // 8: pb.FindEnabledNodeGroupResponse
(*NodeGroup)(nil), // 9: pb.NodeGroup
(*RPCUpdateSuccess)(nil), // 10: pb.RPCUpdateSuccess
(*RPCDeleteSuccess)(nil), // 11: pb.RPCDeleteSuccess
(*RPCSuccess)(nil), // 10: pb.RPCSuccess
}
var file_service_node_group_proto_depIdxs = []int32{
9, // 0: pb.FindAllEnabledNodeGroupsWithClusterIdResponse.groups:type_name -> pb.NodeGroup
@@ -594,10 +592,10 @@ var file_service_node_group_proto_depIdxs = []int32{
6, // 6: pb.NodeGroupService.updateNodeGroupOrders:input_type -> pb.UpdateNodeGroupOrdersRequest
7, // 7: pb.NodeGroupService.findEnabledNodeGroup:input_type -> pb.FindEnabledNodeGroupRequest
1, // 8: pb.NodeGroupService.createNodeGroup:output_type -> pb.CreateNodeGroupResponse
10, // 9: pb.NodeGroupService.updateNodeGroup:output_type -> pb.RPCUpdateSuccess
11, // 10: pb.NodeGroupService.deleteNodeGroup:output_type -> pb.RPCDeleteSuccess
10, // 9: pb.NodeGroupService.updateNodeGroup:output_type -> pb.RPCSuccess
10, // 10: pb.NodeGroupService.deleteNodeGroup:output_type -> pb.RPCSuccess
5, // 11: pb.NodeGroupService.findAllEnabledNodeGroupsWithClusterId:output_type -> pb.FindAllEnabledNodeGroupsWithClusterIdResponse
10, // 12: pb.NodeGroupService.updateNodeGroupOrders:output_type -> pb.RPCUpdateSuccess
10, // 12: pb.NodeGroupService.updateNodeGroupOrders:output_type -> pb.RPCSuccess
8, // 13: pb.NodeGroupService.findEnabledNodeGroup:output_type -> pb.FindEnabledNodeGroupResponse
8, // [8:14] is the sub-list for method output_type
2, // [2:8] is the sub-list for method input_type
@@ -758,13 +756,13 @@ type NodeGroupServiceClient interface {
// 创建分组
CreateNodeGroup(ctx context.Context, in *CreateNodeGroupRequest, opts ...grpc.CallOption) (*CreateNodeGroupResponse, error)
// 修改分组
UpdateNodeGroup(ctx context.Context, in *UpdateNodeGroupRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error)
UpdateNodeGroup(ctx context.Context, in *UpdateNodeGroupRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 删除分组
DeleteNodeGroup(ctx context.Context, in *DeleteNodeGroupRequest, opts ...grpc.CallOption) (*RPCDeleteSuccess, error)
DeleteNodeGroup(ctx context.Context, in *DeleteNodeGroupRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 查询所有分组
FindAllEnabledNodeGroupsWithClusterId(ctx context.Context, in *FindAllEnabledNodeGroupsWithClusterIdRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeGroupsWithClusterIdResponse, error)
// 修改分组排序
UpdateNodeGroupOrders(ctx context.Context, in *UpdateNodeGroupOrdersRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error)
UpdateNodeGroupOrders(ctx context.Context, in *UpdateNodeGroupOrdersRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 查找单个分组信息
FindEnabledNodeGroup(ctx context.Context, in *FindEnabledNodeGroupRequest, opts ...grpc.CallOption) (*FindEnabledNodeGroupResponse, error)
}
@@ -786,8 +784,8 @@ func (c *nodeGroupServiceClient) CreateNodeGroup(ctx context.Context, in *Create
return out, nil
}
func (c *nodeGroupServiceClient) UpdateNodeGroup(ctx context.Context, in *UpdateNodeGroupRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) {
out := new(RPCUpdateSuccess)
func (c *nodeGroupServiceClient) UpdateNodeGroup(ctx context.Context, in *UpdateNodeGroupRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.NodeGroupService/updateNodeGroup", in, out, opts...)
if err != nil {
return nil, err
@@ -795,8 +793,8 @@ func (c *nodeGroupServiceClient) UpdateNodeGroup(ctx context.Context, in *Update
return out, nil
}
func (c *nodeGroupServiceClient) DeleteNodeGroup(ctx context.Context, in *DeleteNodeGroupRequest, opts ...grpc.CallOption) (*RPCDeleteSuccess, error) {
out := new(RPCDeleteSuccess)
func (c *nodeGroupServiceClient) DeleteNodeGroup(ctx context.Context, in *DeleteNodeGroupRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.NodeGroupService/deleteNodeGroup", in, out, opts...)
if err != nil {
return nil, err
@@ -813,8 +811,8 @@ func (c *nodeGroupServiceClient) FindAllEnabledNodeGroupsWithClusterId(ctx conte
return out, nil
}
func (c *nodeGroupServiceClient) UpdateNodeGroupOrders(ctx context.Context, in *UpdateNodeGroupOrdersRequest, opts ...grpc.CallOption) (*RPCUpdateSuccess, error) {
out := new(RPCUpdateSuccess)
func (c *nodeGroupServiceClient) UpdateNodeGroupOrders(ctx context.Context, in *UpdateNodeGroupOrdersRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.NodeGroupService/updateNodeGroupOrders", in, out, opts...)
if err != nil {
return nil, err
@@ -836,13 +834,13 @@ type NodeGroupServiceServer interface {
// 创建分组
CreateNodeGroup(context.Context, *CreateNodeGroupRequest) (*CreateNodeGroupResponse, error)
// 修改分组
UpdateNodeGroup(context.Context, *UpdateNodeGroupRequest) (*RPCUpdateSuccess, error)
UpdateNodeGroup(context.Context, *UpdateNodeGroupRequest) (*RPCSuccess, error)
// 删除分组
DeleteNodeGroup(context.Context, *DeleteNodeGroupRequest) (*RPCDeleteSuccess, error)
DeleteNodeGroup(context.Context, *DeleteNodeGroupRequest) (*RPCSuccess, error)
// 查询所有分组
FindAllEnabledNodeGroupsWithClusterId(context.Context, *FindAllEnabledNodeGroupsWithClusterIdRequest) (*FindAllEnabledNodeGroupsWithClusterIdResponse, error)
// 修改分组排序
UpdateNodeGroupOrders(context.Context, *UpdateNodeGroupOrdersRequest) (*RPCUpdateSuccess, error)
UpdateNodeGroupOrders(context.Context, *UpdateNodeGroupOrdersRequest) (*RPCSuccess, error)
// 查找单个分组信息
FindEnabledNodeGroup(context.Context, *FindEnabledNodeGroupRequest) (*FindEnabledNodeGroupResponse, error)
}
@@ -854,16 +852,16 @@ type UnimplementedNodeGroupServiceServer struct {
func (*UnimplementedNodeGroupServiceServer) CreateNodeGroup(context.Context, *CreateNodeGroupRequest) (*CreateNodeGroupResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateNodeGroup not implemented")
}
func (*UnimplementedNodeGroupServiceServer) UpdateNodeGroup(context.Context, *UpdateNodeGroupRequest) (*RPCUpdateSuccess, error) {
func (*UnimplementedNodeGroupServiceServer) UpdateNodeGroup(context.Context, *UpdateNodeGroupRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeGroup not implemented")
}
func (*UnimplementedNodeGroupServiceServer) DeleteNodeGroup(context.Context, *DeleteNodeGroupRequest) (*RPCDeleteSuccess, error) {
func (*UnimplementedNodeGroupServiceServer) DeleteNodeGroup(context.Context, *DeleteNodeGroupRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteNodeGroup not implemented")
}
func (*UnimplementedNodeGroupServiceServer) FindAllEnabledNodeGroupsWithClusterId(context.Context, *FindAllEnabledNodeGroupsWithClusterIdRequest) (*FindAllEnabledNodeGroupsWithClusterIdResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledNodeGroupsWithClusterId not implemented")
}
func (*UnimplementedNodeGroupServiceServer) UpdateNodeGroupOrders(context.Context, *UpdateNodeGroupOrdersRequest) (*RPCUpdateSuccess, error) {
func (*UnimplementedNodeGroupServiceServer) UpdateNodeGroupOrders(context.Context, *UpdateNodeGroupOrdersRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeGroupOrders not implemented")
}
func (*UnimplementedNodeGroupServiceServer) FindEnabledNodeGroup(context.Context, *FindEnabledNodeGroupRequest) (*FindEnabledNodeGroupResponse, error) {