Skip to content
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

[NCPVPC] How do we handle a LB Subnet for NLB and LB Subnet for PMKS? #1262

Open
sykim-etri opened this issue Jul 30, 2024 · 1 comment
Open
Assignees

Comments

@sykim-etri
Copy link
Member

NCPVPC에서 K8s 생성을 위해서 LB Subnet의 지정이 필요합니다. LB Subnet 관련 내용을 살펴보다가 NLB 생성시 LB Subnet을 생성하는 코드가 다음과 같이 있었습니다.
현재는 LB Subnet의 존재 유무만 체크하고 있어서 K8s를 위해 생성한 LB Subnet을 사용할 수도 있어 보입니다. 혹시 NLB용과 K8s용을 각각 구분하는게 좋을지 함께 사용해도 괜찮을지 의견을 부탁 드립니다. LBTypeSubnetDefaultCidr의 크기 등도 영향이 있을 것 같습니다.
@innodreamer (cc: @powerkimhub )

<다음>

// ### In case, there is No Subnet for 'LB Only'('LB Type' subnet), Create the 'LB Type' subnet.
if strings.EqualFold(lbTypeSubnetId, "") {
cblogger.Info("\n# There is No Subnet for 'LB Only'('LB Type' Subnet), so it will be Created.")
// NCP VPC Subnet Name Max length : 30
// LbTypeSubnetDefaultName : "ncpvpc-subnet-for-nlb" => length : 21
lbTypeSubnetName := LbTypeSubnetDefaultName + "-" + randSeq(8)
cblogger.Infof("\n### Subnet Name for LB Type subnet : [%s]", lbTypeSubnetName)
subnetReqInfo := irs.SubnetInfo{
IId: irs.IID{
NameId: lbTypeSubnetName,
},
IPv4_CIDR: cidrForNlbSubnet,
}
// Note : Create a 'LOADB' type of subnet ('LB Type' subnet for LB Only)
ncpNlbSubnetInfo, err := nlbHandler.CreatNcpSubnetForNlbOnly(irs.IID{SystemId: *ncpVPCInfo.VpcNo}, subnetReqInfo) // Waitting time Included
if err != nil {
newErr := fmt.Errorf("Failed to Create the 'LB Type' Subnet : [%v]", err)
cblogger.Error(newErr.Error())
LoggingError(callLogInfo, newErr)
return irs.NLBInfo{}, newErr
}
cblogger.Infof("'LB type' Subnet ID : [%s]", *ncpNlbSubnetInfo.SubnetNo)
lbTypeSubnetId = *ncpNlbSubnetInfo.SubnetNo
}

@sykim-etri
Copy link
Member Author

아직 검토 단계이긴 합니다만
K8s용 LB Subnet은 사용자가 상황에 맞게 활용할 수 있도록 PUBLIC용과 PRIVATE용을 각각 하나씩 생성해서 지정해야 할 것으로 생각하고 있습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants