Code Monkey home page Code Monkey logo

cb-ladybug's Introduction

Cloud-Barista

Release Version Pre Release Version License Slack

The Cloud-Barista is a Multi-Cloud Service Platform SW.

Cloud-Barista consists of multiple frameworks (sub-systems) to accommodate microservice-like architecture.

Please take a look Cloud-Barista Website for a detail decription.

Note for developing and using Cloud-Barista

Development stage of Cloud-Barista

Cloud-Barista is currently under development. (not v1.0 yet)
We welcome any new suggestions, issues, opinions, and controbutors !
Please note that the functionalities of Cloud-Barista are not stable and secure yet.
Becareful if you plan to use the current release in production.
If you have any difficulties in using Cloud-Barista, please let us know.
(Open an issue or Join the Cloud-Barista Slack)

This repository is an integrated archive for repository of major frameworks. These repositories are included and listed in the root directory. This repo reflects the latest release only.

Main frameworks or tools are as follow,

[Note] CB-Larva is a special repository that incubates (research and develop) new Multi-Cloud technologies. CB-Larva explores interesting ideas and shows the possibility of those (i.e., Proof of Concept (POC)). That's why we encourage you to take a look and contribute to the special repository. Please note that the source code of CB-Larva would not be released and archived in this repository for the time being.


[목 차]

  1. 실행 환경
  2. 설치 및 실행
  3. 사용 방법 및 예시
  4. API 및 문서
  5. 특이 사항

[실행 환경]

  • Linux (추천: Ubuntu v22.04)

[설치 및 실행]


[사용 방법 및 예시]

주요 서비스: 멀티 클라우드 인프라 서비스 (MCIS)


[API 및 문서]


[특이 사항]

  • 개발 단계: 기능 개발 우선 단계 (상용 활용시 안정화 및 보완 필요)
  • CSP 연동 검증 상태
    • CB-Spider 기준 테스트 완료된 CSP: 링크 1링크 2 참고
    • CB-Tumblebug 기준 테스트 완료된 CSP: 링크 참고
    • 현재는 개발 단계이므로 기능 안정성은 낮을 수 있음 (버그 리포트 기여 환영합니다!)

cb-ladybug's People

Contributors

dependabot[bot] avatar itnpeople avatar jihoon-seo avatar jmleefree avatar jongwooo avatar joowons avatar seokho-son avatar sykim-etri avatar vlatte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cb-ladybug's Issues

Specify external module (cf. NetworkCNI) version

  • version: pre-release v0.3.5 이후 ~ release v0.4.0

현재 CB-Ladybug에서 사용 중인 NetworkCNI인 canal과 kilo의 경우 main 또는 master 브랜치의 yaml 파일들을 기반으로 설치되어 사용되고 있습니다. 그러다보니 PR #63 과 같이 해당 CNI의 변경 사항 발생으로 인해 K8s 클러스터가 전체적으로 동작하지 않을 가능성이 높은 상황입니다. 따라서 외부 모듈 사용시 특정 버전을 사용하도록 개선하는 것이 필요합니다.

단기적으로는 특정 버전이나 브랜치의 내용을 바로 읽도록 하고, 중장기적으로는 설정 파일 등을 통해 사용자가 변경할 방법이 있으면 좋겠습니다.

Support user defined port number and change default port number (1470)

현재 REST API 접속 포트 번호로 8080번을 사용하는 것으로 확인됩니다. 8080번의 경우 외부에서 포트 스캔이 자주 발생하는 번호라고 합니다. 따라서 다른 번호로 변경하는 것이 필요합니다.
임의로 할당한 1470번을 사용하시면 좋겠고, 해당 포트는 사용자가 필요에 따라 변경할 수 있도록 하는 조치도 필요할 것으로 생각됩니다.

Implement "AMI" by region on AWS

  • AWS 대상 리전별 AMI 확대 필요
    • AWS는 리전별 AMI(이미지) 가 상이
    • 현재는 일본 리전만 반영되어 있음
    • 16/20 개 리전 반영 예정
  • 참고 - 대상 AMI
    • Public
    • AMI 이름 : ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20200908
    • 소유자:099720109477

