@bifos/nhncloud-cli 0.5.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -1
- package/dist/index.js +1614 -115
- package/package.json +1 -1
- package/skills/nhncloud-cli/SKILL.md +49 -729
- package/skills/nhncloud-cli/references/common.md +134 -0
- package/skills/nhncloud-cli/references/deploy.md +112 -0
- package/skills/nhncloud-cli/references/iaas.md +126 -0
- package/skills/nhncloud-cli/references/logncrash.md +126 -0
- package/skills/nhncloud-cli/references/ncr.md +73 -0
- package/skills/nhncloud-cli/references/nks.md +95 -0
- package/skills/nhncloud-cli/references/troubleshooting.md +91 -0
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# nhncloud-cli
|
|
2
2
|
|
|
3
3
|
NHN Cloud 서비스를 AWS CLI 방식으로 호출하는 통합 CLI.
|
|
4
|
-
현재
|
|
4
|
+
현재 98개 command catalog 항목을 지원한다.
|
|
5
|
+
`configure`, `commands`, `logncrash search/send/export`, `deploy`, `instance`, `network`, `volume`, `floatingip`, `ncr`, `nks` 명령으로 NHN Cloud 서비스를 조회·운영할 수 있다.
|
|
5
6
|
|
|
6
7
|
## 설치
|
|
7
8
|
|
|
@@ -199,8 +200,21 @@ nhncloud logncrash send --body "deploy 시작" --app-version 2.3.0 --source batc
|
|
|
199
200
|
`--json`은 CLI가 가공한 출력 계약이다.
|
|
200
201
|
NHN Cloud 또는 OpenStack 원본 응답의 최상위 래퍼를 그대로 보존하지 않을 수 있다.
|
|
201
202
|
|
|
203
|
+
### 자동화와 AI 에이전트
|
|
204
|
+
|
|
205
|
+
명령 경로, 인수, 옵션은 `nhncloud commands --json`으로 확인한다.
|
|
206
|
+
이 명령은 외부 API를 호출하지 않고 Commander tree metadata만 stdout에 출력한다.
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
nhncloud commands --json | jq '.commands[] | select(.path=="nks cluster list")'
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
root와 주요 service group의 `--help`에는 짧은 agent hint가 포함된다.
|
|
213
|
+
긴 사용법은 README와 공개 skill reference를 기준으로 확인한다.
|
|
214
|
+
|
|
202
215
|
| 명령 | `--json` 출력 shape |
|
|
203
216
|
|------|---------------------|
|
|
217
|
+
| `commands` | `{ commands: [{ path, description, arguments, options, subcommands }] }` |
|
|
204
218
|
| `logncrash search` | `{ totalItems, pageNumber, pageSize, data }` 객체 |
|
|
205
219
|
| `logncrash export` | 파일 출력 전용. stdout JSON 없음 |
|
|
206
220
|
| `deploy artifacts` | Deploy API `body` 객체 |
|
|
@@ -228,6 +242,19 @@ NHN Cloud 또는 OpenStack 원본 응답의 최상위 래퍼를 그대로 보존
|
|
|
228
242
|
| `ncr get` | `registry` 래퍼를 언랩한 단일 registry 객체 |
|
|
229
243
|
| `ncr images` | repository 배열 |
|
|
230
244
|
| `ncr tags` | tag 배열 |
|
|
245
|
+
| `nks supports` | 지원 Kubernetes version / event type 객체 |
|
|
246
|
+
| `nks cluster list` | cluster 배열 |
|
|
247
|
+
| `nks cluster events` | event 배열 |
|
|
248
|
+
| `nks nodegroup list` | nodegroup 배열 |
|
|
249
|
+
| `nks addon-type list` | addon type 배열 |
|
|
250
|
+
| `nks addon list` | addon 배열 |
|
|
251
|
+
| `nks cluster addon list` | cluster addon 배열 |
|
|
252
|
+
|
|
253
|
+
NKS의 단건 조회는 API 객체를 그대로 반환한다.
|
|
254
|
+
예를 들어 `nks cluster get`, `nks cluster event`, `nks nodegroup get`, `nks addon-type get`, `nks addon get`, `nks cluster addon get`, `nks cluster ipacl`, `nks nodegroup autoscale` 은 table 출력용 최소 컬럼을 만들고 `--json` 에서는 raw 객체를 보존한다.
|
|
255
|
+
NKS 쓰기 명령 중 생성·resize·설정 변경·노드 action·애드온 변경은 `{ uuid }` 응답을 반환한다.
|
|
256
|
+
삭제 명령은 성공 메시지만 stderr에 쓰고 stdout은 비운다.
|
|
257
|
+
`nks cluster kubeconfig` 는 kubeconfig 문자열을 stdout 또는 파일로 저장한다.
|
|
231
258
|
|
|
232
259
|
예를 들어 `instance get --json`은 `.server.status`가 아니라 `.status`를 읽는다.
|
|
233
260
|
|
|
@@ -457,6 +484,9 @@ nhncloud volume create --size 10
|
|
|
457
484
|
# 이름·타입 지정
|
|
458
485
|
nhncloud volume create --size 50 --name my-volume --volume-type "General SSD"
|
|
459
486
|
|
|
487
|
+
# 인스턴스와 같은 가용성 영역에 생성
|
|
488
|
+
nhncloud volume create --size 50 --volume-type "General SSD" --availability-zone kr-pub-a
|
|
489
|
+
|
|
460
490
|
# 인스턴스에 연결된 볼륨 목록 조회
|
|
461
491
|
nhncloud instance volumes <instance-id>
|
|
462
492
|
|
|
@@ -544,6 +574,82 @@ nhncloud ncr tags <registry> <repository>
|
|
|
544
574
|
nhncloud ncr tags <registry> <repository> --json
|
|
545
575
|
```
|
|
546
576
|
|
|
577
|
+
### NHN Kubernetes Service (NKS)
|
|
578
|
+
|
|
579
|
+
NKS는 `iaas` 자격증명으로 Keystone 토큰을 발급하고 `container-infra` API를 호출한다.
|
|
580
|
+
지원 region은 `kr1`, `kr2`, `kr3` 이다.
|
|
581
|
+
|
|
582
|
+
```bash
|
|
583
|
+
# 지원 Kubernetes version / event type 조회
|
|
584
|
+
nhncloud nks supports
|
|
585
|
+
|
|
586
|
+
# 클러스터와 노드 그룹 조회
|
|
587
|
+
nhncloud nks cluster list
|
|
588
|
+
nhncloud nks cluster get <cluster>
|
|
589
|
+
nhncloud nks cluster events <cluster>
|
|
590
|
+
nhncloud nks cluster event <cluster> <event>
|
|
591
|
+
nhncloud nks cluster ipacl <cluster>
|
|
592
|
+
nhncloud nks nodegroup list <cluster>
|
|
593
|
+
nhncloud nks nodegroup get <cluster> <nodegroup>
|
|
594
|
+
nhncloud nks nodegroup autoscale <cluster> <nodegroup>
|
|
595
|
+
|
|
596
|
+
# kubeconfig stdout 출력 또는 mode 0600 파일 저장
|
|
597
|
+
nhncloud nks cluster kubeconfig <cluster>
|
|
598
|
+
nhncloud nks cluster kubeconfig <cluster> --output ./kubeconfig
|
|
599
|
+
nhncloud nks cluster kubeconfig <cluster> --output ./kubeconfig --force
|
|
600
|
+
|
|
601
|
+
# 애드온 조회
|
|
602
|
+
nhncloud nks addon-type list
|
|
603
|
+
nhncloud nks addon-type get <addon-type>
|
|
604
|
+
nhncloud nks addon list --k8s-version v1.30.1
|
|
605
|
+
nhncloud nks addon get <addon>
|
|
606
|
+
nhncloud nks cluster addon list <cluster>
|
|
607
|
+
nhncloud nks cluster addon get <cluster> <addon>
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
복잡한 쓰기 작업은 공식 API payload를 JSON 파일로 전달한다.
|
|
611
|
+
삭제·제거 명령은 비대화형 환경에서 `--yes` 가 필요하다.
|
|
612
|
+
|
|
613
|
+
```bash
|
|
614
|
+
# 클러스터 / 노드 그룹 생성
|
|
615
|
+
nhncloud nks cluster create --file ./cluster-create.json
|
|
616
|
+
nhncloud nks nodegroup create <cluster> --file ./nodegroup-create.json
|
|
617
|
+
|
|
618
|
+
# resize / upgrade
|
|
619
|
+
nhncloud nks cluster resize <cluster> --nodegroup worker --node-count 3
|
|
620
|
+
nhncloud nks nodegroup upgrade <cluster> worker --version v1.30.1
|
|
621
|
+
|
|
622
|
+
# 삭제 / 노드 action
|
|
623
|
+
nhncloud nks cluster delete <cluster> --yes
|
|
624
|
+
nhncloud nks nodegroup delete <cluster> worker --yes
|
|
625
|
+
nhncloud nks nodegroup stop-node <cluster> worker --nodes node-1,node-2
|
|
626
|
+
nhncloud nks nodegroup start-node <cluster> worker --nodes node-1,node-2
|
|
627
|
+
|
|
628
|
+
# 애드온 설치 / 업데이트 / 제거
|
|
629
|
+
nhncloud nks cluster addon install <cluster> \
|
|
630
|
+
--name coredns \
|
|
631
|
+
--version 1.0.0 \
|
|
632
|
+
--resolve-conflicts overwrite
|
|
633
|
+
|
|
634
|
+
nhncloud nks cluster addon update <cluster> coredns \
|
|
635
|
+
--version 1.0.1 \
|
|
636
|
+
--resolve-conflicts preserve
|
|
637
|
+
|
|
638
|
+
nhncloud nks cluster addon remove <cluster> coredns --yes
|
|
639
|
+
|
|
640
|
+
# payload 파일 기반 변경
|
|
641
|
+
nhncloud nks cluster set-ipacl <cluster> --file ./ipacl.json
|
|
642
|
+
nhncloud nks cluster renew-certificate <cluster> --term-of-validity 3
|
|
643
|
+
nhncloud nks cluster update-sgw <cluster> --ncr-sgw <uuid> --obs-sgw <uuid>
|
|
644
|
+
nhncloud nks cluster set-control-plane-log <cluster> --file ./control-plane-log.json
|
|
645
|
+
nhncloud nks nodegroup set-autoscale <cluster> worker --file ./autoscale.json
|
|
646
|
+
nhncloud nks nodegroup set-metric-autoscale <cluster> worker --file ./metric-autoscale.json
|
|
647
|
+
nhncloud nks nodegroup set-userscript <cluster> worker --file ./userscript.sh
|
|
648
|
+
nhncloud nks nodegroup update-flavor <cluster> worker --flavor <flavor-uuid>
|
|
649
|
+
nhncloud nks nodegroup set-fip-auto-bind <cluster> worker --file ./fip-auto-bind.json
|
|
650
|
+
nhncloud nks nodegroup set-labels <cluster> worker --file ./labels.json
|
|
651
|
+
```
|
|
652
|
+
|
|
547
653
|
## 개발
|
|
548
654
|
|
|
549
655
|
```bash
|
|
@@ -553,4 +659,6 @@ pnpm tsc --noEmit # 타입 체크
|
|
|
553
659
|
node dist/index.js instance --help
|
|
554
660
|
node dist/index.js logncrash search --help
|
|
555
661
|
node dist/index.js ncr --help
|
|
662
|
+
node dist/index.js nks --help
|
|
663
|
+
node dist/index.js commands --json
|
|
556
664
|
```
|