@bifos/nhncloud-cli 0.5.1 → 0.6.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 +92 -1
- package/dist/index.js +1396 -19
- package/package.json +1 -1
- package/skills/nhncloud-cli/SKILL.md +102 -3
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nhncloud-cli
|
|
3
|
-
description: NHN Cloud 서비스 CLI. 자격증명 설정(configure), Log & Crash 로그 검색·전송(logncrash search/send), Deploy 배포 실행·바이너리 그룹·바이너리 목록 조회·업로드·다운로드(deploy upload/download), Compute 인스턴스 관리(instance
|
|
3
|
+
description: NHN Cloud 서비스 CLI. 자격증명 설정(configure), Log & Crash 로그 검색·전송(logncrash search/send/export), Deploy 배포 실행·바이너리 그룹·바이너리 목록 조회·업로드·다운로드(deploy upload/download), Compute 인스턴스 관리(instance), VPC·서브넷 조회(network), Block Storage(volume), Floating IP(floatingip), NHN Container Registry(ncr), NHN Kubernetes Service(nks supports/cluster/nodegroup/addon/kubeconfig) 등 NHN Cloud API 를 터미널·AI 에이전트에서 호출한다.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# nhncloud-cli
|
|
7
7
|
|
|
8
|
-
NHN Cloud
|
|
9
|
-
`configure`, `logncrash search/send`, `deploy`, `instance
|
|
8
|
+
NHN Cloud 서비스를 AWS CLI 방식으로 호출하는 TypeScript CLI.
|
|
9
|
+
`configure`, `logncrash search/send/export`, `deploy`, `instance`, `network`, `volume`, `floatingip`, `ncr`, `nks` 명령을 지원한다.
|
|
10
10
|
|
|
11
11
|
## 설치
|
|
12
12
|
|
|
@@ -108,6 +108,19 @@ logncrash appkey 와 secret 은 콘솔 → Log & Crash Search → 프로젝트
|
|
|
108
108
|
| `ncr get` | `registry` 래퍼를 언랩한 단일 registry 객체 |
|
|
109
109
|
| `ncr images` | repository 배열 |
|
|
110
110
|
| `ncr tags` | tag 배열 |
|
|
111
|
+
| `nks supports` | 지원 Kubernetes version / event type 객체 |
|
|
112
|
+
| `nks cluster list` | cluster 배열 |
|
|
113
|
+
| `nks cluster events` | event 배열 |
|
|
114
|
+
| `nks nodegroup list` | nodegroup 배열 |
|
|
115
|
+
| `nks addon-type list` | addon type 배열 |
|
|
116
|
+
| `nks addon list` | addon 배열 |
|
|
117
|
+
| `nks cluster addon list` | cluster addon 배열 |
|
|
118
|
+
|
|
119
|
+
NKS 단건 조회는 API 객체를 그대로 반환한다.
|
|
120
|
+
예를 들어 `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 객체를 보존한다.
|
|
121
|
+
NKS 쓰기 명령 중 생성·resize·설정 변경·노드 action·애드온 변경은 `{ uuid }` 응답을 반환한다.
|
|
122
|
+
삭제 명령은 성공 메시지만 stderr에 쓰고 stdout은 비운다.
|
|
123
|
+
`nks cluster kubeconfig` 는 kubeconfig 문자열을 stdout 또는 파일로 저장한다.
|
|
111
124
|
|
|
112
125
|
예: `nhncloud instance get <instance-id> --json`은 `.server.status`가 아니라 `.status`를 읽는다.
|
|
113
126
|
|
|
@@ -133,6 +146,12 @@ logncrash appkey 와 secret 은 콘솔 → Log & Crash Search → 프로젝트
|
|
|
133
146
|
| NCR 이미지 목록 (JSON) | `nhncloud ncr images <registry> --json` |
|
|
134
147
|
| NCR 태그 목록 조회 | `nhncloud ncr tags <registry> <repository>` |
|
|
135
148
|
| NCR 태그 목록 (JSON) | `nhncloud ncr tags <registry> <repository> --json` |
|
|
149
|
+
| NKS 지원 버전 조회 | `nhncloud nks supports --json` |
|
|
150
|
+
| NKS 클러스터 목록 조회 | `nhncloud nks cluster list --json` |
|
|
151
|
+
| NKS kubeconfig 저장 | `nhncloud nks cluster kubeconfig <cluster> --output ./kubeconfig` |
|
|
152
|
+
| NKS 노드 그룹 목록 조회 | `nhncloud nks nodegroup list <cluster> --json` |
|
|
153
|
+
| NKS 애드온 목록 조회 | `nhncloud nks addon list --k8s-version v1.30.1 --json` |
|
|
154
|
+
| NKS 클러스터 애드온 설치 | `nhncloud nks cluster addon install <cluster> --name coredns --version 1.0.0 --resolve-conflicts overwrite` |
|
|
136
155
|
|
|
137
156
|
## logncrash search 옵션
|
|
138
157
|
|
|
@@ -741,3 +760,83 @@ nhncloud ncr tags <registry> <repository> --json | jq 'sort_by(.push_time) | las
|
|
|
741
760
|
| registry / repository 인수 공백·빈값 | 3 (PARAM_ERROR) |
|
|
742
761
|
| UAK 인증 실패 (401/403) | 2 (AUTH_ERROR) |
|
|
743
762
|
| NCR API 오류 | 1 (API_ERROR) |
|
|
763
|
+
|
|
764
|
+
## nks — NHN Kubernetes Service 관리
|
|
765
|
+
|
|
766
|
+
NKS는 `iaas` 자격증명으로 Keystone 토큰을 발급하고 `container-infra` API를 호출한다.
|
|
767
|
+
AI 에이전트는 조회 작업에 `--json`을 우선 사용한다.
|
|
768
|
+
지원 region은 `kr1`, `kr2`, `kr3` 이다.
|
|
769
|
+
|
|
770
|
+
### 조회 시나리오
|
|
771
|
+
|
|
772
|
+
| 의도 | 커맨드 |
|
|
773
|
+
|------|--------|
|
|
774
|
+
| 지원 Kubernetes version / event type 확인 | `nhncloud nks supports --json` |
|
|
775
|
+
| 클러스터 목록 조회 | `nhncloud nks cluster list --json` |
|
|
776
|
+
| 클러스터 상세 조회 | `nhncloud nks cluster get <cluster> --json` |
|
|
777
|
+
| 작업 이력 조회 | `nhncloud nks cluster events <cluster> --json` |
|
|
778
|
+
| 작업 이력 단건 조회 | `nhncloud nks cluster event <cluster> <event> --json` |
|
|
779
|
+
| API endpoint IP ACL 조회 | `nhncloud nks cluster ipacl <cluster> --json` |
|
|
780
|
+
| kubeconfig stdout 출력 | `nhncloud nks cluster kubeconfig <cluster>` |
|
|
781
|
+
| kubeconfig 파일 저장 | `nhncloud nks cluster kubeconfig <cluster> --output ./kubeconfig` |
|
|
782
|
+
| 노드 그룹 목록 조회 | `nhncloud nks nodegroup list <cluster> --json` |
|
|
783
|
+
| 노드 그룹 autoscale 조회 | `nhncloud nks nodegroup autoscale <cluster> <nodegroup> --json` |
|
|
784
|
+
| 애드온 타입 조회 | `nhncloud nks addon-type list --json` |
|
|
785
|
+
| 애드온 타입 단건 조회 | `nhncloud nks addon-type get <addon-type> --json` |
|
|
786
|
+
| 설치 가능 애드온 조회 | `nhncloud nks addon list --k8s-version v1.30.1 --json` |
|
|
787
|
+
| 설치 가능 애드온 단건 조회 | `nhncloud nks addon get <addon> --json` |
|
|
788
|
+
| 클러스터 설치 애드온 조회 | `nhncloud nks cluster addon list <cluster> --json` |
|
|
789
|
+
| 클러스터 설치 애드온 단건 조회 | `nhncloud nks cluster addon get <cluster> <addon> --json` |
|
|
790
|
+
|
|
791
|
+
### 쓰기 시나리오
|
|
792
|
+
|
|
793
|
+
복잡한 생성·변경 작업은 공식 API payload를 JSON 파일로 전달한다.
|
|
794
|
+
삭제·제거 명령은 비대화형 환경에서 `--yes` 가 필요하다.
|
|
795
|
+
payload 원문에는 appkey 같은 민감값이 들어갈 수 있으므로 로그에 출력하지 않는다.
|
|
796
|
+
|
|
797
|
+
```bash
|
|
798
|
+
# 생성
|
|
799
|
+
nhncloud nks cluster create --file ./cluster-create.json
|
|
800
|
+
nhncloud nks nodegroup create <cluster> --file ./nodegroup-create.json
|
|
801
|
+
|
|
802
|
+
# 클러스터 변경
|
|
803
|
+
nhncloud nks cluster resize <cluster> --nodegroup worker --node-count 3
|
|
804
|
+
nhncloud nks cluster set-ipacl <cluster> --file ./ipacl.json
|
|
805
|
+
nhncloud nks cluster renew-certificate <cluster> --term-of-validity 3
|
|
806
|
+
nhncloud nks cluster update-sgw <cluster> --ncr-sgw <uuid> --obs-sgw <uuid>
|
|
807
|
+
nhncloud nks cluster set-control-plane-log <cluster> --file ./control-plane-log.json
|
|
808
|
+
|
|
809
|
+
# 노드 그룹 변경
|
|
810
|
+
nhncloud nks nodegroup stop-node <cluster> worker --nodes node-1,node-2
|
|
811
|
+
nhncloud nks nodegroup start-node <cluster> worker --nodes node-1,node-2
|
|
812
|
+
nhncloud nks nodegroup set-autoscale <cluster> worker --file ./autoscale.json
|
|
813
|
+
nhncloud nks nodegroup set-metric-autoscale <cluster> worker --file ./metric-autoscale.json
|
|
814
|
+
nhncloud nks nodegroup upgrade <cluster> worker --version v1.30.1
|
|
815
|
+
nhncloud nks nodegroup set-userscript <cluster> worker --file ./userscript.sh
|
|
816
|
+
nhncloud nks nodegroup update-flavor <cluster> worker --flavor <flavor-uuid>
|
|
817
|
+
nhncloud nks nodegroup set-fip-auto-bind <cluster> worker --file ./fip-auto-bind.json
|
|
818
|
+
nhncloud nks nodegroup set-labels <cluster> worker --file ./labels.json
|
|
819
|
+
|
|
820
|
+
# 애드온 변경
|
|
821
|
+
nhncloud nks cluster addon install <cluster> \
|
|
822
|
+
--name coredns \
|
|
823
|
+
--version 1.0.0 \
|
|
824
|
+
--resolve-conflicts overwrite
|
|
825
|
+
|
|
826
|
+
nhncloud nks cluster addon update <cluster> coredns \
|
|
827
|
+
--version 1.0.1 \
|
|
828
|
+
--resolve-conflicts preserve
|
|
829
|
+
|
|
830
|
+
nhncloud nks cluster addon remove <cluster> coredns --yes
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
### nks 에러 코드
|
|
834
|
+
|
|
835
|
+
| 상황 | exit code |
|
|
836
|
+
|------|-----------|
|
|
837
|
+
| `iaas` 자격증명 누락·불완전 | 4 (CONFIG_ERROR) |
|
|
838
|
+
| Keystone 또는 NKS 인증 실패 (401/403) | 2 (AUTH_ERROR) |
|
|
839
|
+
| 지원하지 않는 NKS region | 3 (PARAM_ERROR) |
|
|
840
|
+
| payload JSON 파일 파싱 실패 | 3 (PARAM_ERROR) |
|
|
841
|
+
| 위험 명령에서 비대화형 `--yes` 누락 | 3 (PARAM_ERROR) |
|
|
842
|
+
| NKS API 오류 / 응답 형식 불일치 | 1 (API_ERROR) |
|