Read node's Kubernetes labels on each node

  • MCAS에서 사용자가 요청하는 서비스 지역에 대한 근거리 서비스 배포/운영 등을 위해 노드의 레이블 정보를 활용할 예정임

  • MCKS를 통해 구축된 클러스터에 포함된 각 노드에 현재 설정된 쿠버네티스상의 CSP, Region, Zone 레이블 정보를 확인할 방안이 필요함

  • 제공 방법(안)

    • 클러스터 생성이나 노드 정보 요청시 응답에 포함된 노드 정보에 관련 내용을 포함하여 응답
      • model.Node 확장(.cspLabel,.regionLabel,.zoneLabel 등)
      • 저장 데이터 형식: “label key=label value“

What action is needed when failing to delete a cluster

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)

Implement API that provides VM specs that can be deployed and operated by CSP

CSP별 배포 및 운영이 가능한 VM 사양 제공 기능

URL spec

  • [GET] /mcks/mcir/connections/:connectionname/specs
  • output
{
  "kind": "SpecList"
  "items": [
    {
      "name": "string",
      "cpu": {
        clock: "string",
        count: "string"
     },
     "memory": "string",
     "gpu": {
       "mfr": "string",
       "count": "string",
       "memory": "string",
       "modedl": "string"
      }
    }
  ]
}
  • 제한 rule 및 조회 조건 검토
    • min : 2 cpu / 2 GB memory

Development Guide for supporting new CSP

CB-Spider와 CB-Tumblebug에서 새로운 CSP를 지원할 때 MCKS의 신규 멤버가 이를 지원할 수 있도록 개발 가이드 문서가 있으면 많은 도움이 될 것입니다.

Support kubernetes addon management

제공 Add-ons

  • weave-scope v1.13.2
    • Monitoring, visualisation & management for Docker & Kubernetes
  • metrics-server v0.5.2
    • Scalable and efficient source of container resource metrics for Kubernetes built-in autoscaling pipelines
  • dashboard v2.4.0
    • General-purpose web UI for Kubernetes clusters

API 추가

List Addons

  • [GET] /ns/:namespace/clusters/:cluster/addons
{
  "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"
    }
  ]
}

Get Addon

  • [GET] /ns/:namespace/clusters/:cluster/addons/:addon
{
  "kind": "Addon",
  "name": "weave-scope",
  "version": "1.13.2",
  "status": "enabled"
}

Install Addon

*[POST] /ns/:namespace/clusters/:cluster/addons/:addon

    {
      "kind": "Addon",
      "name": "weave-scope",
      "version": "1.13.2",
      "status": "enabled"
    }
    # or
    {
      "message": "already installed"
    }

Uninstall Addon

  • [DELETE] /ns/:namespace/clusters/:cluster/addons/:addon
{
  "code": 1,
  "kind": "Addon",
  "message": "weave-scope has been uninstalled"
}

Add more detailed information(swagger) for APIs

CB-Ladybug 사용자인 CB-webtool과 논의를 진행하다 보니 현재 CB-Ladybug REST API에 대한 설명 자료가 다소 부족하게 느끼고 있습니다.
Swagger를 통해서 제공하는 API의 전체 목록이나 파라미터 형태 등 전체적인 윤곽을 파악하기는 유용하지만 실제 사용하려면 보다 자세한 정보가 필요한 것으로 파악됩니다.

Swagger 관련하여 조금 찾아보니 몇 가지 방법을 통해서 앞서 언급한 어려움을 다소 완화할 수 있을 것으로 생각됩니다.

  1. swagger 포맷에서 해당 API의 @param에 더 구체적인 설명을 작성합니다.
# 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]
  1. swagger 포맷에서 {object} 형태인 경우 아래와 같이 해당 필드에 example 프로퍼티를 추가하여 부연 설명을 작성합니다.
# 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"`
}

검토 부탁드립니다.

Creating a cluster, [PANIC RECOVER] is occurred.

클러스터 생성 도 중 중단한 적이 있어서 그런지 모르겠지만, 아래와 같이 클러스터 생성할 때 패닉이 발생합니다.(관련 로그 참조)
모든 자원 삭제 후 다시 시도할 예정입니다만 원인 분석이 필요해 보입니다.

  • 실행 명령
$ ./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

refactor: create a cluster api structure

  • Create a Cluster API Request 구조를 아래와 같이 개선
  • 문서 WIKI 수정
  • AS-IS
{
  "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"
    }
  ]
}
  • TO-BE
{
  "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"
      }
    }
  ]
}

