cloud-barista / cb-ladybug Goto Github PK
View Code? Open in Web Editor NEWCloud-Barista Multi-Cloud Application Runtime Framework : Support Multi-Cloud Kubernetes Service
License: Apache License 2.0
Cloud-Barista Multi-Cloud Application Runtime Framework : Support Multi-Cloud Kubernetes Service
License: Apache License 2.0
What would you like to be enhanced
: Location of Swagger doc files
Why is this needed
: 현재 Swagger docs 는 REST API 에 대해서만 제공되고 있음
Proposed solution
: Move cb-ladybug/src/docs/
to cb-ladybug/src/rest-api/docs/
[영향을 미치기 때문에 추가로 변경해야 하는 곳들의 후보]
CB-Ladybug 사용자인 CB-webtool과 논의를 진행하다 보니 현재 CB-Ladybug REST API에 대한 설명 자료가 다소 부족하게 느끼고 있습니다.
Swagger를 통해서 제공하는 API의 전체 목록이나 파라미터 형태 등 전체적인 윤곽을 파악하기는 유용하지만 실제 사용하려면 보다 자세한 정보가 필요한 것으로 파악됩니다.
Swagger 관련하여 조금 찾아보니 몇 가지 방법을 통해서 앞서 언급한 어려움을 다소 완화할 수 있을 것으로 생각됩니다.
# src/rest-api/router/cluster.go
// CreateCluster
// @Tags Cluster
// @Summary Create Cluster
// @Description Create Cluster
// @ID CreateCluster
// @Accept json
// @Produce json
// @Param namespace path string true "namespace"
// @Param json body model.ClusterReq true "ControlPlane.count를 3개이상 입력하면 ControlPlane이 고가용성을 제공합니다. 등"
// @Success 200 {object} model.Cluster
// @Router /ns/{namespace}/clusters [post]
# src/core/model/request.go
type Kubernetes struct {
NetworkCni string `json:"networkCni" example:"kilo, xxx 등 선택"`
PodCidr string `json:"podCidr" example:"172.168.1.0/24"`
ServiceCidr string `json:"serviceCidr"`
ServiceDnsDomain string `json:"serviceDnsDomain"`
}
검토 부탁드립니다.
Implement Kilo
Kilo
o 테스트 버전: cb-mcks v0.4.3
o 상황:
우연히 아래와 같이 클러스터 삭제가 실패하는 경우가 발생했습니다. 다시 삭제를 요청해도 동일한 에러가 발생합니다.
클러스터 삭제 실패의 경우 대응 방안이 필요해 보입니다.
참고로 최신 버전에서 발생 여부는 확인해보지 못했습니다.
INFO[1151] duration := 8m1.415511172s
INFO[1440] start delete Cluster (name=mcas-cluster)
INFO[1441] terminate MCIS (name=mcas-cluster)INFO[1446] delete MCIS (name=mcas-cluster)
WARN[1447] Tumblebug : statusCode=500, url=http://localhost:1323/tumblebug/ns/lb-ns/mcis/mcas-cluster, body={"message":"MCIS mcas-cluster is Running-3(3/3) and not Terminated/Undefined/Failed, Deletion is not allowed (use option=force for force deletion)"}
INFO[1447] refine mcis (name=mcas-cluster)
INFO[1448] delete MCIS (name=mcas-cluster)
WARN[1449] Tumblebug : statusCode=500, url=http://localhost:1323/tumblebug/ns/lb-ns/mcis/mcas-cluster, body={"message":"MCIS mcas-cluster is Running-3(3/3) and not Terminated/Undefined/Failed, Deletion is not allowed (use option=force for force deletion)"}
ERRO[1449] delete MCIS error : MCIS mcas-cluster is Running-3(3/3) and not Terminated/Undefined/Failed, Deletion is not allowed (use option=force for force deletion)
ERRO[1449] MCIS mcas-cluster is Running-3(3/3) and not Terminated/Undefined/Failed, Deletion is not allowed (use option=force for force deletion)
$ kubectl logs canal-27g5p -n kube-system -c calico-node
2022-01-11 01:09:35.029 [INFO][8] startup/startup.go 396: Early log level set to info
2022-01-11 01:09:35.030 [INFO][8] startup/utils.go 126: Using NODENAME environment for node name w-34-yvbp4
2022-01-11 01:09:35.030 [INFO][8] startup/utils.go 138: Determined node name: w-34-yvbp4
2022-01-11 01:09:35.030 [INFO][8] startup/startup.go 98: Starting node w-34-yvbp4 with version v3.20.0
2022-01-11 01:09:35.031 [INFO][8] startup/startup.go 401: Checking datastore connection
2022-01-11 01:09:35.054 [INFO][8] startup/startup.go 425: Datastore connection verified
2022-01-11 01:09:35.054 [INFO][8] startup/startup.go 108: Datastore is ready
2022-01-11 01:09:35.090 [INFO][8] startup/startup.go 713: Using autodetected IPv4 address on interface eth0: 192.168.1.234/24
2022-01-11 01:09:35.090 [INFO][8] startup/startup.go 530: Node IPv4 changed, will check for conflicts
2022-01-11 01:09:35.123 [WARNING][8] startup/startup.go 1074: Calico node 'c-2-tguu8' is already using the IPv4 address 192.168.1.234.
2022-01-11 01:09:35.123 [WARNING][8] startup/utils.go 48: Terminating
Calico node failed to start
릴리즈별 ChangeLog 작성이 필요합니다.
https://github.com/cloud-barista/cb-tumblebug/blob/main/CHANGELOG.md#v040-cafemocha-20210630
env.sh가 zsh 환경에서는 정상적으로 동작하지 않습니다.
안녕하세요. Cloud-Barista 커뮤니티 차원에서
각 FW 저장소의 Readme 개선에 대한 논의가 있었습니다.
다음 링크를 확인하셔서, Readme 업데이트를 요청드립니다.. ^^
https://github.com/cloud-barista/docs/wiki/Common-badges-for-readme-for-Cloud-Barista-repos
What would you like to be enhanced
:
cb-ladybug/docs/test
아래에 있는 스크립트들에
# const
c_URL_LADYBUG="http://localhost:8080/ladybug"
c_CT="Content-Type: application/json"
등의 라인이 반복적으로 존재합니다.
각 테스트 스크립트 파일에 존재하는 것 보다는
하나의 파일에 모아 놓는 것이 좋을 것 같습니다.
Why is this needed
:
Proposed solution
:
PR #48 에서 docs/test/conf.env
이 추가될 예정이므로
위의 라인들을 docs/test/conf.env
파일로 옮기고
각 테스트 스크립트 파일에서는 source ./conf.env
하여 해당 변수 read
What happened
: 실제 MCIS 생성이 실패하였으나 POST가 성공하였기에 정상 처리로 인식하여 클러스터 생성을 계속 진행하면서 오류가 발생하고 있으니 검토가 필요합니다.
DEBU[0006] [POST] Start to execute a HTTP (url='/ns/cb-mcks-ns/mcis')
DEBU[0043] [cb-mcks-ns.openstack-01] MCIS status is 'Failed:3 (R:0/3)' & vms='[{{c-1-t1fwe cb-mcks-ns} openstack-01 1 config-openstack-regionone config-openstack-regionone-vpc config-openstack-regionone-subnet [config-openstack-regionone-sg] config-openstack-regionone-sshkey config-openstack-regionone-ubuntu1
804 config-openstack-regionone-ds2g-spec cb-user empty Failed {"message":"Failed to startVM err = Request forbidden: [POST http://129.254.188.235/compute/v2.1/servers], error message: {\"forbidden\": {\"code\": 403, \"message\": \"Quota exceeded for cores, instances: Requested 2, 1, but already used 20, 10
of 20, 10 cores, instances\"}}"}
default default { } { {} [] {}}} {{w-1-k619v cb-mcks-ns} openstack-01 config-openstack-regionone config-openstack-regionone-vpc config-openstack-regionone-subnet [config-openstack-regionone-sg] config-openstack-regionone-sshkey config-openstack-regionone-ubuntu1804 config-openstack-regionone-ds2g-spec cb-us
er empty Failed {"message":"Failed to startVM err = failed to Associate PublicIP, err : Resource not found"}
default default { } { {} [] {}}} {{w-2-ad31q cb-mcks-ns} openstack-01 config-openstack-regionone config-openstack-regionone-vpc config-openstack-regionone-subnet [config-openstack-regionone-sg] config-openstack-regionone-sshkey config-openstack-regionone-ubuntu1804 config-openstack-regionone-ds2g-spec cb-us
er empty Failed {"message":"Failed to startVM err = failed to Associate PublicIP, err : Resource not found"}
default default { } { {} [] {}}}]'
INFO[0043] [cb-mcks-ns.openstack-01] MCIS creation has been completed.
...
Environment
멀티 클라우드 환경에서의 정상적인 클러스터 운용을 위해서는 각 VM별로 필수적으로 동작해야 하는 기능이 있는데, 일부 리전의 경우 이러한 기능이 제공되었다 안되었다 하는 변경이 발생합니다.
예를 들어 최근 테스트(2020.10.)에 의하면 GCP 서울 리전에서 vNic을 생성하여 Public IP를 할당한 후 외부 도메인(ex. google 도메인)에 접속이 불가했습니다.. 지난 테스트(2020.06.)에서는 동일한 문제가 발생하지 않았었습니다.
따라서 멀티 클라우드 환경에서의 운용을 위해 리전별 필수 기능의 가용 여부를 기록 관리할 필요가 있습니다. 예를 들어 CB-Spider처럼 특정 저장소(ex. 구글시트)에 각 리전별 필수 기능의 가용 여부를 기록 관리하는 방법이 있을 수 있습니다.
What happened
:
Worker nodes' status remains NotReady.
❯ kubectl get nodes
NAME STATUS ROLES AGE VERSION
cb-sjh1-sjh1-w-1-4k340 NotReady <none> 3h9m v1.18.9 (VM on GCP)
ip-192-168-1-96 Ready master 3h9m v1.18.9 (VM on AWS)
What you expected to happen
:
How to reproduce it (as minimally and precisely as possible)
:
Anything else we need to know?
:
Environment
Proposed solution
:
Any other context
:
현재 CB-Ladybug에서 사용 중인 NetworkCNI인 canal과 kilo의 경우 main 또는 master 브랜치의 yaml 파일들을 기반으로 설치되어 사용되고 있습니다. 그러다보니 PR #63 과 같이 해당 CNI의 변경 사항 발생으로 인해 K8s 클러스터가 전체적으로 동작하지 않을 가능성이 높은 상황입니다. 따라서 외부 모듈 사용시 특정 버전을 사용하도록 개선하는 것이 필요합니다.
단기적으로는 특정 버전이나 브랜치의 내용을 바로 읽도록 하고, 중장기적으로는 설정 파일 등을 통해 사용자가 변경할 방법이 있으면 좋겠습니다.
What happened
:
❯ ./cluster-create.sh cb sjh1
[INFO]
- Namespace is 'cb'
- Cluster name is 'sjh1'
------------------------------------------------------------------------------
(Wait for it...)
{
"message": "copy scripts error (server=13.113.190.119:22, cause=dial tcp 13.113.190.119:22: connect: connection refused)"
}
INFO[5834] Not found data (status=404, method=GET, url=/ns/cb/mcis/sjh1)
INFO[5834] start create vpc (name=aws-ap-northeast-1-vpc)
INFO[5834] Not found data (status=404, method=GET, url=/ns/cb/resources/vNet/aws-ap-northeast-1-vpc)
INFO[5836] create vpc OK.. (name=aws-ap-northeast-1-vpc)
INFO[5836] start create firewall (name=aws-ap-northeast-1-sg)
INFO[5836] Not found data (status=404, method=GET, url=/ns/cb/resources/securityGroup/aws-ap-northeast-1-sg)
INFO[5837] create firewall OK.. (name=aws-ap-northeast-1-sg)
INFO[5837] start create ssh key (name=aws-ap-northeast-1-sshkey)
INFO[5837] Not found data (status=404, method=GET, url=/ns/cb/resources/sshKey/aws-ap-northeast-1-sshkey)
INFO[5837] create ssh key OK.. (name=aws-ap-northeast-1-sshkey)
INFO[5837] AMI find OK (ami='ami-02b658ac34935766f', region='ap-northeast-1')
INFO[5837] start create image (name=aws-ap-northeast-1-ubuntu1804)
INFO[5837] Not found data (status=404, method=GET, url=/ns/cb/resources/image/aws-ap-northeast-1-ubuntu1804)
INFO[5837] create image OK.. (name=aws-ap-northeast-1-ubuntu1804)
INFO[5837] start create spec (name=aws-ap-northeast-1-t2-medium-spec)
INFO[5837] Not found data (status=404, method=GET, url=/ns/cb/resources/spec/aws-ap-northeast-1-t2-medium-spec)
INFO[5837] create spec OK.. (name=aws-ap-northeast-1-t2-medium-spec)
INFO[5837] start create vpc (name=gcp-asia-northeast3-vpc)
INFO[5837] Not found data (status=404, method=GET, url=/ns/cb/resources/vNet/gcp-asia-northeast3-vpc)
INFO[5866] create vpc OK.. (name=gcp-asia-northeast3-vpc)
INFO[5866] start create firewall (name=gcp-asia-northeast3-sg)
INFO[5866] Not found data (status=404, method=GET, url=/ns/cb/resources/securityGroup/gcp-asia-northeast3-sg)
INFO[5871] create firewall OK.. (name=gcp-asia-northeast3-sg)
INFO[5871] start create ssh key (name=gcp-asia-northeast3-sshkey)
INFO[5871] Not found data (status=404, method=GET, url=/ns/cb/resources/sshKey/gcp-asia-northeast3-sshkey)
INFO[5872] create ssh key OK.. (name=gcp-asia-northeast3-sshkey)
INFO[5872] start create image (name=gcp-asia-northeast3-ubuntu1804)
INFO[5872] Not found data (status=404, method=GET, url=/ns/cb/resources/image/gcp-asia-northeast3-ubuntu1804)
INFO[5872] create image OK.. (name=gcp-asia-northeast3-ubuntu1804)
INFO[5872] start create spec (name=gcp-asia-northeast3-n1-standard-2-spec)
INFO[5872] Not found data (status=404, method=GET, url=/ns/cb/resources/spec/gcp-asia-northeast3-n1-standard-2-spec)
INFO[5872] create spec OK.. (name=gcp-asia-northeast3-n1-standard-2-spec)
INFO[5872] start create MCIS (name=sjh1)
INFO[5905] create MCIS OK.. (name=sjh1)
INFO[5905] start k8s bootstrap
WARN[5908] connection test error (server=13.113.190.119:22, cause=dial tcp 13.113.190.119:22: connect: connection refused)
WARN[5908] connection test error (server=13.113.190.119:22, cause=dial tcp 13.113.190.119:22: connect: connection refused)
INFO[5908] start script file copy (vm=sjh1-c-1-50wcy, src=/home/jhseo/go/src/github.com/cloud-barista/cb-ladybug/src/scripts, dest=/tmp)
ERRO[5908] copy scripts error (server=13.113.190.119:22, cause=dial tcp 13.113.190.119:22: connect: connection refused)
WARN[5922] connection test error (server=34.64.173.210:22, cause=dial tcp 34.64.173.210:22: connect: connection refused)
WARN[5922] connection test error (server=34.64.173.210:22, cause=dial tcp 34.64.173.210:22: connect: connection refused)
INFO[5922] start script file copy (vm=sjh1-w-2-3nwzm, src=/home/jhseo/go/src/github.com/cloud-barista/cb-ladybug/src/scripts, dest=/tmp)
WARN[5922] connection test error (server=34.64.155.57:22, cause=ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
WARN[5922] connection test error (server=34.64.155.57:22, cause=ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
INFO[5922] start script file copy (vm=sjh1-w-1-y7kr6, src=/home/jhseo/go/src/github.com/cloud-barista/cb-ladybug/src/scripts, dest=/tmp)
13.113.190.119
에 대해서
WARN[5908] connection test error
가 2번 발생했고
INFO[5908] start script file copy
에서 SSH 접속이 가능해졌다고 판단한 것으로 보이는데
ERRO[5908] copy scripts error (server=13.113.190.119:22
가 발생했습니다.
이로 인해 테스트 스크립트가 에러와 함께 종료되었습니다.
What you expected to happen
:
How to reproduce it (as minimally and precisely as possible)
:
❯ ./cluster-create.sh cb sjh1
Anything else we need to know?
:
Environment
Proposed solution
:
Any other context
:
상기 릴리즈 추진 계획에 따라 CB-Ladybug도 테스트를 수행하고 아래와 같은 시험 결과 작성이 필요합니다.
현재 REST API 접속 포트 번호로 8080번을 사용하는 것으로 확인됩니다. 8080번의 경우 외부에서 포트 스캔이 자주 발생하는 번호라고 합니다. 따라서 다른 번호로 변경하는 것이 필요합니다.
임의로 할당한 1470번을 사용하시면 좋겠고, 해당 포트는 사용자가 필요에 따라 변경할 수 있도록 하는 조치도 필요할 것으로 생각됩니다.
What would you like to be enhanced
:
https://github.com/cloud-barista/cb-ladybug/tree/master/docs/test#cloud-connection-info-%EB%93%B1%EB%A1%9D
에 소개되어 있는
conn config 등록 절차가
사용자 입장에서는 약간 번거로운 측면이 있습니다.
[TB 사례]
conf.env
: 모든 CSP의 region 정보를 기록해 놓았습니다../create-vNet.sh aws 2 jhseo
라고 명령을 내리면conf.env
에서 AWS 부분의 2번째 위치에 있는 Canada (Central)
리전을 사용하는 것입니다.credentials.conf.example
: 사용자가 이 파일을 복사하여 credentials.conf
파일을 만들고./register-cloud.sh
(Spider 에 conn config 등록하는 script) 실행할 때credentials.conf
파일의 내용을 읽어서 Spider에 등록합니다.Why is this needed
:
Proposed solution
:
예를 들어, https://github.com/cloud-barista/cb-ladybug/tree/master/docs/test#cloud-connection-info-%EB%93%B1%EB%A1%9D 에서
REGION
, ZONE
등의 환경변수를 계속 재활용하여 사용하고 있어서
이를
GCP 관련 env var 에는 GCP_
라는 prefix 를 붙이는 식으로 CSP 별로 구분하고
파일로 만든 다음 (예: cloud-connection-info.env
)
사용자가 이 파일을 업데이트하도록 하고
./connectioninfo-create.sh
파일 실행 시 cloud-connection-info.env
에 있는 환경변수를 읽도록 하는
방안이 있을 수 있습니다.
CB-Spider와 CB-Tumblebug에서 새로운 CSP를 지원할 때 MCKS의 신규 멤버가 이를 지원할 수 있도록 개발 가이드 문서가 있으면 많은 도움이 될 것입니다.
CSP별 배포 및 운영이 가능한 VM 사양 제공 기능
URL spec
{
"kind": "SpecList"
"items": [
{
"name": "string",
"cpu": {
clock: "string",
count: "string"
},
"memory": "string",
"gpu": {
"mfr": "string",
"count": "string",
"memory": "string",
"modedl": "string"
}
}
]
}
MCAS에서 사용자가 요청하는 서비스 지역에 대한 근거리 서비스 배포/운영 등을 위해 노드의 레이블 정보를 활용할 예정임
MCKS를 통해 구축된 클러스터에 포함된 각 노드에 현재 설정된 쿠버네티스상의 CSP, Region, Zone 레이블 정보를 확인할 방안이 필요함
제공 방법(안)
bootstrap 개선 건
노드 리부팅시 public-ip 변경에 대한 대응 작업
public-ip 의 ip alias 를 재 정의하고 kubelet 및 설치된 network cni 설정 정보를 업데이트
reboot 시 systemd 활용하여 적용
클러스터를 하나 생성한 후 해당 클러스터를 삭제하고 나면 더 이상 사용되지 않는 VPC와 ssh key 등이 그대로 남아있는 현상이 있었습니다. 그러다 보니 다시 클러스터를 생성할 때 동일한 ssh key가 존재하면서 생성에 실패한 바 있습니다.(aws-northeast-2)
클러스터 생성시 VPC나 ssh key 등이 없는 경우 새로 생성하고 있는데 CB-Ladybug가 생성했던 자원이라면 클러스터 삭제시 이를 확인하여 불필요한 자원인 경우 삭제하는 것이 바람직할 것으로 보입니다.
간단히 생각했을때 꼬이는 부분이 있을 것으로 예상됩니다만 검토를 부탁드립니다.
--cluster
옵션만을 지원, 클러스터 생성, 노드 추가 명령에서 json, yaml 포멧으로만 실행 가능--config
, --ns
)을 명령줄에 항상 기입하는 문제--config
옵션--ns
옵션# cbadm cluster
$ cbadm create cluster ....
$ cbadm get cluster
$ cbadm get cluster cb-cluster
$ cbadm delete cluster cb-cluster
# node
$ cbadm create node --cluster cb-cluster ....
$ cbadm get node --cluster cb-cluster
$ cbadm get node c-1-qv9mn --cluster cb-cluster
$ cbadm delete node c-1-qv9mn --cluster cb-cluster
create
명령$ cbadm create cluster \
--name [ClusterName]\
--control-plane-connection=[ControlPlane ConnctionInfo.Name]\
--control-plane-count=[ControlPlane Count]\
--control-plane-spec=[ControlPlane Machine Spec]\
--worker-connection=[WorkerNode ConnctionInfo.Name]\
--worker-count=[WorkerNode Count]\
--worker-spec=[WorkerNode Machine Spec]
# example
$ cbadm create cluster \
--name "cb-cluster"\
--control-plane-connection="config-aws-tokyo"\
--control-plane-count="1"\
--control-plane-spec="t2.medium"\
--worker-connection="config-aws-tokyo"\
--worker-count="1"\
--worker-spec="t2.medium"
$ cbadm create node \
--cluster [ClusterName]\
--worker-connection=[WorkerNode ConnctionInfo.Name]\
--worker-count=[WorkerNode Count]\
--worker-spec=[WorkerNode Machine Spec]
# example
$ cbadm create node \
--cluster "cb-cluster"\
--worker-connection="config-aws-tokyo"\
--worker-count="1"\
--worker-spec="t2.medium"
get
명령$ cbadm get cluster
$ cbadm get cluster [ClusterName]
$ cbadm get node --cluster [ClusterName]
$ cbadm get node [NodeName] --cluster [ClusterName]
delete
명령$ cbadm delete cluster [ClusterName]
$ cbadm delete node [NodeName] --cluster [ClusterName]
create
명령에서 EOF, 파일패스, URL 형식 지원$ cbadm create node --cluster cb-cluster -f - <<EOF
worker:
- connection: config-aws-tokyo
count: 1
spec: t2.medium
EOF
$ cbadm create node --cluster cb-cluster -f examples/yaml/create-cluster.yaml
$ cbadm create node --cluster cb-cluster -f http://examples.com/examples/yaml/create-cluster.yaml
update-kubeconfig
명령$ cbadm update-kubeconfig [ClusterName]
config
명령$ cbadm config view
버전: 0.4.2 (commit 44fc13e)
"Create Cluster" API 호출시 ssh handshake 실패로 인해 정상적으로 클러스터가 생성되지 않는 경우가 있으며, 이때 동일한 요청을 다시 하면 이미 존재하는 MCIS라고 리턴하고 있습니다. 이러한 경우 처리 방식을 개선할 필요가 있어 보입니다.
아래는 ssh handshake 실패로 클러스터 생성이 실패할 때 에러 메시지입니다.
statusCode=400, url=http://localhost:8080/ladybug/ns/namespace-1/clusters, body={"message":"ssh connection error (server=34.64.234.87:22, cause=ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)"}
이때 현 cb-ladybug의 로그는 다음과 같습니다.
(전체 로그는 아니고 일부 편집된 로그입니다.)
INFO[82868] start k8s bootstrap
WARN[82870] check connectivity error (name=cluster-1-w-2-pfwde, server=34.64.234.87:22, cause=dial tcp 34.64.234.87:22: connect: connection refused)
WARN[82871] check connectivity error (name=cluster-1-w-1-x3ay1, server=18.183.233.1:22, cause=dial tcp 18.183.233.1:22: connect: connection refused)
WARN[82872] check connectivity error (name=cluster-1-w-2-pfwde, server=34.64.234.87:22, cause=dial tcp 34.64.234.87:22: connect: connection refused)
WARN[82873] check connectivity error (name=cluster-1-w-1-x3ay1, server=18.183.233.1:22, cause=dial tcp 18.183.233.1:22: connect: connection refused)
INFO[82874] check connectivity passed (name=cluster-1-w-2-pfwde, server=34.64.234.87:22)
INFO[82874] start script file copy (vm=cluster-1-w-2-pfwde, src=/home/sykim/workspace/cb-ladybug/src/scripts, dest=/tmp)
ERRO[82874] ssh connection error (server=34.64.234.87:22, cause=ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain)
WARN[82875] check connectivity error (name=cluster-1-w-1-x3ay1, server=18.183.233.1:22, cause=dial tcp 18.183.233.1:22: connect: connection refused)
INFO[82877] check connectivity passed (name=cluster-1-w-1-x3ay1, server=18.183.233.1:22)
INFO[82878] end script file copy (vm=cluster-1-w-2-pfwde, server=34.64.234.87:22)
...
INFO[83122] end k8s bootstrap
동일한 요청을 다시 하면 MCIS가 존재하는 것으로 나옵니다.
statusCode=400, url=http://localhost:8080/ladybug/ns/namespace-1/clusters, body={"message":"MCIS already exists"}
v0.4.0 릴리즈를 위해서 자체 시험 스크립트들(https://github.com/cloud-barista/cb-ladybug/tree/master/docs/test/ *)을 현황에 맞게 수정할 필요가 있습니다.
kubectl delete all --all
등의 명령을 수행하면 될 것 같긴 한데, 혹 관련 경험이 있으신 분 계신가요?./docs/test/env.sh 등에서 "${HOME}/.aws/credentials"를 사용하는 것으로 파악됩니다. 스크립트를 보면 대략적으로 작성할 수는 있는데, 혹시 AWS에서 제공하는 credentials 파일인가요?
제가 테스트를 위해 AWS를 통해서 다운로드한 파일은 .csv 형식의 파일이라서 형식이 좀 다릅니다.
아래의 코드와 같이 namespace를 생성할 때 기존 모든 namespace를 지우도록 된 것으로 보입니다.
의도된 것인지 또는 단순 버그인지 검토 부탁드립니다.
What would you like to be enhanced
Proposed solution
클러스터 생성 도 중 중단한 적이 있어서 그런지 모르겠지만, 아래와 같이 클러스터 생성할 때 패닉이 발생합니다.(관련 로그 참조)
모든 자원 삭제 후 다시 시도할 예정입니다만 원인 분석이 필요해 보입니다.
$ ./init.sh AWS
$ ./cluster-create.sh AWS cb-cluster t2.medium 1
$ ./cluster-delete.sh AWS cb-cluster
cb-ladybug | 2020/10/27 04:56:14.853205 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | start create vpc (name=cb-cluster-vpc)
cb-ladybug | 2020/10/27 04:56:14.869633 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | 2020/10/27 04:56:14.872923 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | 2020/10/27 04:56:16.235128 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | create vpc OK.. (name=cb-cluster-vpc)
cb-ladybug | start create firewall (name=cb-cluster-allow-external)
cb-ladybug | 2020/10/27 04:56:16.244341 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | {"connectionName":"cb-aws-config","cspSecurityGroupId":"sg-046b9a9dd62415b50","cspSecurityGroupName":"cb-cluster-allow-external","description":"","firewallRules":[{"direction":"inbound","fromPort":"1","ipProtocol":"udp","toPort":"65535"},{"direction":"inbound","fromPort":"1","ipProtocol":"tcp","toPort":"65535"},{"direction":"inbound","fromPort":"-1","ipProtocol":"icmp","toPort":"-1"},{"direction":"outbound","fromPort":"","ipProtocol":"-1","toPort":""}],"id":"cb-cluster-allow-external","keyValueList":[{"Key":"GroupName","Value":"cb-cluster-vpc-delimiter-cb-cluster-allow-external"},{"Key":"VpcID","Value":"vpc-020211c4acc9b48fa"},{"Key":"OwnerID","Value":"635484366616"},{"Key":"Description","Value":"cb-cluster-vpc-delimiter-cb-cluster-allow-external"}],"name":"cb-cluster-allow-external","vNetId":"cb-cluster-vpc"}
cb-ladybug | create firewall OK.. (name=cb-cluster-allow-external)
cb-ladybug | start create ssh key (name=cb-cluster-sshkey)
cb-ladybug | 2020/10/27 04:56:17.386726 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | 2020/10/27 04:56:17.396895 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | 2020/10/27 04:56:17.831667 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | create ssh key OK.. (name=cb-cluster-sshkey)
cb-ladybug | start create image (name=cb-aws-config-Ubuntu1804)
cb-ladybug | 2020/10/27 04:56:17.838698 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | create image OK.. (name=cb-aws-config-Ubuntu1804)
cb-ladybug | start create control plane spec (name=cb-cluster-spec)
cb-ladybug | 2020/10/27 04:56:17.849151 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | 2020/10/27 04:56:17.853865 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | create control plane spec OK.. (name=cb-cluster-spec)
cb-ladybug | {"time":"2020-10-27T04:56:17.980881481Z","level":"-","prefix":"echo","file":"recover.go","line":"92","message":"[PANIC RECOVER] runtime error: index out of range [0] with length 0 goroutine 60 [running]:\ngithub.com/labstack/echo/v4/middleware.RecoverWithConfig.func1.1.1(0xfa4ba8, 0x1000, 0x0, 0x10a01c0, 0xc00009eb40)\n\t/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/recover.go:77 +0x105\npanic(0xedd1a0, 0xc00029a1a0)\n\t/usr/local/go/src/runtime/panic.go:969 +0x1b9\ngithub.com/cloud-barista/cb-ladybug/src/rest-api/service.CreateCluster(0xc0002ac9d1, 0x10, 0xc0001c3700, 0xc0002ac9d1, 0x10, 0x8)\n\t/usr/src/app/src/rest-api/service/cluster.go:179 +0x4165\ngithub.com/cloud-barista/cb-ladybug/src/rest-api/router.CreateCluster(0x10a01c0, 0xc00009eb40, 0x9, 0xc0002ac9d1)\n\t/usr/src/app/src/rest-api/router/cluster.go:86 +0x3a8\ngithub.com/cloud-barista/cb-ladybug/src/core/common.NsValidate.func1.1(0x10a01c0, 0xc00009eb40, 0x1, 0x1)\n\t/usr/src/app/src/core/common/ns.go:16 +0x186\ngithub.com/labstack/echo/v4.(*Echo).add.func1(0x10a01c0, 0xc00009eb40, 0xf6b6ad, 0x1b)\n\t/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:522 +0x62\ngithub.com/labstack/echo/v4/middleware.CORSWithConfig.func1.1(0x10a01c0, 0xc00009eb40, 0x203000, 0x203000)\n\t/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/cors.go:121 +0x483\ngithub.com/labstack/echo/v4/middleware.RecoverWithConfig.func1.1(0x10a01c0, 0xc00009eb40, 0x0, 0x0)\n\t/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/recover.go:98 +0x142\ngithub.com/labstack/echo/v4/middleware.LoggerWithConfig.func2.1(0x10a01c0, 0xc00009eb40, 0x0, 0x0)\n\t/go/pkg/mod/github.com/labstack/echo/[email protected]/middleware/logger.go:117 +0x130\ngithub.com/labstack/echo/v4.(*Echo).ServeHTTP(0xc00000a1e0, 0x108c060, 0xc000168380, 0xc000164500)\n\t/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:633 +0x182\nnet/http.serverHandler.ServeHTTP(0xc0001680e0, 0x108c060, 0xc000168380, 0xc000164500)\n\t/usr/local/go/src/net/http/server.go:2843 +0xa3\nnet/http.(*conn).serve(0xc0005405a0, 0x108e460, 0xc0001c3540)\n\t/usr/local/go/src/net/http/server.go:1925 +0x8ad\ncreated by net/http.(*Server).Serve\n\t/usr/local/go/src/net/http/server.go:2969 +0x36c\n\ngoroutine 1 [IO wait]:\ninternal/poll.runtime_pollWait(0x7f2ea8c94d58, 0x72, 0x0)\n\t/usr/local/go/src/runtime/netpoll.go:220 +0x55\ninternal/poll.(*pollDesc).wait(0xc000156518, 0x72, 0x0, 0x0, 0xf5a030)\n\t/usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x45\ninternal/poll.(*pollDesc).waitRead(...)\n\t/usr/local/go/src/internal/poll/fd_poll_runtime.go:92\ninternal/poll.(*FD).Accept(0xc000156500, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/usr/local/go/src/internal/poll/fd_unix.go:394 +0x1fc\nnet.(*netFD).accept(0xc000156500, 0x7f2ea8c50ff8, 0x50, 0x50)\n\t/usr/local/go/src/net/fd_unix.go:172 +0x45\nnet.(*TCPListener).accept(0xc00039a260, 0x29e8d60800, 0x0, 0xc000093b10)\n\t/usr/local/go/src/net/tcpsock_posix.go:139 +0x32\nnet.(*TCPListener).AcceptTCP(0xc00039a260, 0x5e94f73da77ae01, 0x0, 0x0)\n\t/usr/local/go/src/net/tcpsock.go:248 +0x65\ngithub.com/labstack/echo/v4.tcpKeepAliveListener.Accept(0xc00039a260, 0xc000093b80, 0x48fa46, 0x5f97a86e, 0x440d2e)\n\t/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:875 +0x2f\nnet/http.(*Server).Serve(0xc0001680e0, 0x108a5e0, 0xc00000ef10, 0x0, 0x0)\n\t/usr/local/go/src/net/http/server.go:2937 +0x266\ngithub.com/labstack/echo/v4.(*Echo).StartServer(0xc00000a1e0, 0xc0001680e0, 0x6, 0xf6d9e3)\n\t/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:724 +0x385\ngithub.com/labstack/echo/v4.(*Echo).Start(...)\n\t/go/pkg/mod/github.com/labstack/echo/[email protected]/echo.go:644\ngithub.com/cloud-barista/cb-ladybug/src/rest-api.Server()\n\t/usr/src/app/src/rest-api/server.go:41 +0x7e8\nmain.main()\n\t/usr/src/app/src/main.go:25 +0x2a\n\ngoroutine 6 [sleep]:\ntime.Sleep(0x77359400)\n\t/usr/local/go/src/runtime/time.go:188 +0xbf\ngithub.com/cloud-barista/cb-log.levelSetupLoop(0xf5f146, 0xd)\n\t/go/pkg/mod/github.com/cloud-barista/[email protected]/cblogger.go:78 +0x5a\ncreated by github.com/cloud-barista/cb-log.setup\n\t/go/pkg/mod/github.com/cloud-barista/[email protected]/cblogger.go:61 +0xf7\n\ngoroutine 7 [select, 2 minutes]:\ngoogle.golang.org/grpc.(*ccBalancerWrapper).watcher(0xc00011d540)\n\t/go/pkg/mod/google.golang.org/[email protected]/balancer_conn_wrappers.go:69 +0xc8\ncrea\n"}
cb-ladybug | {"time":"2020-10-27T04:56:17.98194195Z","id":"","remote_ip":"172.19.0.1","host":"localhost:8080","method":"POST","uri":"/ladybug/ns/cb-aws-namespace/clusters","user_agent":"curl/7.58.0","status":500,"error":"","latency":3129793259,"latency_human":"3.129793259s","bytes_in":185,"bytes_out":36}
cb-ladybug | start delete MCIS (name=cb-cluster)
cb-ladybug | 2020/10/27 04:57:37.927881 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
cb-ladybug | delete MCIS skip (cannot find).. (name=cb-cluster)
cb-ladybug | {"time":"2020-10-27T04:57:37.938121069Z","id":"","remote_ip":"172.19.0.1","host":"localhost:8080","method":"DELETE","uri":"/ladybug/ns/cb-aws-namespace/clusters/cb-cluster","user_agent":"curl/7.58.0","status":200,"error":"","latency":11013851,"latency_human":"11.013851ms","bytes_in":0,"bytes_out":42}
cb-ladybug | start delete MCIS (name=cb-cluster)
cb-ladybug | 2020/10/27 05:00:00.196767 WARN RESTY Using Basic Auth in HTTP mode is not secure, use HTTPS
What happened
: CB-TB에서 subGroup을 제공함에 따라 Control Plane 생성시 이를 활용하도록 수정되었는데,
그러다보니 mcis.VMs[i].Namespace와 mcis.VMs[i].mcisName을 참조할 경우 비어 있는 경우가 발생합니다.
아래 코드에서 mcis.VMs[]를 하나만 생성하여 mcis.POST()를 호출했는데, mcis.VMs[]를 여러 개를 리턴받아서 그런 것으로 추정됩니다.
https://github.com/cloud-barista/cb-mcks/blob/e290f075708ae0038064636e1052596229437cb3/src/core/service/cluster.go#L142-L145
임시로는 mcis.POST() 호출 후 mcis.VMs[i].Namespace와 McisName에 직접 값을 채워넣으면 해소할 수 있습니다만 적당한 방법은 아닌 것 같습니다.--;
for i := 0; i < len(mcis.VMs); i++ {
mcis.VMs[i].Namespace = namespace
mcis.VMs[i].McisName = mcisName
if cluster.CpGroup == mcis.VMs[i].VmGroupId {
provisioner.AppendControlPlaneMachine(mcis.VMs[i].Name, mcir.csp, mcir.region, mcir.zone, mcir.credential)
}
}
어떻게 해결하는 것이 좋은 방법일까요? 의견 부탁드립니다.
How to reproduce it (as minimally and precisely as possible)
: 생성할 Control Plane의 수가 여러 개인 경우 항상 발생
Environment
클러스터나 노드 생성시 스펙뿐만 아니라 디스크 용량 설정 지원
제공 방법(안)
What would you like to be enhanced
:
Why is this needed
:
Proposed solution
:
Ref: Spider-calling method in Tumblebug
현재 cb-tumblebug 방식(일반적인 REST API convention)과 유사하게 신규 클러스터 생성시 POST /ns/{namespace}/clusters/{cluster} 보다는 POST /ns/{namespace}/clusters로 하고 이름은 body로 전달하는 것이 바람직할 것으로 생각됩니다.
{
"kind": "AddonList",
"items": [
{
"kind": "Addon",
"name": "weave-scope",
"version": "1.13.2",
"status": "enabled"
},
{
"kind": "Addon",
"name": "metrics-server",
"version": "0.5.2",
"status": "disabled"
},
{
"kind": "Addon",
"name": "dashboard",
"version": "2.4.0",
"status": "disabled"
}
]
}
{
"kind": "Addon",
"name": "weave-scope",
"version": "1.13.2",
"status": "enabled"
}
*[POST] /ns/:namespace/clusters/:cluster/addons/:addon
{
"kind": "Addon",
"name": "weave-scope",
"version": "1.13.2",
"status": "enabled"
}
# or
{
"message": "already installed"
}
{
"code": 1,
"kind": "Addon",
"message": "weave-scope has been uninstalled"
}
http get 요청 시 body 보내는 부분이 있다면 Query Parameter로 변경 요청.
예) ConnectionName := c.QueryParam("connectionName")
클러스터나 노드 생성 후 관리자의 ssh public key를 등록하여 노드 접근성 개선
제공 방법(안)
고가용성을 위한 control-plane high availability 구성
haproxy 를 활용한 kubernetes api-server loadbalancing
multi-CSP 지원 및 api spec 변경
v0.4.0 릴리즈를 위해서 설계 문서들(https://github.com/cloud-barista/cb-ladybug/tree/master/docs/design/ *)을 현황에 맞게 수정할 필요가 있습니다.
MCKS의 관리 주체에 따른 구분 방안이 필요
제공 방법(안)
기타 항목 추가(안)
What happened
:
https://github.com/cloud-barista/cb-ladybug/tree/master/docs/test#gcp 에
$ export PROJECT="<project name>"
$ export PKEY="<private key>"
$ export SA="<service account email>"
이렇게 되어 있는데
project name
이 아니라
project ID
가 맞을 것 같습니다.
What you expected to happen
:
How to reproduce it (as minimally and precisely as possible)
:
Anything else we need to know?
:
Environment
Proposed solution
:
Any other context
:
{
"config": {
"kubernetes": {
"networkCni": "kilo",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.96.0.0/12",
"serviceDnsDomain": "cluster.local"
}
},
"controlPlane": [
{
"connection": "config-aws-ap-northeast-2",
"count": 3,
"rootDiskSize": "default",
"rootDiskType": "default",
"spec": "t2.medium"
}
],
"description": "string",
"installMonAgent": "no",
"label": "string",
"loadbalancer": "haproxy",
"name": "cluster-01",
"storageclass": {
"nfs": {
"path": "/nfs/data",
"server": "163.154.154.89"
}
},
"worker": [
{
"connection": "config-aws-ap-northeast-2",
"count": 3,
"rootDiskSize": "default",
"rootDiskType": "default",
"spec": "t2.medium"
}
]
}
{
"config": {
"installMonAgent": "no",
"kubernetes": {
"version": "1.23.13",
"networkCni": "canal",
"loadbalancer": "haproxy",
"podCidr": "10.244.0.0/16",
"serviceCidr": "10.96.0.0/12",
"serviceDnsDomain": "cluster.local",
"storageclass": {
"nfs": {
"path": "/nfs/data",
"server": "163.154.154.89"
}
},
}
},
"controlPlane": [
{
"connection": "config-aws-ap-northeast-2",
"count": 3,
"spec": "t2.medium",
"rootDisk": {
"type": "default",
"size": "default"
}
}
],
"description": "string",
"label": "string",
"name": "cluster-01",
"worker": [
{
"connection": "config-aws-ap-northeast-2",
"count": 3,
"spec": "t2.medium",
"rootDisk": {
"type": "default",
"size": "default"
}
}
]
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.