Kubernetes Cluster Management Guide(KR) - cloud-barista/cb-spider GitHub Wiki
- CB-Spider๋ ์ฐ๋ ๋์ ํด๋ผ์ฐ๋(CSP)๊ฐ ์ ๊ณตํ๋ ๊ด๋ฆฌํ Kubernetes๋ฅผ
- ๋์ผํ ์ธํฐํ์ด์ค๋ฅผ ์ฌ์ฉํ์ฌ ์ ์ดํ ์ ์๋ Cluster(Kubernetes Cluster) ์ ์ด ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค.
- Kubernetes๊ฐ ํ์ํ CB-Spider ์ฌ์ฉ์(์ธํ๋ผ ๊ด๋ฆฌ์ ๋๋ ์๋น์ค ๊ฐ๋ฐ์)๋ ์๋ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ด,
- โ CB-Spider ์ธํฐํ์ด์ค๋ฅผ ํ์ฉํ์ฌ ๋์ผํ ๋ฐฉ๋ฒ์ผ๋ก
- ์ํ๋ ๋์ ํด๋ผ์ฐ๋์ Kubernetes ์ธ์คํด์ค ์์ฑ์ ์์ฒญํ ์ ์์ต๋๋ค.
- โก ์ฌ์ฉ์์ ์์ฒญ์ Spider์ ๋์ ์ฐ๋ ๋๋ผ์ด๋ฒ๋ฅผ ํตํด์
- ๋์ ํด๋ผ์ฐ๋์ API๋ฅผ ํธ์ถํ์ฌ ๋์ ํด๋ผ์ฐ๋์ ๊ด๋ฆฌํ Kubernetes ์ธ์คํด์ค๊ฐ ์์ฑ๋ฉ๋๋ค.
- โข ์ฌ์ฉ์๋ ์์ฑ๋ Kubernetes์ ๋ํ์ฌ K8S CLI(kubectl) ๋๋ API ๋ฑ์ ํ๋ถํ Kubernetes ์ธํฐํ์ด์ค๋ฅผ ์ฌ์ฉํ์ฌ
- ์ฌ์ฉ์์ ์ํฌ๋ก๋๋ฅผ ๋ฐฐํฌ ๋ฐ ๊ด๋ฆฌํ ์ ์์ต๋๋ค.
- ๋ํ, OpenLens, Headlamp, Kubesphere ๋ฑ์ Kubernetes IDE์ ์ฐ๋ํ์ฌ ์์ฑ๋ Kubernetes์ ๊ธฐ๋ฅ์ ํธ๋ฆฌํ๊ฒ ํ์ฉํ ์๋ ์์ต๋๋ค.
- โ CB-Spider ์ธํฐํ์ด์ค๋ฅผ ํ์ฉํ์ฌ ๋์ผํ ๋ฐฉ๋ฒ์ผ๋ก
[CB-Spider Kubernetes Cluster Overview]
- ์ฌ์ฉ์์ ์ํด ์์ฑ๋ ํ๋์ Kubernetes ์ธ์คํด์ค๋ ์๋ ๊ทธ๋ฆผ์์ ๋ณด๋ ๋ฐ์ ๊ฐ์ด Cluster๋ผ๊ณ ํฉ๋๋ค.
- Cluster๋ ํฌ๊ฒ Control Plane, Node Group, Addons ๋ฐ Endpoint๋ก ๊ตฌ์ฑ๋ฉ๋๋ค.
[CB-Spider Kubernetes Cluster Components]
-
์ปดํฌ๋ํธ๋ณ ์ธ๋ถ ๋ด์ฉ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
- ์ปจํธ๋กค ํ๋ ์ธ์ Cluster์ ์ ์ฒด ๋์ ๋ฐ ์คํ์ ๊ด์ฅํ๋ ๋ง์คํฐ๋ก์์ ์ญํ ์ ๋ด๋นํ๋ ์ปดํฌ๋ํธ๋ค์ ๋ชจ์์ด๋ฉฐ, - ๊ด๋ฆฌํ Kubernetes์ ๊ฒฝ์ฐ์๋ ์ปจํธ๋กค ํ๋ ์ธ์ ๊ด๋ฆฌ ์ฃผ์ฒด๋ CSP์ Cloud ํ๋ซํผ(CloudOS)์ด๋ฉฐ, - CSP ์ฌ์ฉ์(=CB-Spider ์ฌ์ฉ์)๋ ์ํ ํ์ธ ๋ฐ ์ ์ด๋ฅผ ํ ์ ์์ต๋๋ค.- ํ๋์ ๋ ธ๋ ๊ทธ๋ฃน์ ๋์ผํ ์ด๋ฏธ์ง์ ๊ท๊ฒฉ์ผ๋ก ์์ฑ๋ VM๋ค๋ก ๊ตฌ์ฑ๋๋ฉฐ, - ํ๋์ Cluster๋ ์๋ก ๋ค๋ฅธ ์ข ๋ฅ์ ์ฌ๋ฌ ๊ฐ์ ๋ ธ๋ ๊ทธ๋ฃน์ ํฌํจํ ์ ์์ต๋๋ค. - ์ด์ ๊ฐ์ ์ด์ง์ ์ธ ๋ ธ๋ ๊ทธ๋ฃน ๊ตฌ์ฑ์ ํตํ์ฌ ํ๋์ Cluster์์ ๋ค์ํ ์ข ๋ฅ์ ์ํฌ๋ก๋์ ์คํ ์ค์ ์ด ๊ฐ๋ฅํฉ๋๋ค.- ์๋์จ์ CNI, DNS ๋ฐ Container Resource Monitoring ๋ฑ์ผ๋ก - Cluster ์์ค์ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ ์ปดํฌ๋ํธ์ ๋๋ค. - ๋ค์ํ ์๋์จ๋ค์ด ์กด์ฌํ๋ฉฐ, ์ ํ์ ์ผ๋ก ๊ตฌ์ฑํ์ฌ ํ์ฉํ ์ ์์ต๋๋ค.- ์ธ๋ถ์์ Cluster์ ์ ๊ทผํ ์ ์๋ URL์ ์ ๊ณตํฉ๋๋ค.
- Cluster ์์ฑ๊ณผ NodeGroup ์ถ๊ฐ ์์์ ๋ฐ๋ผ ๋ค์๊ณผ ๊ฐ์ด 2๊ฐ์ง ํ์ ์ผ๋ก ๊ตฌ๋ถ๋ฉ๋๋ค.
-
- ๋์ CSP: AWS, Alibaba, Tencent ๋ฑ
-
(2) Type-II: ์ต์ด Cluster ์์ฑ์ ์ต์ 1๊ฐ ์ด์์ NodeGroup์ ํจ๊ป ์์ฑ, ์ดํ NodeGroup ์ถ๊ฐ/์ญ์ ๊ฐ๋ฅ
- ๋์ CSP: Azure, GCP, IBM, NHN, NCP ๋ฑ
- ์ฐธ๊ณ : ๋
ธ๋ ๊ทธ๋ฃน OS๋ก ์ ํ ๊ฐ๋ฅํ ์ด๋ฏธ์ง ๋ชฉ๋ก
-
-
(1) ์ค์ ํ์ง ์์ (๋น ๋ฌธ์์ด ๋๋
"default"):- Default AMI Type (
AL2023_x86_64_STANDARD)์ผ๋ก ์๋ ์ค์ โ ํ์ค x86_64 ์ํฌ๋ก๋์ ๊ถ์ฅ
- Default AMI Type (
-
(2) EKS AMI Type ์๋ณ์ (์:
AL2023_x86_64_STANDARD,AL2023_ARM_64_STANDARD,BOTTLEROCKET_x86_64๋ฑ):- ๋ณํ ์์ด AWS EKS์ ๊ทธ๋๋ก ์ ๋ฌ โ GPU ๋ณํ์ ํฌํจํ์ฌ AMI ํ์ ์ ๋ช ์์ ์ผ๋ก ์ ํํ ๋ ์ฌ์ฉ
์ง์๋๋ EKS AMI Type ๋ชฉ๋ก
- AL2023_x86_64_STANDARD
- AL2023_ARM_64_STANDARD
- BOTTLEROCKET_ARM_64
- BOTTLEROCKET_x86_64
- BOTTLEROCKET_ARM_64_NVIDIA
- BOTTLEROCKET_x86_64_NVIDIA
- WINDOWS_CORE_2019_x86_64
- WINDOWS_FULL_2019_x86_64
- WINDOWS_CORE_2022_x86_64
- WINDOWS_FULL_2022_x86_64
-
(3) EC2 Launch Template ID (ํ์:
lt-[17์๋ฆฌ hex], ์:lt-0123456789abcdef0):- Launch Template์ ์์ ์์ด ์ง์ ์ฐธ์กฐ โ ๋ฏธ๋ฆฌ ๊ตฌ์ฑ๋ EC2 Launch Template์ ํตํด ์ปค์คํ AMI๋ฅผ ์ง์ ํ ๋ ์ฌ์ฉ
- Launch Template์๋ EKS ์์ปค ๋ ธ๋ ์ด๊ธฐํ๋ฅผ ์ํ bootstrap UserData๊ฐ ํฌํจ๋์ด์ผ ํจ
- cb-spider๋ Launch Template์ ์์ฑํ๊ฑฐ๋ ์์ ํ์ง ์์
- EKS์ฉ Launch Template ์์ฑ ๋ฐฉ๋ฒ:
-
(4) ์์ EC2 AMI ID (์:
ami-0abcdef1234567890) ๋๋ ์ธ์๋์ง ์๋ ๊ฐ:- ์ค๋ฅ ๋ฐํ โ ์๋ AMI ID โ EKS AMI Type ๋งคํ ๊ธฐ๋ฅ์ด ์ ๊ฑฐ๋จ (์ด์ PR #1651)
- ์ปค์คํ AMI๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด, AMI ID์ UserData๊ฐ ํฌํจ๋ EC2 Launch Template์ ์์ฑํ ํ ํด๋น Launch Template ID๋ฅผ ImageName ๊ฐ์ผ๋ก ์ ๋ฌ (์ ์ต์ (3) ์ฐธ์กฐ)
-
-
Tencent: ๋ค์ ๋ชฉ๋ก์์
OS Name์ ImageId๋ก ์ค์
-
- ์ ๊ณต ๊ธฐ๋ฅ: Cluster ์์ฑ/์ญ์ , NodeGroup ์ถ๊ฐ/์ญ์ , Kubeconfig ์ ๊ณต ๋ฑ
- ๊ฒ์ฆ ํ์ ๊ธฐ๋ฅ: AutoScaling ์ค์ ๋ณ๊ฒฝ, Upgrade (์ ์ฒด ๋๋ ์ผ๋ถ CSP ์ง์, ์ ์ฒด ๊ฒ์ฆ ํ์ํ ๊ธฐ๋ฅ)
- ์ถํ ์ ๊ณต ๊ณ ๋ ค: Addons(ํ์ฌ ๋ฏธ๊ตฌํ)
| CSP | ํน์ด์ฌํญ |
|---|---|
| AWS | โข Type-I Cluster (NodeGroup ๋ณ๋ ์ถ๊ฐ) โข ์๋ก ๋ค๋ฅธ Zone์ 2๊ฐ ์ด์ Subnet ํ์ โข Cluster Role, NodeGroup Role ์๋ ์์ฑ |
| Azure | โข Type-II Cluster (์ต์ 1๊ฐ NodeGroup ํ์) โข Subnet CIDR 333 Address ์ด์ (์: /23 ์ด์ ๊ถ์ฅ) โข ๊ด๋ จ Role ์ค์ ํ์ |
| GCP | โข Type-II Cluster (์ต์ 1๊ฐ NodeGroup ํ์) โข Region๋ณ ์ ๊ณต ๋ฒ์ ์ด ๋ค๋ฆ |
| Alibaba | โข Type-I Cluster (NodeGroup ๋ณ๋ ์ถ๊ฐ) |
| Tencent | โข Type-I Cluster (NodeGroup ๋ณ๋ ์ถ๊ฐ) โข ๊ด๋ จ Role ์ค์ ํ์ โข ์ง์ ๋ OS Name ๋ชฉ๋ก์์ ์ด๋ฏธ์ง ์ ํ |
| NHN | โข Type-II Cluster (์ต์ 1๊ฐ NodeGroup ํ์) |
| NCP | โข Type-II Cluster (์ต์ 1๊ฐ NodeGroup ํ์) |
| IBM | โข Type-II Cluster (์ต์ 1๊ฐ NodeGroup ํ์) |
- ์ฌ์ฉ์๋ ๋ค์๊ณผ ๊ฐ์ CB-Spider REST API๋ฅผ ์ด์ฉํ์ฌ Cluster ์ ๋ณด๋ฅผ JSON ๊ท๊ฒฉ์ผ๋ก ์ ๊ณต๋ฐ์ต๋๋ค.
# Cluster ์์ฑ ๋ฐ ์กฐํ
POST /spider/cluster - Create Cluster
GET /spider/cluster - List Clusters
GET /spider/cluster/{Name} - Get Cluster
DELETE /spider/cluster/{Name} - Delete Cluster
# Cluster ๋ฑ๋ก/ํด์ (๊ธฐ์กด CSP Cluster ์ฐ๋)
POST /spider/regcluster - Register Cluster
DELETE /spider/regcluster/{Name} - Unregister Cluster
POST /spider/getclusterowner - Get Cluster Owner VPC
# NodeGroup ๊ด๋ฆฌ
POST /spider/cluster/{Name}/nodegroup - Add NodeGroup
DELETE /spider/cluster/{Name}/nodegroup/{NodeGroupName} - Remove NodeGroup
# NodeGroup AutoScaling ๊ด๋ฆฌ
PUT /spider/cluster/{Name}/nodegroup/{NodeGroupName}/onautoscaling - Set NodeGroup AutoScaling
PUT /spider/cluster/{Name}/nodegroup/{NodeGroupName}/autoscalesize - Change NodeGroup Scaling
# Cluster Upgrade
PUT /spider/cluster/{Name}/upgrade - Upgrade Cluster
# Cluster ๋ชฉ๋ก ์กฐํ (์ ์ฒด)
GET /spider/allcluster - List All Clusters (CB-Spider + CSP)
GET /spider/allclusterinfo - List All Cluster Info
# Cluster ํต๊ณ
GET /spider/countcluster - Count All Clusters
GET /spider/countcluster/{ConnectionName} - Count Clusters by Connection
# Cluster Token (for kubectl authentication)
GET /spider/cluster/{Name}/token - Get Cluster Token
# CSP Cluster ์ง์ ์ญ์
DELETE /spider/cspcluster/{Id} - Delete CSP Cluster
- Cluster ์ ๋ณด (ClusterInfo)
| ํ๋ | ์ค๋ช | ์์ |
|---|---|---|
| IId | Cluster์ ์๋ณ์ ์ ๋ณด (NameId, SystemId) | โ {Name: "cluster-01", SystemId: "cluster-1234abcd"} |
| Version | Kubernetes ๋ฒ์ | โ "1.30", "1.29", "1.28" |
| Network | ๋คํธ์ํฌ ์ ๋ณด | โ ์๋ NetworkInfo ์ฐธ์กฐ |
| NodeGroupList | NodeGroup ๋ชฉ๋ก | โ ์๋ NodeGroupInfo ๋ฐฐ์ด ์ฐธ์กฐ |
| AccessInfo | Cluster ์ ์ ์ ๋ณด | โ ์๋ AccessInfo ์ฐธ์กฐ |
| Addons | ์ ๋์จ ์ ๋ณด | โ ์๋ AddonsInfo ์ฐธ์กฐ |
| Status | Cluster ์ํ | โ "Creating", "Active", "Inactive", "Updating", "Deleting" |
| CreatedTime | Cluster ์์ฑ ์๊ฐ | โ "2024-03-03T12:34:56Z" |
| KeyValueList | CSP๊ฐ ์ ๊ณตํ๋ ์ถ๊ฐ ์ ๋ณด | โ [{Key: "Platform", Value: "eks"}] |
- Network ์ ๋ณด (NetworkInfo)
| ํ๋ | ์ค๋ช | ์์ |
|---|---|---|
| VpcIID | Cluster๊ฐ ์ํ VPC ์๋ณ์ | โ {Name: "vpc-01", SystemId: "vpc-5678efgh"} |
| SubnetIIDs | Subnet ์๋ณ์ ๋ชฉ๋ก | โ [{Name: "subnet-01", SystemId: "subnet-1234"}] |
| SecurityGroupIIDs | Security Group ์๋ณ์ ๋ชฉ๋ก | โ [{Name: "sg-01", SystemId: "sg-5678"}] |
| KeyValueList | CSP๊ฐ ์ ๊ณตํ๋ ์ถ๊ฐ ๋คํธ์ํฌ ์ ๋ณด | โ [{Key: "NetworkType", Value: "VPC-Native"}] |
- NodeGroup ์ ๋ณด (NodeGroupInfo)
| ํ๋ | ์ค๋ช | ์์ |
|---|---|---|
| IId | NodeGroup์ ์๋ณ์ ์ ๋ณด | โ {Name: "ng-01", SystemId: "ng-1234abcd"} |
| ImageIID | Node VM์ ์ด๋ฏธ์ง ์๋ณ์ | โ {Name: "ubuntu-22.04", SystemId: "ami-1234"} |
| VMSpecName | Node VM์ ์ฌ์ | โ "t3.medium", "Standard_D2s_v3" |
| RootDiskType | Root Disk ํ์ | โ "SSD(gp2)", "Premium SSD" |
| RootDiskSize | Root Disk ํฌ๊ธฐ (GB) | โ "50", "100" |
| KeyPairIID | SSH KeyPair ์๋ณ์ | โ {Name: "keypair-01", SystemId: "key-1234"} |
| OnAutoScaling | AutoScaling ํ์ฑํ ์ฌ๋ถ | โ true, false |
| DesiredNodeSize | ์ํ๋ ๋ ธ๋ ๊ฐ์ | โ 2, 3, 5 |
| MinNodeSize | ์ต์ ๋ ธ๋ ๊ฐ์ | โ 1, 2 |
| MaxNodeSize | ์ต๋ ๋ ธ๋ ๊ฐ์ | โ 3, 5, 10 |
| Status | NodeGroup ์ํ | โ "Creating", "Active", "Inactive", "Updating", "Deleting" |
| Nodes | Node(VM) ์๋ณ์ ๋ชฉ๋ก | โ [{SystemId: "i-1234"}, {SystemId: "i-5678"}] |
| KeyValueList | CSP๊ฐ ์ ๊ณตํ๋ ์ถ๊ฐ ์ ๋ณด | โ [{Key: "ScalingConfig", Value: "Enabled"}] |
- AccessInfo ์ ๋ณด
| ํ๋ | ์ค๋ช | ์์ |
|---|---|---|
| Endpoint | Cluster API Server Endpoint URL | โ "https://1234.gr7.us-east-1.eks.amazonaws.com" |
| Kubeconfig | kubectl ์ ์์ ์ํ kubeconfig ๋ด์ฉ | โ "apiVersion: v1\nclusters:\n..." |
- AddonsInfo ์ ๋ณด
| ํ๋ | ์ค๋ช | ์์ |
|---|---|---|
| KeyValueList | Addon ์ ๋ณด ๋ชฉ๋ก | โ [{Key: "CNI", Value: "aws-vpc-cni"}] |
- AWS, Alibaba, Tencent ๋ฑ Type-I CSP์์ NodeGroup์ ์ ์ธํ๊ณ Cluster๋ง ์์ฑํ๋ API ํธ์ถ ์์:
curl -sX POST http://localhost:1024/spider/cluster \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01",
"IDTransformMode": "ON",
"ReqInfo": {
"Name": "cluster-01",
"Version": "1.30",
"VPCName": "vpc-01",
"SubnetNames": ["subnet-01", "subnet-02"],
"SecurityGroupNames": ["sg-01"]
}
}' | jq์๋ต ์์:
{
"IId": {
"NameId": "cluster-01",
"SystemId": "arn:aws:eks:us-east-1:123456789012:cluster/cluster-01"
},
"Version": "1.30",
"Network": {
"VpcIID": {
"NameId": "vpc-01",
"SystemId": "vpc-0a1b2c3d4e5f67890"
},
"SubnetIIDs": [
{
"NameId": "subnet-01",
"SystemId": "subnet-1234567890abcdef0"
},
{
"NameId": "subnet-02",
"SystemId": "subnet-0fedcba9876543210"
}
],
"SecurityGroupIIDs": [
{
"NameId": "sg-01",
"SystemId": "sg-0a1b2c3d4e5f67890"
}
],
"KeyValueList": []
},
"NodeGroupList": [],
"AccessInfo": {
"Endpoint": "https://1234ABCD5678EFGH.gr7.us-east-1.eks.amazonaws.com",
"Kubeconfig": "apiVersion: v1\nclusters:\n- cluster:\n certificate-authority-data: LS0tLS1CRU...\n server: https://1234ABCD5678EFGH.gr7.us-east-1.eks.amazonaws.com\n name: cluster-01\ncontexts:\n- context:\n cluster: cluster-01\n user: cluster-01-user\n name: cluster-01-context\ncurrent-context: cluster-01-context\nkind: Config\npreferences: {}\nusers:\n- name: cluster-01-user\n user:\n exec:\n apiVersion: client.authentication.k8s.io/v1\n command: /spider/cluster/cluster-01/token\n args:\n - --ConnectionName=aws-config01\n"
},
"Addons": {
"KeyValueList": []
},
"Status": "Creating",
"CreatedTime": "2024-03-03T12:34:56Z",
"KeyValueList": []
}- Azure, GCP, IBM, NHN ๋ฑ Type-II CSP์์ NodeGroup์ ํฌํจํ์ฌ Cluster๋ฅผ ์์ฑํ๋ API ํธ์ถ ์์:
curl -sX POST http://localhost:1024/spider/cluster \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "azure-config01",
"IDTransformMode": "ON",
"ReqInfo": {
"Name": "cluster-01",
"Version": "1.29",
"VPCName": "vpc-01",
"SubnetNames": ["subnet-01"],
"SecurityGroupNames": ["sg-01"],
"NodeGroupList": [
{
"Name": "nodegroup-01",
"ImageName": "ubuntu-22.04",
"VMSpecName": "Standard_D2s_v3",
"RootDiskType": "Premium_LRS",
"RootDiskSize": "50",
"KeyPairName": "keypair-01",
"OnAutoScaling": "true",
"DesiredNodeSize": "2",
"MinNodeSize": "1",
"MaxNodeSize": "3"
}
]
}
}' | jq์๋ต ์์:
{
"IId": {
"NameId": "cluster-01",
"SystemId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg-01/providers/Microsoft.ContainerService/managedClusters/cluster-01"
},
"Version": "1.29",
"Network": {
"VpcIID": {
"NameId": "vpc-01",
"SystemId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg-01/providers/Microsoft.Network/virtualNetworks/vpc-01"
},
"SubnetIIDs": [
{
"NameId": "subnet-01",
"SystemId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg-01/providers/Microsoft.Network/virtualNetworks/vpc-01/subnets/subnet-01"
}
],
"SecurityGroupIIDs": [
{
"NameId": "sg-01",
"SystemId": "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg-01/providers/Microsoft.Network/networkSecurityGroups/sg-01"
}
],
"KeyValueList": []
},
"NodeGroupList": [
{
"IId": {
"NameId": "nodegroup-01",
"SystemId": "nodegroup-01"
},
"ImageIID": {
"NameId": "ubuntu-22.04",
"SystemId": "Canonical:0001-com-ubuntu-server-jammy:22_04-lts:latest"
},
"VMSpecName": "Standard_D2s_v3",
"RootDiskType": "Premium_LRS",
"RootDiskSize": "50",
"KeyPairIID": {
"NameId": "keypair-01",
"SystemId": "keypair-01"
},
"OnAutoScaling": true,
"DesiredNodeSize": 2,
"MinNodeSize": 1,
"MaxNodeSize": 3,
"Status": "Creating",
"Nodes": [],
"KeyValueList": []
}
],
"AccessInfo": {
"Endpoint": "https://cluster-01-rg-01-12345-abcdef12.hcp.koreacentral.azmk8s.io:443",
"Kubeconfig": "apiVersion: v1\nclusters:\n- cluster:\n certificate-authority-data: LS0tLS1CRU...\n server: https://cluster-01-rg-01-12345-abcdef12.hcp.koreacentral.azmk8s.io:443\n name: cluster-01\n..."
},
"Addons": {
"KeyValueList": []
},
"Status": "Creating",
"CreatedTime": "2024-03-03T12:34:56Z",
"KeyValueList": []
}- ๋ฑ๋ก๋ Cluster ๋ชฉ๋ก์ ์กฐํํ๋ API ํธ์ถ ์์:
curl -sX GET 'http://localhost:1024/spider/cluster?ConnectionName=aws-config01' | jq์๋ต ์์:
{
"cluster": [
{
"IId": {
"NameId": "cluster-01",
"SystemId": "arn:aws:eks:us-east-1:123456789012:cluster/cluster-01"
},
"Version": "1.30",
"Network": {
"VpcIID": {
"NameId": "vpc-01",
"SystemId": "vpc-0a1b2c3d4e5f67890"
},
"SubnetIIDs": [
{
"NameId": "subnet-01",
"SystemId": "subnet-1234567890abcdef0"
},
{
"NameId": "subnet-02",
"SystemId": "subnet-0fedcba9876543210"
}
],
"SecurityGroupIIDs": [
{
"NameId": "sg-01",
"SystemId": "sg-0a1b2c3d4e5f67890"
}
],
"KeyValueList": []
},
"NodeGroupList": [
{
"IId": {
"NameId": "nodegroup-01",
"SystemId": "arn:aws:eks:us-east-1:123456789012:nodegroup/cluster-01/nodegroup-01/abc12345-6789-0123-4567-89abcdef0123"
},
"ImageIID": {
"NameId": "",
"SystemId": "AL2023_x86_64_STANDARD"
},
"VMSpecName": "t3.medium",
"RootDiskType": "gp3",
"RootDiskSize": "50",
"KeyPairIID": {
"NameId": "keypair-01",
"SystemId": "keypair-01"
},
"OnAutoScaling": true,
"DesiredNodeSize": 2,
"MinNodeSize": 1,
"MaxNodeSize": 3,
"Status": "Active",
"Nodes": [
{
"NameId": "",
"SystemId": "i-0a1b2c3d4e5f67890"
},
{
"NameId": "",
"SystemId": "i-1b2c3d4e5f6789012"
}
],
"KeyValueList": []
}
],
"AccessInfo": {
"Endpoint": "https://1234ABCD5678EFGH.gr7.us-east-1.eks.amazonaws.com",
"Kubeconfig": "apiVersion: v1\nclusters:\n..."
},
"Addons": {
"KeyValueList": []
},
"Status": "Active",
"CreatedTime": "2024-03-03T12:34:56Z",
"KeyValueList": []
}
]
}- ํน์ Cluster์ ์์ธ ์ ๋ณด๋ฅผ ์กฐํํ๋ API ํธ์ถ ์์:
curl -sX GET 'http://localhost:1024/spider/cluster/cluster-01?ConnectionName=aws-config01' | jq์๋ต ๊ฒฐ๊ณผ๋ 6.3์ ๊ฐ๋ณ Cluster ์ ๋ณด์ ๋์ผ
- Cluster ์์ฑ ํ Kubeconfig๋ฅผ ํ์ฉํ์ฌ kubectl๋ก ์ ๊ทผํ ์ ์์ต๋๋ค.
- CB-Spider๋ ๊ธฐ๋ณธ์ ์ผ๋ก CB-Spider credential-based Kubeconfig๋ฅผ ์ ๊ณตํ๋ฉฐ, CSP native plugin์ ์ฌ์ฉํ๋ Native Kubeconfig๋ ์ง์ํฉ๋๋ค.
- Kubeconfig ํ์ฉ ๋ฐฉ๋ฒ ๋ฐ ์์ธ ๋ด์ฉ์ CB-Spider Kubeconfig ํ์ฉ ๊ฐ์ด๋๋ฅผ ์ฐธ๊ณ ํ์ธ์.
- ๊ธฐ์กด Cluster์ ์๋ก์ด NodeGroup์ ์ถ๊ฐํ๋ API ํธ์ถ ์์:
curl -sX POST http://localhost:1024/spider/cluster/cluster-01/nodegroup \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01",
"IDTransformMode": "ON",
"ReqInfo": {
"Name": "nodegroup-02",
"ImageName": "",
"VMSpecName": "t3.large",
"RootDiskType": "gp3",
"RootDiskSize": "100",
"KeyPairName": "keypair-01",
"OnAutoScaling": "true",
"DesiredNodeSize": "3",
"MinNodeSize": "2",
"MaxNodeSize": "5"
}
}' | jq์๋ต ์์:
{
"IId": {
"NameId": "cluster-01",
"SystemId": "arn:aws:eks:us-east-1:123456789012:cluster/cluster-01"
},
"Version": "1.30",
"NodeGroupList": [
{
"IId": {
"NameId": "nodegroup-01",
"SystemId": "arn:aws:eks:us-east-1:123456789012:nodegroup/cluster-01/nodegroup-01/abc12345-6789-0123-4567-89abcdef0123"
},
"VMSpecName": "t3.medium",
"OnAutoScaling": true,
"DesiredNodeSize": 2,
"MinNodeSize": 1,
"MaxNodeSize": 3,
"Status": "Active",
"Nodes": [
{
"NameId": "",
"SystemId": "i-0a1b2c3d4e5f67890"
},
{
"NameId": "",
"SystemId": "i-1b2c3d4e5f6789012"
}
],
"KeyValueList": []
},
{
"IId": {
"NameId": "nodegroup-02",
"SystemId": "arn:aws:eks:us-east-1:123456789012:nodegroup/cluster-01/nodegroup-02/def45678-9012-3456-7890-12345678abcd"
},
"VMSpecName": "t3.large",
"RootDiskType": "gp3",
"RootDiskSize": "100",
"OnAutoScaling": true,
"DesiredNodeSize": 3,
"MinNodeSize": 2,
"MaxNodeSize": 5,
"Status": "Creating",
"Nodes": [],
"KeyValueList": []
}
],
...
}- NodeGroup์ AutoScaling์ ํ์ฑํ/๋นํ์ฑํํ๋ API ํธ์ถ ์์:
curl -sX PUT http://localhost:1024/spider/cluster/cluster-01/nodegroup/nodegroup-01/onautoscaling \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01",
"ReqInfo": {
"OnAutoScaling": "false"
}
}' | jq์๋ต ์์:
{
"Result": "true"
}- NodeGroup์ ๋ ธ๋ ํฌ๊ธฐ๋ฅผ ๋ณ๊ฒฝํ๋ API ํธ์ถ ์์:
curl -sX PUT http://localhost:1024/spider/cluster/cluster-01/nodegroup/nodegroup-01/autoscalesize \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01",
"ReqInfo": {
"DesiredNodeSize": "4",
"MinNodeSize": "2",
"MaxNodeSize": "6"
}
}' | jq์๋ต ์์:
{
"IId": {
"NameId": "nodegroup-01",
"SystemId": "arn:aws:eks:us-east-1:123456789012:nodegroup/cluster-01/nodegroup-01/abc12345-6789-0123-4567-89abcdef0123"
},
"VMSpecName": "t3.medium",
"OnAutoScaling": true,
"DesiredNodeSize": 4,
"MinNodeSize": 2,
"MaxNodeSize": 6,
"Status": "Updating",
"Nodes": [
{
"NameId": "",
"SystemId": "i-0a1b2c3d4e5f67890"
},
{
"NameId": "",
"SystemId": "i-1b2c3d4e5f6789012"
}
],
"KeyValueList": []
}- Cluster์์ NodeGroup์ ์ ๊ฑฐํ๋ API ํธ์ถ ์์:
curl -sX DELETE 'http://localhost:1024/spider/cluster/cluster-01/nodegroup/nodegroup-02' \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01"
}' | jq์๋ต ์์:
{
"Result": "true"
}- Cluster์ Kubernetes ๋ฒ์ ์ ์ ๊ทธ๋ ์ด๋ํ๋ API ํธ์ถ ์์:
curl -sX PUT http://localhost:1024/spider/cluster/cluster-01/upgrade \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01",
"ReqInfo": {
"Version": "1.31"
}
}' | jq์๋ต ์์:
{
"IId": {
"NameId": "cluster-01",
"SystemId": "arn:aws:eks:us-east-1:123456789012:cluster/cluster-01"
},
"Version": "1.31",
"Status": "Updating",
...
}- Cluster๋ฅผ ์ญ์ ํ๋ API ํธ์ถ ์์:
curl -sX DELETE 'http://localhost:1024/spider/cluster/cluster-01' \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01"
}' | jq์๋ต ์์:
{
"Result": "true"
}- Cluster๋ฅผ ๊ฐ์ ๋ก ์ญ์ ํ๋ API ํธ์ถ ์์ (NodeGroup์ด ์์ด๋ ์ญ์ ):
curl -sX DELETE 'http://localhost:1024/spider/cluster/cluster-01?force=true' \
-H 'Content-Type: application/json' \
-d '{
"ConnectionName": "aws-config01"
}' | jq- ์ฌ์ ์ค๋น ๋ฆฌ์์ค: VPC, Subnet, Security Group์ด ๋ฏธ๋ฆฌ ์์ฑ๋์ด ์์ด์ผ ํจ
-
Cluster Type ๊ตฌ๋ถ:
- Type-I (AWS, Alibaba, Tencent): Cluster ์์ฑ ํ NodeGroup ๋ณ๋ ์ถ๊ฐ
- Type-II (Azure, GCP, IBM, NHN, NCP): Cluster ์์ฑ ์ ์ต์ 1๊ฐ ์ด์์ NodeGroup ํ์
-
Subnet ์๊ตฌ์ฌํญ:
- AWS: ์๋ก ๋ค๋ฅธ Zone์ 2๊ฐ ์ด์ Subnet ํ์
-
Azure: Subnet CIDR์ด 333 Address ์ด์ ํ์ (์:
/24=256๊ฐ,/23=510๊ฐ)
-
Role ์ค์ :
- AWS: Cluster Role, NodeGroup Role ์๋ ์์ฑ๋จ
- Azure, Tencent: ๊ด๋ จ Role ์ค์ ํ์
-
์ด๋ฏธ์ง ์ ํ:
- ์ผ๋ถ CSP๋ ์ด๋ฏธ์ง ์ ํ์ด ์ ํ๋๊ฑฐ๋ ์ง์ํ์ง ์์
- AWS: ImageName ๋ฏธ์ค์ ์ Default AMI Type(
AL2023_x86_64_STANDARD) ์๋ ์ค์ - Tencent: ์ง์ ๋ OS Name ๋ชฉ๋ก์์ ์ ํ ํ์
- VMSpec ์ ํ: CSP๋ณ๋ก ์ง์ํ๋ VMSpec์ด ๋ค๋ฆ
- Disk ์ค์ : CSP๋ณ๋ก ์ง์ํ๋ Disk Type ๋ฐ Size๊ฐ ๋ค๋ฆ
- NodeGroup ํ์ธ: Cluster ์ญ์ ์ ์ ๋ชจ๋ NodeGroup์ด ์ญ์ ๋์ด์ผ ํจ (force=false์ธ ๊ฒฝ์ฐ)
- ๊ฐ์ ์ญ์ : force=true ์ต์ ์ฌ์ฉ ์ NodeGroup์ด ์์ด๋ ๊ฐ์ ์ญ์ ๋จ (์ฃผ์!)
- ์ํฌ๋ก๋ ํ์ธ: Cluster ์ญ์ ์ ์ ์คํ ์ค์ธ Pod ๋ฐ ์ํฌ๋ก๋๋ฅผ ํ์ธํ๊ณ ๋ฐฑ์ ํ์
- CB-Spider๋ ๊ธฐ๋ณธ์ ์ผ๋ก CB-Spider credential-based Kubeconfig๋ฅผ ์ ๊ณตํ๋ฉฐ, CSP native plugin์ ์ฌ์ฉํ๋ Native Kubeconfig๋ ์ง์ํฉ๋๋ค.
- Kubeconfig ํ์ฉ ๋ฐฉ๋ฒ ๋ฐ ์์ธ ์ฃผ์์ฌํญ์ CB-Spider Kubeconfig ํ์ฉ ๊ฐ์ด๋๋ฅผ ์ฐธ๊ณ ํ์ธ์.
-
์ฃผ์ ์ฃผ์์ฌํญ:
- CB-Spider credential-based Kubeconfig ์ฌ์ฉ ์ CB-Spider ์๋ฒ๊ฐ ์คํ ์ค์ด์ด์ผ ํจ
- Native Kubeconfig ์ฌ์ฉ ์ CSP๋ณ ์ธ์ฆ Plugin(aws-iam-authenticator, gke-gcloud-auth-plugin ๋ฑ) ์ค์น ๋ฐ ์ธ์ฆ ์ค์ ํ์
-
Version ํ์: CSP๋ณ๋ก ๋ฒ์ ํ์์ด ๋ค๋ฆ
- AWS: "1.30", "1.29" ๋ฑ
- GCP: "1.29.1-gke.1234567" ๋ฑ
- NHN: "v1.29.3" ๋ฑ
-
Version Upgrade:
- ์ผ๋ถ CSP๋ง Upgrade API ์ง์ (์ ์ฒด ๊ฒ์ฆ ํ์)
- Major ๋ฒ์ ์ ๊ทธ๋ ์ด๋๋ ์ง์ํ์ง ์์ ์ ์์
- NodeGroup๋ณ๋ก ๋ณ๋ ์ ๊ทธ๋ ์ด๋๊ฐ ํ์ํ ์ ์์
-
AutoScaling ์ค์ :
- OnAutoScaling=true: ์๋์ผ๋ก ๋ ธ๋ ๊ฐ์ ์กฐ์
- OnAutoScaling=false: ์๋์ผ๋ก ๋ ธ๋ ๊ฐ์ ์กฐ์
- ๋ ธ๋ ๊ฐ์ ์กฐ๊ฑด: DesiredNodeSize๋ MinNodeSize์ MaxNodeSize ์ฌ์ด์ฌ์ผ ํจ
Kubernetes์์ PersistentVolumeClaim(PVC)๋ฅผ ์์ฑํ์ฌ ๋์ ์ผ๋ก ๋ณผ๋ฅจ์ ํ๋ก๋น์ ๋ํ ์ ์์ต๋๋ค. CSP๋ณ๋ก ๋ค์๊ณผ ๊ฐ์ด ์ค์ ์ด ํ์ํฉ๋๋ค:
- GCP, Azure: ๊ธฐ๋ณธ StorageClass๋ฅผ ์ ๊ณตํ๋ฏ๋ก ๋ฐ๋ก PVC ์์ฑ ๊ฐ๋ฅ
- AWS: ์ ์ ํ StorageClass๋ฅผ ์ ๊ณตํ์ง ์์ผ๋ฏ๋ก, ๊ธฐ๋ณธ StorageClass๋ฅผ ๋ฑ๋ก(ebs-sc.yaml)ํ๋ฉด ๊ฐ๋ฅ
- NHN: ์ ์ ํ StorageClass๋ฅผ ์ ๊ณตํ์ง ์์ผ๋ฏ๋ก, ๊ธฐ๋ณธ StorageClass๋ฅผ ๋ฑ๋ก(cinder-sc.yaml)ํ๋ฉด ๊ฐ๋ฅ
- Alibaba: StorageClass๋ฅผ ์ ๊ณตํ๋ฏ๋ก PVC ์์ฑ์ ๋ช ์ํ๊ณ 20GB ์ด์ ์ง์ ํ์
- Tencent: ๊ธฐ๋ณธ StorageClass๋ฅผ ์ ๊ณตํ๋ฏ๋ก ๋ฐ๋ก PVC ์์ฑ ๊ฐ๋ฅํ๋ 10GB ์ด์ ์ง์ ํ์