feature: Manage multi-cloud capabilities of each region for provisioning a cluster correctly

멀티 클라우드 환경에서의 정상적인 클러스터 운용을 위해서는 각 VM별로 필수적으로 동작해야 하는 기능이 있는데, 일부 리전의 경우 이러한 기능이 제공되었다 안되었다 하는 변경이 발생합니다.
예를 들어 최근 테스트(2020.10.)에 의하면 GCP 서울 리전에서 vNic을 생성하여 Public IP를 할당한 후 외부 도메인(ex. google 도메인)에 접속이 불가했습니다.. 지난 테스트(2020.06.)에서는 동일한 문제가 발생하지 않았었습니다.
따라서 멀티 클라우드 환경에서의 운용을 위해 리전별 필수 기능의 가용 여부를 기록 관리할 필요가 있습니다. 예를 들어 CB-Spider처럼 특정 저장소(ex. 구글시트)에 각 리전별 필수 기능의 가용 여부를 기록 관리하는 방법이 있을 수 있습니다.

Prepare for Release

  • README 현행화
  • Demo shell script 추가
  • ChangeLog 작성
  • API 문서 오타 수정

feat : persistent IP alias configuration

bootstrap 개선 건
노드 리부팅시 public-ip 변경에 대한 대응 작업
public-ip 의 ip alias 를 재 정의하고 kubelet 및 설치된 network cni 설정 정보를 업데이트
reboot 시 systemd 활용하여 적용

Error handling when getting a ssh handshake failure error

버전: 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"}

GCP "Project name" -> "Project ID"

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

  • Source version or branch:
  • OS:
  • Others:

Proposed solution
:

Any other context
:

Support user defined ssh public key

  • 클러스터나 노드 생성 후 관리자의 ssh public key를 등록하여 노드 접근성 개선

    • 관리 필요에 따라 관리자가 각 노드에 손쉽게 접근할 수 있는 방안이 필요
  • 제공 방법(안)

    • 클러스터 생성이나 노드 생성시 파라미터에 임의의 ssh public key 정보를 입력

Worker nodes' status changes to `NotReady`

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)
:

  1. 로컬 개발 환경에 minikube K8s 클러스터 생성
  2. cb-operator로 Cloud-Barista 실행
  3. 실행된 Cloud-Barista 의 CB-Ladybug을 이용하여 AWS+GCP에 K8s 클러스터 생성 ("인셉션")

Anything else we need to know?
:

Environment

  • Source version or branch:
  • OS:
  • Others:

Proposed solution
:

Any other context
:

Question about "${HOME}/.aws/credentials" format

./docs/test/env.sh 등에서 "${HOME}/.aws/credentials"를 사용하는 것으로 파악됩니다. 스크립트를 보면 대략적으로 작성할 수는 있는데, 혹시 AWS에서 제공하는 credentials 파일인가요?
제가 테스트를 위해 AWS를 통해서 다운로드한 파일은 .csv 형식의 파일이라서 형식이 좀 다릅니다.

Duplicated private-ip problem on multiple regions

  • 멀티 리전를 가진 클러스터에서 사설IP 중복으로 인한 Network-CNI 플러그인 오류 (Canal)

$ 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

Error occurs while running `./cluster-create.sh`

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

  • Source version or branch:
  • OS:
  • Others:

Proposed solution
:

Any other context
:

Location of Swagger doc files

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/

[영향을 미치기 때문에 추가로 변경해야 하는 곳들의 후보]

Change 'Create a Cluster' REST API convention like cb-tumblebug

현재 cb-tumblebug 방식(일반적인 REST API convention)과 유사하게 신규 클러스터 생성시 POST /ns/{namespace}/clusters/{cluster} 보다는 POST /ns/{namespace}/clusters로 하고 이름은 body로 전달하는 것이 바람직할 것으로 생각됩니다.

Move common const var in test scripts to one file

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"

등의 라인이 반복적으로 존재합니다.

  • Ladybug Endpoint URL 은 한 테스트 세션 내에서는 일정하게 유지되는 것이 보통일 것이므로
  • 각 테스트 스크립트 파일에 존재하면, 수정이 필요할 시 모든 테스트 스크립트 파일을 수정해야 하므로
  • ...

