Closed sykim-etri closed 2 months ago
간단하게 아래와 같이 에러를 회피하는 수준에서는 수정할 수 있겠지만 정확한 의미를 파악한 후 개선하는데는 다소 시간이 소요될 것으로 생각됩니다. 혹시 개발하신 분께서 리뷰해주시면 도움이 될 것으로 생각됩니다.
@@ -1769,15 +1778,23 @@ func waitingClusterBaseSecurityGroup(createdClusterIID irs.IID, managedClustersC
sg, err := securityGroupsClient.Get(ctx, clusterManagedResourceGroup, *baseSecurityGroup.Name, "")
if err == nil {
for _, rule := range *sg.SecurityRules {
- if *rule.Priority == 500 && *rule.DestinationPortRange == "80" {
- baseRuleCheck++
- }
- if *rule.Priority == 501 && *rule.DestinationPortRange == "443" {
- baseRuleCheck++
+ if *rule.Priority == 500 || *rule.Priority == 501 {
+ if rule.DestinationPortRange != nil &&
+ (*rule.DestinationPortRange == "80" || *rule.DestinationPortRange == "443") {
+ baseRuleCheck++
+ } else {
+ for _, portRange := range *rule.DestinationPortRanges {
+ if portRange == "80" {
+ baseRuleCheck++
+ } else if portRange == "443" {
+ baseRuleCheck++
+ }
+ }
+ }
}
}
}
- if baseRuleCheck == 2 {
+ if baseRuleCheck >= 2 {
break
}
apiCallCount++
@ish-hcc (cc: @sykim-etri )
추가로 아래 시험 결과도 참고해 주시기 바랍니다.
아래 시험 및 몇 가지 테스트해보면서 느낌은 Azure의 K8S 생성 흐름이 Driver 개발 시점과 많이 변경된 느낌입니다.
관련하여, 대략 현황을 점검해 보신 후 예상 반영 일정 등을 공유 부탁 드립니다.
참고
현재 Azure가 지원하는 default version 1.28.5
로 생성 요청시 timeout 오류
[오후 7:41:31] curl -sX POST http://localhost:1024/spider/cluster -H 'Content-Type: application/json' -d '{ "ConnectionName" : "azure-northeu-config", "ReqInfo" : {"Name" : "spider-cluster-01", "Version" : "1.28.5", "VPCName" : "vpc-01", "SubnetNames" : ["subnet-01"], "SecurityGroupNames" : ["sg-01"], "NodeGroupList": [ {
"Name" : "economy",
"ImageName" : "",
"VMSpecName" : "Standard_B2s",
"KeyPairName" : "keypair-01",
"OnAutoScaling" : "true",
"DesiredNodeSize" : "2",
"MinNodeSize" : "1",
"MaxNodeSize" : "3"
}
] } }'
[오후 8:01:32] ==> {"message":"Failed to Create Cluster. err = failed wait creating BaseRule in Cluster BaseSecurityGroup err = The maximum number of verification requests has been exceeded while waiting for the creation of that resource"}
추가로, 현재 Azure Console에서 생성시 default vm spec으로 요청시 internal server 오류
[오후 7:18:19] curl -sX POST http://localhost:1024/spider/cluster -H 'Content-Type: application/json' -d '{ "ConnectionName" : "azure-northeu-config", "ReqInfo" : {"Name" : "spider-cluster-01","Version" : "1.28.5", "VPCName" : "vpc-01", "SubnetNames" : ["subnet-01"], "SecurityGroupNames" : ["sg-01"], "NodeGroupList": [ {
"Name" : "economy",
"ImageName" : "",
"VMSpecName" : "Standard_D8ds_v5", <===============
"RootDiskType" : "",
"RootDiskSize" : "60",
"KeyPairName" : "keypair-01",
"OnAutoScaling" : "true",
"DesiredNodeSize" : "2",
"MinNodeSize" : "1",
"MaxNodeSize" : "3"
}
] } }'
[오후 7:26:13] ==> {"message":"Failed to Create Cluster. err = containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=500 -- Original Error: Code=\"InternalOperationError\" Message=\"Internal server error\""}
@sykim-etri
Azure (KoreaCentral 리전)에서 클러스터 생성 시도시 nil pointer 접근 에러가 발생하면서 클러스터 생성을 실패합니다.
https://github.com/cloud-barista/cb-spider/blob/c9c6da3ece00615367db3b50572fd216f0e53b2d/cloud-control-manager/cloud-driver/drivers/azure/resources/ClusterHandler.go#L1771-L1778
디버깅을 위해 recover() 코드 삽입으로 에러 라인은 조금 차이가 있을 수 있습니다.
상기 로그에 따르면 securityGroupsClient.Get()의 결과값을 제공하는 방식(DestinationPortRange -> DestinationPortRanges)이 변경된 것 같아 보입니다.
Environment