Provider Managed Kubernetes and Driver API - cloud-barista/cb-spider GitHub Wiki
PMKS(Provider Managed Kubernetes) and Driver API
- CB-Spider PMKS(Provider Managed Kubernetes) Specification V0.6
- ๊ฒํ ์๊ฒฌ: https://github.com/cloud-barista/cb-spider/issues/716
- ์ ๊ณตํํฉ: PMKS ๊ฐ๋ฐ ๋ฐ ์ด์ ํํฉ
1. CB-Spider Kubernetes Cluster Overview
- CB-Spider๋ ์ฐ๋ ๋์ ํด๋ผ์ฐ๋(CSP)๊ฐ ์ ๊ณตํ๋ ๊ด๋ฆฌํ Kubernetes(Provider Managed K8S ๋๋ Managed K8S)๋ฅผ
- ๋์ผํ ์ธํฐํ์ด์ค๋ฅผ ์ฌ์ฉํ์ฌ ์ ์ดํ ์ ์๋ Cluster(Kubernetes Cluster ๋๋ PMKS Cluster) ์ ์ด ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ค.
- K8S๊ฐ ํ์ํ CB-Spider ์ฌ์ฉ์(์ธํ๋ผ ๊ด๋ฆฌ์ ๋๋ ์๋น์ค ๊ฐ๋ฐ์)๋ ์๋ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ด,
- โ CB-Spider ์ธํฐํ์ด์ค๋ฅผ ํ์ฉํ์ฌ ๋์ผํ ๋ฐฉ๋ฒ์ผ๋ก
- ์ํ๋ ๋์ ํด๋ผ์ฐ๋์ K8S ์ธ์คํด์ค ์์ฑ์ ์์ฒญํ ์ ์๋ค.
- โก ์ฌ์ฉ์์ ์์ฒญ์ Spider์ ๋์ ์ฐ๋ ๋๋ผ์ด๋ฒ๋ฅผ ํตํด์
- ๋์ ํด๋ผ์ฐ๋์ API๋ฅผ ํธ์ถํ์ฌ ๋์ ํด๋ผ์ฐ๋์ ๊ด๋ฆฌํ K8S ์ธ์คํด์ค๊ฐ ์์ฑ๋๋ค.
- โข ์ฌ์ฉ์๋ ์์ฑ๋ K8S์ ๋ํ์ฌ K8S CLI(kubectl) ๋๋ API ๋ฑ์ ํ๋ถํ K8S ์ธํฐํ์ด์ค๋ฅผ ์ฌ์ฉํ์ฌ
- ์ฌ์ฉ์์ ์ํฌ๋ก๋๋ฅผ ๋ฐฐํฌ ๋ฐ ๊ด๋ฆฌํ ์ ์๋ค.
- ๋ํ, Lens ๋ฐ Kubesphere์ ๊ฐ์ K8S IDE์ ์ฐ๋ํ์ฌ ์์ฑ๋ K8S์ ๊ธฐ๋ฅ์ ํธ๋ฆฌํ๊ฒ ํ์ฉํ ์๋ ์๋ค.
- โ CB-Spider ์ธํฐํ์ด์ค๋ฅผ ํ์ฉํ์ฌ ๋์ผํ ๋ฐฉ๋ฒ์ผ๋ก
2. CB-Spider PMKS Components
- ์ฌ์ฉ์์ ์ํด ์์ฑ๋ ํ๋์ PMKS ์ธ์คํด์ค๋ ์๋ ๊ทธ๋ฆผ์์ ๋ณด๋ ๋ฐ์ ๊ฐ์ด Cluster๋ผ๊ณ ํ๋ค.
- Cluster๋ ํฌ๊ฒ Control plane, Node Group, Addons ๋ฐ Endpoint๋ก ๊ตฌ์ฑ๋๋ค.
-
์ปดํฌ๋ํธ๋ณ ์ธ๋ถ ๋ด์ฉ์ ๋ค์๊ณผ ๊ฐ๋ค.
(1) ์ปจํธ๋กค ํ๋ ์ธ(Control Plane)
- ์ปจํธ๋กค ํ๋ ์ธ์ Cluster์ ์ ์ฒด ๋์ ๋ฐ ์คํ์ ๊ด์ฅํ๋ ๋ง์คํฐ๋ก์์ ์ญํ ์ ๋ด๋นํ๋ ์ปดํฌ๋ํธ๋ค์ ๋ชจ์์ด๋ฉฐ, - ๊ด๋ฆฌํ K8S์ ๊ฒฝ์ฐ์๋ ์ปจํธ๋กค ํ๋ ์ธ์ ๊ด๋ฆฌ ์ฃผ์ฒด๋ CSP์ Cloud ํ๋ซํผ(CloudOS)์ด๋ฉฐ, - CSP ์ฌ์ฉ์(=CB-Spider ์ฌ์ฉ์)๋ ์ํ ํ์ธ ๋ฐ ์ ์ด๋ฅผ ํ ์ ์๋ค. - ์ฐธ๊ณ ๋ก, Control plane์ kube-apiserver, etcd, kube-scheduler ๋ฐ kube-controller-manager, Cloud Controller Manager ๋ฑ์ผ๋ก ๊ตฌ์ฑ๋๋ค.
(2) ๋ ธ๋ ๊ทธ๋ฃน(Node Group)
- ํ๋์ ๋ ธ๋ ๊ทธ๋ฃน์ ๋์ผํ ์ด๋ฏธ์ง์ ๊ท๊ฒฉ์ผ๋ก ์์ฑ๋ VM๋ค๋ก ๊ตฌ์ฑ๋๋ฉฐ, - ํ๋์ Cluster๋ ์๋ก ๋ค๋ฅธ ์ข ๋ฅ์ ์ฌ๋ฌ ๊ฐ์ ๋ ธ๋ ๊ทธ๋ฃน์ ํฌํจํ ์ ์๋ค. - ์ด์ ๊ฐ์ ์ด์ง์ ์ธ ๋ ธ๋ ๊ทธ๋ฃน ๊ตฌ์ฑ์ ํตํ์ฌ ํ๋์ Cluster์์ ๋ค์ํ ์ข ๋ฅ์ ์ํฌ๋ก๋์ ์คํ ์ค์ ์ด ๊ฐ๋ฅํ๋ค. - ์ฐธ๊ณ ๋ก, Node(=VM)์ ์ปจํธ๋กค ํ๋ ์ธ๊ณผ์ ํ์ ๋ฐ ์ค์ Pod์ ์คํ ์ฒ๋ฆฌ ๋ฑ์ ์ํ์ฌ kubelet, kube-proxy ๋ฐ Container runtime ๋ฑ์ ํฌํจํ๋ค.
(3) ์๋์จ(Addons)
- ์๋์จ์ CNI, DNS ๋ฐ Container Resource Monitoring ๋ฑ์ผ๋ก - Cluster ์์ค์ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ ์ปดํฌ๋ํธ๋ค. - ๋ค์ํ ์๋์จ๋ค์ด ์กด์ฌํ๋ฉฐ, ์ ํ์ ์ผ๋ก ๊ตฌ์ฑํ์ฌ ํ์ฉํ ์ ์๋ค.
(4) ์๋ํฌ์ธํธ(Endpoint)
- ์ธ๋ถ์์ Cluster์ ์ ๊ทผํ ์ ์๋ URL์ ์ ๊ณตํ๋ค.
3. CB-Spider Cluster ํ์
- Cluster ์์ฑ๊ณผ NodeGroup ์ถ๊ฐ ์์์ ๋ฐ๋ผ ๋ค์๊ณผ ๊ฐ์ด 2๊ฐ์ง ํ์ ์ผ๋ก ๊ตฌ๋ถ๋๋ค.
-
(1) Type-I: Cluster ์์ฑ ํ NodeGroup ๋ณ๋ ์ถ๊ฐ/์ญ์
- ๋์ CSP: AWS, Alibaba, Tencent ๋ฑ
-
(2) Type-II: ์ต์ด Cluster ์์ฑ์ ์ต์ 1๊ฐ ์ด์์ NodeGroup์ ํจ๊ป ์์ฑ ์ดํ NodeGroup ์ถ๊ฐ/์ญ์ ๊ฐ๋ฅ
- ๋์ CSP: Azure, GCP, IBM, NHN ๋ฑ
- ์ฐธ๊ณ : CSP๋ณ ํน์ง ๋ฐ ์ ์ฝ ์ฌํญ์ ๋ค์ ์ฐธ๊ณ
- https://docs.google.com/spreadsheets/d/1mPmfnfmyszYimVzplZMzsqO3WsBmOdes/edit#gid=1299745060
- ์ฐธ๊ณ : ๋
ธ๋ ๊ทธ๋ฃน OS๋ก ์ ํ ๊ฐ๋ฅํ ์ด๋ฏธ์ง ๋ชฉ๋ก
- Tencent: ๋ค์ ๋ชฉ๋ก์์
OS Name
์ ImageId๋ก ์ค์
- Tencent: ๋ค์ ๋ชฉ๋ก์์
4. CB-Spider Cluster ์ ๊ณต ํํฉ (CB-Spider v0.9.6 ๊ธฐ์ค)
- ์ ๊ณต ๊ธฐ๋ฅ: Cluster ์์ฑ/์ญ์ , NodeGroup ์ถ๊ฐ/์ญ์ , Kubeconfig ์ ๊ณต ๋ฐ OpenLens ์ฐ๋(=kubectl ํ์ฉ ๊ฐ๋ฅ)
- ๊ฒ์ฆ ํ์ ๊ธฐ๋ฅ: AutoScaling ์ค์ ๋ณ๊ฒฝ, Upgrade (์ ์ฒด ๋๋ ์ผ๋ถ CSP ์ง์, ์ ์ฒด ๊ฒ์ฆ ํ์ํ ๊ธฐ๋ฅ)
- ์ถํ ์ ๊ณต ๊ณ ๋ ค: Addons(๊ตฌํ ์๋จ)
[์ํ ๋ฐฉ๋ฒ]
- (1) CSP๋ณ Version, VMSpec ๋ฑ์ ์
๋ ฅ ์ค์ ๊ฐ์ AdminWeb ์ด๊ธฐ ์ค์ ๊ฐ์ผ๋ก Cluster ๋ฐ NodeGroup ์์ฑ
- โป Notices: AdminWeb์ CSP๋ณ Kubernetes Version ๋ฐ Image ์ ๋ณด ๋ฑ์ CSP์์ Deprecated ๋ ์ ์์ผ๋ฉฐ, ์ด ๊ฒฝ์ฐ ์์ ํ์
- (2) ์์ฑ๋ Cluster์ Kubeconfig ์ ๋ณด๋ฅผ OpenLens์ ๋ฑ๋ก ํ ์ฐ๋/Pod ๋ฐฐํฌ ๋ฑ ํ์ธ
- Cluster ์ฐ๋ ๋ฐ Pod ๋ฐฐํฌ ์ํ ๊ฐ์ด๋: ๋ค์ ์์ ์ค ํด๋น ๋ถ๋ถ ์ฐธ๊ณ
- OpenLens ์ฐ๋ ์ค์ ํน์ด ์ฌํญ: ์ผ๋ถ CSP์ ๊ฒฝ์ฐ ์ธ๋ถ์์ Cluster ์ ๊ทผ์ ๋ค์๊ณผ ๊ฐ์ ์ถ๊ฐ ์ค์ ํ์
โป GCP Note: OpenLens, kubectl ๋ฑ์์ Kubeconfig ํ์ฉํ ์ธ๋ถ ์ ๊ทผ ์ ์ค์ ๋ฐฉ๋ฒ ์ฐธ๊ณ - gcloud ๋ฐ gke-gcloud-auth-plugin ์ฌ์ ์ค์น ํ์ - OpenLens ์ค์น ์ดํ ์ค์น ์์๋ System Reboot ํ์
[์ ๊ณต ํํฉ]
CSP(test region) | AdminWeb ํตํฉ ์ํ | KubeConfig: OpenLens ์ฐ๋ ์ํ | ํน์ด์ฌํญ |
---|---|---|---|
AWS(us-east2) | O | O | * Type-I Cluster * ๊ด๋ จ Role ์ค์ ํ์ * ์๋ก ๋ค๋ฅธ Zone์ 2๊ฐ ์ด์ Subnet ํ์ |
Azure(northeurope) | O | O | * Type-II Cluster * ๊ด๋ จ Role ์ค์ ํ์ * Subnet CIDR ์กฐ๊ฑด: 333 Address ์ด์ โข /24 =256๊ฐ,/23 =510๊ฐ |
GCP(us-central1) | O | O | * Type-II Cluster * GCP Note ์ฐธ๊ณ |
Alibaba(cn-beijing) | O | O | * Type-I Cluster |
Tencent(ap-seoul) | O | O | * Type-I Cluster * ๊ด๋ จ Role ์ค์ ํ์ |
NHNCloud(KR1) | O | O | * Type-II Cluster |
IBM | - | - | * Type-II Cluster * ์ถํ ํตํฉ ์์ (Driver 1์ฐจ ๊ฐ๋ฐ ์๋ฃ) |
5. CB-Spider Cluster Rest API
- Swagger UI: Cluster Management ์ฐธ๊ณ
- โป CSP๋ณ Custer ์์ฑ ๋ฐ NodeGroup ์์ฑ ์ ํ์ ์ธ์๋ AdminWeb ๊ด๋ จ default ์ค์ ๊ฐ ์ฐธ๊ณ
6. ๋๋ผ์ด๋ฒ ๊ฐ๋ฐ ๋ ธํธ
-
PMKS Driver API๋ Async ํธ์ถ ๋ฐฉ์์ผ๋ก ์ ๊ณต
- ์์) CSP Create API ํธ์ถ ํ Running ์ํ ๊ธฐ๋ค๋ฆผ ์์ด Driver API๋ ๋ฐํ
-
Zonal vs Regional ๊ด๋ จ ์ ํ ์ต์ ์ ๊ณตํ๋ ๊ฒฝ์ฐ
- ํ์ฌ๋ Zonal๋ก ์ค์ , Zone ๊ฐ์ Connection์์ ํ๋ ํ ์ ์ฉ
-
Cluster ์์ฑ๊ณผ NodeGroup ์ถ๊ฐ ๊ด๋ จ
- Type-I: Cluster ์์ฑ ํ NodeGroup ๋ณ๋ ์ถ๊ฐ/์ญ์
- ๋์ CSP: AWS, Alibaba, Tencent ๋ฑ
- Type-II: ์ต์ด Cluster ์์ฑ์ ์ต์ 1๊ฐ ์ด์์ NodeGroup์ ํจ๊ป ์์ฑ
- ์ดํ NodeGroup ์ถ๊ฐ/์ญ์ ๊ฐ๋ฅ
- ๋์ CSP: Azure, GCP, IBM, NHN ๋ฑ
- Type-I: Cluster ์์ฑ ํ NodeGroup ๋ณ๋ ์ถ๊ฐ/์ญ์
-
Version ๊ด๋ จ
- 1.21(AWS), 1.21.6-gke.1500(GCP), v1.23.3(NHN) ๋ฑ CSP๋ณ๋ก ์ฐจ์ด๊ฐ ์์
- Driver๋ "" ๋๋ "default"๋ฅผ ์์ ํ๋ฉด, CSP๊ฐ default ๋ฒ์ ์ผ๋ก ์์ฑํ๋ ์ฒ๋ฆฌ ์ง์ํ๋ฉด default ์์ฑ ์ฒ๋ฆฌ,
- ์ ๊ณตํ์ง ์๋ ๊ฒฝ์ฐ๋ ํ ์์ ์ ๋์ CSP Web Console ๊ธฐ์ค default ๊ฐ์ผ๋ก ์์ฑ
๋ฒ์ ๊ฐ์ ์ ๋ ฅ ๋ฐ์ผ๋ฉด-ํ์ฌ: 1.23.3 ํ์์ผ๋ก ์ ๋ ฅ ๋ฐ์, driver์์๋ 1.23.3 ์ ๋ณด์์ ์ ํจํ ์ ๋ณด๋ฅผ ํ์ฑ ํ ํ์ฉ,๊ทธ ์ธ ์ ๋ณด๋ CSP์ default์ ๊ฐ๊น์ด ๊ฐ์ผ๋ก ์ค์
- GCP: Region๋ณ ์ ๊ณต ๋ฒ์ ์ด ๋ค๋ฆ
- 2022/12/08: ์ผ๋จ,
default("" or "default")
๋ง ์ ๊ณต
- 2022/12/08: ์ผ๋จ,
-
PMKS๋ VPC ์์กด์ ์ด๋ค. ์ฆ, ํน์ VPC์ ์์๋๋ ๊ด๋ฆฌํ K8S๋ฅผ ์์ฑ ๋ฐ ๊ตฌ์ฑํ ์ ์๋ค.
-
์ฌ์ฉ์๋ PMKS ์์ฑ ์์ฒญ ์ ์ ํ์ํ VPC/Subnet ๋ฐ Security Group์ ์ ์ ํ๊ฒ ์์ฑ ํ์ฌ ์ธ์๋ก ํจ๊ป ํธ์ถํจ์ ๊ฐ์ ํ๋ค.
- AWS์ ๊ฒฝ์ฐ ์ฌ์ ์ Role์ ์์ฑ์ด ํ์ํ๋ฉฐ, ํ์ฌ๋ role ์ด๋ฆ์ ๋ค์ ์ด๋ฆ์ผ๋ก ์ผ์น ์ํจ๋ค.(์ถํ ํ์์ ๊ฐ์ )
- Cluster: cloud-barista-spider-eks-cluster-role
- ํ์ฉ ๊ถํ: AmazonEKSClusterPolicy
- NodeGroup: cloud-barista-spider-eks-nodegroup-role
- ํ์ฉ ๊ถํ: AmazonEKSWorkerNodePolicy, AmazonEC2ContainerRegistryPullOnly, AmazonEKSWorkerNodePolicy, AmazonEKS_CNI_Policy, AmazonEBSCSIDriverPolicy
- Cluster: cloud-barista-spider-eks-cluster-role
- ์ถ๊ฐ๋ก ์ฌ์ ์์ฑ์ด ํ์ํ ์์์ด ์๋ CSP๋ ์๋จ ๋งํฌ์ ์ด์์ ํํฉ์ ๊ณต์ ๋ถํ๋๋ฆฝ๋๋ค.
- AWS์ ๊ฒฝ์ฐ ์ฌ์ ์ Role์ ์์ฑ์ด ํ์ํ๋ฉฐ, ํ์ฌ๋ role ์ด๋ฆ์ ๋ค์ ์ด๋ฆ์ผ๋ก ์ผ์น ์ํจ๋ค.(์ถํ ํ์์ ๊ฐ์ )
-
IP Address Family์ ๊ฒฝ์ฐ Driver ๋ด๋ถ์์ IPv4๋ก ์ค์ ํ๋ค. (IPv6 ํ์์ ์ถํ ๊ณ ๋ ค)
-
๊ณตํต API์์ ์ ๊ณต๋์ง ์๋ ์ค์ ์ผ ๊ฒฝ์ฐ๋ ์๋จ ๋งํฌ์ ์ด์์ ํํฉ์ ๊ณต์ ํ๊ณ ,
- Driver ๋ด์์ ๊ธฐ๋ณธ ๊ฐ(์ต์ ๋ฒ์ ๋ฑ ๊ฐ๊ธ์ CSP์ default ๊ฐ ํ์ฉ)์ผ๋ก ์ค์ ์ฒ๋ฆฌํด ์ฃผ์๊ธฐ ๋ฐ๋๋๋ค. (์ถํ ๊ฐ์ )
- ์์) AWS์์ kube-proxy version ๊ฐ ๋ฑ
-
NodeGroup์ Node(VM) ์ ๊ณต ์ ๋ณด ๋ฒ์
- IID(SystemId๋ง ํฌํจ) ๋ชฉ๋ก๋ง ๋ฐํ
-
Cluster Access ์ ๋ณด ์ ๊ณต
- Endpoint URL ์ ๊ณต
- Kubeconfig ์ ๋ณด ์ ๊ณต
-
Addons ์ค์ ๊ด๋ จ: cni, dns ๋ฑ ์ค์ API ์กด์ฌ์ ์ด์ ๊ณต์ ๋ฐ ํ์ฌ๋ default ์ค์ , ์ถํ ์ฌ๊ณ ๋ ค
-
Upgrade Cluster: Cluster Version์ ์ ๊ทธ๋ ์ด๋ํ๋ค.
-
PMKS๋ ์ฃผ๋ก ๊ณตํต API๋ฅผ ์ด์ฉํ Cluster ๊ด๋ฆฌ ์ค์ฌ์ ์ ์ด ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ฉฐ,
- ์ฌ์ฉ์๋ Addon ์ค์น/๊ด๋ฆฌ, Workload deploy ๋ฐ ๋ชจ๋ํฐ๋ง์ด๋ Taint, Tag, Label ์ค์ ๋ฑ๊ณผ ๊ฐ์
- K8S ํ์ฉ ์์ฒด๋ K8S kubectl๊ณผ K8S ์ธํฐํ์ด์ค ๋๋ Lens์ ๊ฐ์ Third party ์ง์ ๋๊ตฌ๋ฅผ ํ์ฉํ๋ค.
-
Tag, Key-Value ๊ธฐ๋ก ๊ท์น
- CSP๊ฐ ์ ๊ณตํ์ง ์๋ ์ ๋ณด ๊ธฐ๋ก์ด ํ์ํ์ฌ,
- Tagging์ด๋ Description์ ๊ธฐ๋ก์ด ํ์ํ ๊ฒฝ์ฐ
- ๊ฐ๊ธ์ ๋ค์ ๊ท์น์ ๋ฐ๋ฅธ๋ค.
#CB-SPIDER:PMKS:SECURITYGROUP:sg-01
- ์ฐธ๊ณ : https://github.com/cloud-barista/cb-spider/blob/cea4014f20da0c793537c9e03469ffc8fd080190/cloud-control-manager/cloud-driver/drivers/tencent/resources/ClusterHandler.go#L400
-
๋ณผ๋ฅจ์ ๋์ ํ๋ก๋น์ ๋ (ํํฉ)
- GCP, Azure: ๊ธฐ๋ณธ StorageClass๋ฅผ ์ ๊ณตํ๊ณ ์์ผ๋ฏ๋ก ๋ฐ๋ก PVC ์์ฑ ๊ฐ๋ฅ
- AWS: ์ ์ ํ StorageClass๋ฅผ ์ ๊ณตํ๊ณ ์์ง ์์ผ๋ฏ๋ก, ๊ธฐ๋ณธ StorageClass๋ฅผ ๋ฑ๋ก(ebs-sc.yaml)ํ๋ฉด ๊ฐ๋ฅ
- NHNCloud: ์ ์ ํ StorageClass๋ฅผ ์ ๊ณตํ๊ณ ์์ง ์์ผ๋ฏ๋ก, ๊ธฐ๋ณธ StorageClass๋ฅผ ๋ฑ๋ก(cinder-sc.yaml)ํ๋ฉด ๊ฐ๋ฅ
- Alibaba: StorageClass๋ฅผ ์ ๊ณตํ๋ฏ๋ก PVC ์์ฑ์ ๋ช ์ํ๊ณ 20GB ์ด์ ์ง์ ํ์
- Tencent: ๊ธฐ๋ณธ StorageClass๋ฅผ ์ ๊ณตํ๋ฏ๋ก ๋ฐ๋ก PVC ์์ฑ ๊ฐ๋ฅํ๋ 10GB ์ด์ ์ง์ ํ์
-
๊ทธ ์ธ์ ๋์ CSP Driver ๊ฐ๋ฐ์ ๋ถ์กฑํ ๋ถ๋ถ์ด ์์ผ์๋ฉด ์ด์์ ๊ณต์ ๋ถํ ๋๋ฆฝ๋๋ค.
7. PMKS Driver Common API
-
Source Tree
$tree cb-spider/cloud-control-manager/cloud-driver/interfaces/ cb-spider/cloud-control-manager/cloud-driver/interfaces/ |-- CloudDriver.go |-- README.md |-- connect | `-- CloudConnect.go `-- resources |-- AnyCallHandler.go |-- ClusterHandler.go <======================= PMKS Driver API |-- DiskHandler.go |-- IId.go |-- ImageHandler.go |-- KeyPairHandler.go |-- KeyValue.go |-- MyImageHandler.go |-- NLBHandler.go |-- SecurityHandler.go |-- VMHandler.go |-- VMSpecHandler.go `-- VPCHandler.go
-
Driver API Spec (latest)
package resources import "time" // -------- Const type ClusterStatus string const ( ClusterCreating ClusterStatus = "Creating" ClusterActive ClusterStatus = "Active" ClusterInactive ClusterStatus = "Inactive" ClusterUpdating ClusterStatus = "Updating" ClusterDeleting ClusterStatus = "Deleting" ) type NodeGroupStatus string const ( NodeGroupCreating NodeGroupStatus = "Creating" NodeGroupActive NodeGroupStatus = "Active" NodeGroupInactive NodeGroupStatus = "Inactive" NodeGroupUpdating NodeGroupStatus = "Updating" NodeGroupDeleting NodeGroupStatus = "Deleting" ) // -------- Info Structure type ClusterInfo struct { IId IID // {NameId, SystemId} Version string // Kubernetes Version, ex) 1.23.3 Network NetworkInfo // --- NodeGroupList []NodeGroupInfo AccessInfo AccessInfo Addons AddonsInfo Status ClusterStatus CreatedTime time.Time KeyValueList []KeyValue } type NetworkInfo struct { VpcIID IID // {NameId, SystemId} SubnetIIDs []IID SecurityGroupIIDs []IID // --- KeyValueList []KeyValue } type NodeGroupInfo struct { IId IID // {NameId, SystemId} // VM config. ImageIID IID VMSpecName string RootDiskType string // "SSD(gp2)", "Premium SSD", ... RootDiskSize string // "", "default", "50", "1000" (GB) KeyPairIID IID // Scaling config. OnAutoScaling bool // default: true DesiredNodeSize int MinNodeSize int MaxNodeSize int // --- Status NodeGroupStatus Nodes []IID KeyValueList []KeyValue } type AccessInfo struct { Endpoint string // ex) https://1.2.3.4:6443 Kubeconfig string } // CNI, DNS, .... @todo type AddonsInfo struct { KeyValueList []KeyValue } // -------- Cluster API type ClusterHandler interface { //------ Cluster Management CreateCluster(clusterReqInfo ClusterInfo) (ClusterInfo, error) ListCluster() ([]*ClusterInfo, error) GetCluster(clusterIID IID) (ClusterInfo, error) DeleteCluster(clusterIID IID) (bool, error) //------ NodeGroup Management AddNodeGroup(clusterIID IID, nodeGroupReqInfo NodeGroupInfo) (NodeGroupInfo, error) SetNodeGroupAutoScaling(clusterIID IID, nodeGroupIID IID, on bool) (bool, error) ChangeNodeGroupScaling(clusterIID IID, nodeGroupIID IID, DesiredNodeSize int, MinNodeSize int, MaxNodeSize int) (NodeGroupInfo, error) RemoveNodeGroup(clusterIID IID, nodeGroupIID IID) (bool, error) //------ Upgrade K8S UpgradeCluster(clusterIID IID, newVersion string) (ClusterInfo, error) }
History
- V0.5 => V0.6
- CB-Spider Cluster ์ ๊ณต ํํฉ ์ถ๊ฐ
- V0.4 => V0.5
- ClusterInfo.AccessInfo ์ถ๊ฐ
- V0.3 => V0.4
- ๋ถํ์ API ์ญ์ (#794)
- ์ญ์ API: ListNodeGroup(), GetNodeGroup()
- V0.2 => V0.3
- Attribute Naming ๊ท์น ๋ฐ์ (#786)
- SubnetIID => SubnetIIDs
- NodeList => Nodes
- V0.1 => V0.2
- Cluster ์์ฑ์ default NodeGroup ๋์ ์์ฑ
- ๋
๋ฆฝ์ ์ด๋ NodeGroup ์์ฑ ๋ฐ ๊ด๋ฆฌ๋ฅผ ํน์ Cluster ํ์์ ๊ด๋ฆฌ
- NodeGroup Size ๊ด๋ฆฌ๋ฅผ Autoscaling ๋ฐฉ๋ฒ์ผ๋ก๋ง ์ ๊ณต
- NodeGroupHandler๋ฅผ ClusterHandler ์์ผ๋ก ํตํฉ
- NodeGroup.Status ์ถ๊ฐ
- NodeGroup AutoScaling On/Off ์ค์ API ์ถ๊ฐ