각 테스트 스크립트 파일에 존재하는 것 보다는
하나의 파일에 모아 놓는 것이 좋을 것 같습니다.

Why is this needed
:

Proposed solution
:
PR #48 에서 docs/test/conf.env 이 추가될 예정이므로
위의 라인들을 docs/test/conf.env 파일로 옮기고
각 테스트 스크립트 파일에서는 source ./conf.env 하여 해당 변수 read

Need to cleanup all kubernetes' resources when deleting a cluster

  • Version: 0.6.0
  • 현재 클러스터 삭제시 단순히 관련 VM 인스턴스들을 삭제하고 있는 것으로 보입니다. 쿠버네티스를 통해 생성되는 CSP 연계 자원들도 있을 수 있기에 관련 VM 인스턴스들을 삭제하기 전 쿠버네티스 자원들을 삭제하는 단계가 필요하다고 판단됩니다.
  • kubectl delete all --all 등의 명령을 수행하면 될 것 같긴 한데, 혹 관련 경험이 있으신 분 계신가요?
  • 참조: https://stackoverflow.com/questions/47128586/how-to-delete-all-resources-from-kubernetes-one-time

Add label and description fields in some clusterAPIs

  • MCKS의 관리 주체에 따른 구분 방안이 필요

    • CB-MCKS/CB-TB 간의 MCIS와 유사 이슈 존재 (현재 MCIS의 경우 mcis.label을 활용)
    • CB-Ladybug에서 MCAS 용으로 생성한 MCKS를 구분하여 관리할 수 있는 방안이 필요
  • 제공 방법(안)

    • 클러스터 생성 API에 label 등 신규 항목 추가
    • 클러스터 조회 API에 label로 필터링하여 조회하는 기능 추가
    • 클러스터 description, label 등을 임의로 설정할 수 있는 API 신규 추가
  • 기타 항목 추가(안)

    • MCIS와 유사한 description, createdTime 등 추가

Improve conn-config-registering procedure

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 정보를 기록해 놓았습니다.
    AWS를 예로 들면, 총 21개의 리전을 기록해 놓았습니다.
    사용자가 테스트 스크립트를 사용할 때, ./create-vNet.sh aws 2 jhseo 라고 명령을 내리면
    conf.env 에서 AWS 부분의 2번째 위치에 있는 Canada (Central) 리전을 사용하는 것입니다.
  • credentials.conf.example: 사용자가 이 파일을 복사하여 credentials.conf 파일을 만들고
    여기에 credential 관련 정보를 적어 놓으면
    사용자가 ./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 등록할 때, AWS 등록할 때, Azure 등록할 때 매번 업데이트 해 주어야 합니다.
  • 실행 순서에 유의해야 합니다.

이를
GCP 관련 env var 에는 GCP_ 라는 prefix 를 붙이는 식으로 CSP 별로 구분하고
파일로 만든 다음 (예: cloud-connection-info.env)
사용자가 이 파일을 업데이트하도록 하고
./connectioninfo-create.sh 파일 실행 시 cloud-connection-info.env 에 있는 환경변수를 읽도록 하는
방안이 있을 수 있습니다.

Support user defined disk volume size when creating a cluster or nod

  • 클러스터나 노드 생성시 스펙뿐만 아니라 디스크 용량 설정 지원

    • 내부 디스크 부족에 따른 오류 발생 가능성이 있는 상황
    • 사용자가 노드의 디스크 볼륨 사이즈를 지정할 수 있도록 API 개선 필요
  • 제공 방법(안)

    • 클러스터 생성이나 노드 생성시 각 노드의 디스크 용량 정보 포함
    • 용량을 지정하지 않는 경우 등의 경우 기본 사이즈로 생성 지원 등

When deleting a cluster, cb-ladybug does not delete some MCIRs(vpc, sshkey, firewall, ...)

클러스터를 하나 생성한 후 해당 클러스터를 삭제하고 나면 더 이상 사용되지 않는 VPC와 ssh key 등이 그대로 남아있는 현상이 있었습니다. 그러다 보니 다시 클러스터를 생성할 때 동일한 ssh key가 존재하면서 생성에 실패한 바 있습니다.(aws-northeast-2)

클러스터 생성시 VPC나 ssh key 등이 없는 경우 새로 생성하고 있는데 CB-Ladybug가 생성했던 자원이라면 클러스터 삭제시 이를 확인하여 불필요한 자원인 경우 삭제하는 것이 바람직할 것으로 보입니다.

간단히 생각했을때 꼬이는 부분이 있을 것으로 예상됩니다만 검토를 부탁드립니다.

Only use CB-Tumblebug APIs (not CB-Spider)

  • 2021/04/15 회의에서 CB-Ladybug에서는 CB-Tumblebug API만을 사용하는 것이 바람직한 것으로 논의가 되었습니다.
  • 현재 단순히 확인하는 용도로 사용 중인 것으로 보이는 CB-Spider API(GET)나 원격 명령 실행을 위한 패키지(vm-ssh) 등을 사용하지 않고 CB-Tumblebug에서 제공하는 API를 사용하도록 개선하는 것이 좋겠습니다.

refactor: refactoring source code

  • 로그처리 개선
  • Model 소스 개선
  • 유닛 테스트 코드 추가
  • 시작 파라메터, 환경변수 개선
  • REAME, 테스트 shell 현행화
  • 소스 가독성 개선
  • Validation 로직 추가

Handling when MCIS status is 'Failed'

What happened
: 실제 MCIS 생성이 실패하였으나 POST가 성공하였기에 정상 처리로 인식하여 클러스터 생성을 계속 진행하면서 오류가 발생하고 있으니 검토가 필요합니다.

https://github.com/cloud-barista/cb-mcks/blob/bc6cf2bc6a81ce21e5f680a7eac9ad737101085e/src/core/service/cluster.go#L175-L180

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

  • Source version or branch: v0.6.4@master

feat : control-plane high availability

고가용성을 위한 control-plane high availability 구성
haproxy 를 활용한 kubernetes api-server loadbalancing
multi-CSP 지원 및 api spec 변경

Command-line option enhancement

사용성 문제점

  • yaml/json 포멧 제공되나 EOF, 파일패스, URL을 통한 값 지정 방법을 지원하지 않음
  • 클러스터 생성, 노드 추가 시 --cluster 옵션만을 지원, 클러스터 생성, 노드 추가 명령에서 json, yaml 포멧으로만 실행 가능
  • mandatory 옵션(--config, --ns)을 명령줄에 항상 기입하는 문제
  • git clone 빌드를 통해 cli 사용
  • 클러스터의 Kubeconfig 를 클러스터 정보 조회 후 북사 붙여넣는 수동 방식만 가능

개선내용

--config 옵션

  • Not required.
  • 기본 config 파일 운용 ${HOME}/.cbaadm
  • 없을 경우 config 파일 자동생성
  • 환경변수 지정 기능

--ns 옵션

  • 환경변수 지정 기능
  • config 구조에 ns 속성 추가 가능 여부 검토 후 결과에 따라 구현

subcommand 구조변경

  • subcommand 대상 object(cluster,node)에서 action (create, delete, get) 으로 변경, 아래 예 참조
# 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 명령

  • cluster 생성
$ 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 명령

  • cluster 목록 조회
$ cbadm get cluster
  • cluster 조회
$ cbadm get cluster [ClusterName]
  • node 목록 조회
$ cbadm get node --cluster [ClusterName]
  • node 조회
$ cbadm get node [NodeName] --cluster [ClusterName]

delete 명령

  • cluster 삭제
$ cbadm delete cluster [ClusterName]
  • node 삭제
$ 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 명령

  • 해당 클러스터의 kubeconfig를 로컬 kubeconfig 에 반영
$ cbadm update-kubeconfig [ClusterName]

config 명령

  • 보기 기능만 제공
$ cbadm config view

빌드

  • 빌드 시 CLI 컴파일 및 릴리즈 첨부파일로 자동 추가 여부 검토 및 반영

문서

  • 개선 내용 반영
  • 문서 보강 (user, developer 구분 정리 )
  • 위키 & README (markdown)

기타이슈

  • config 수정 기능은 config 파일 구조 개선이 선행되어야 할 것으로 판단.
  • grpc ?

Empty mcis.VMs[*].Namespace/mcisName After mcis.POST()

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

https://github.com/cloud-barista/cb-mcks/blob/e290f075708ae0038064636e1052596229437cb3/src/core/tumblebug/mcis.go#L58-L60

임시로는 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

  • Source version or branch: master/v0.6.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.