@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 CHANGED
@@ -1,7 +1,8 @@
1
1
  # nhncloud-cli
2
2
 
3
3
  NHN Cloud 서비스를 AWS CLI 방식으로 호출하는 통합 CLI.
4
- 현재 `configure`, `logncrash search/send` (Log & Crash 로그 검색·전송), `deploy` (배포·바이너리 조회·업로드·다운로드), `instance` (Compute 인스턴스 목록·발급·전원 제어·타입 변경·키페어 관리·이미지·가용성 영역 조회·볼륨 연결 포함), `network` (VPC·서브넷 목록 조회), `volume` (Block Storage 볼륨 목록·조회·생성), `ncr` (NHN Container Registry 레지스트리 목록·조회·이미지 목록·태그 목록) 명령을 지원한다.
4
+ 현재 81개 명령을 지원한다.
5
+ `configure`, `logncrash search/send/export`, `deploy`, `instance`, `network`, `volume`, `floatingip`, `ncr`, `nks` 명령으로 NHN Cloud 서비스를 조회·운영할 수 있다.
5
6
 
6
7
  ## 설치
7
8
 
@@ -228,6 +229,19 @@ NHN Cloud 또는 OpenStack 원본 응답의 최상위 래퍼를 그대로 보존
228
229
  | `ncr get` | `registry` 래퍼를 언랩한 단일 registry 객체 |
229
230
  | `ncr images` | repository 배열 |
230
231
  | `ncr tags` | tag 배열 |
232
+ | `nks supports` | 지원 Kubernetes version / event type 객체 |
233
+ | `nks cluster list` | cluster 배열 |
234
+ | `nks cluster events` | event 배열 |
235
+ | `nks nodegroup list` | nodegroup 배열 |
236
+ | `nks addon-type list` | addon type 배열 |
237
+ | `nks addon list` | addon 배열 |
238
+ | `nks cluster addon list` | cluster addon 배열 |
239
+
240
+ NKS의 단건 조회는 API 객체를 그대로 반환한다.
241
+ 예를 들어 `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 객체를 보존한다.
242
+ NKS 쓰기 명령 중 생성·resize·설정 변경·노드 action·애드온 변경은 `{ uuid }` 응답을 반환한다.
243
+ 삭제 명령은 성공 메시지만 stderr에 쓰고 stdout은 비운다.
244
+ `nks cluster kubeconfig` 는 kubeconfig 문자열을 stdout 또는 파일로 저장한다.
231
245
 
232
246
  예를 들어 `instance get --json`은 `.server.status`가 아니라 `.status`를 읽는다.
233
247
 
@@ -544,6 +558,82 @@ nhncloud ncr tags <registry> <repository>
544
558
  nhncloud ncr tags <registry> <repository> --json
545
559
  ```
546
560
 
561
+ ### NHN Kubernetes Service (NKS)
562
+
563
+ NKS는 `iaas` 자격증명으로 Keystone 토큰을 발급하고 `container-infra` API를 호출한다.
564
+ 지원 region은 `kr1`, `kr2`, `kr3` 이다.
565
+
566
+ ```bash
567
+ # 지원 Kubernetes version / event type 조회
568
+ nhncloud nks supports
569
+
570
+ # 클러스터와 노드 그룹 조회
571
+ nhncloud nks cluster list
572
+ nhncloud nks cluster get <cluster>
573
+ nhncloud nks cluster events <cluster>
574
+ nhncloud nks cluster event <cluster> <event>
575
+ nhncloud nks cluster ipacl <cluster>
576
+ nhncloud nks nodegroup list <cluster>
577
+ nhncloud nks nodegroup get <cluster> <nodegroup>
578
+ nhncloud nks nodegroup autoscale <cluster> <nodegroup>
579
+
580
+ # kubeconfig stdout 출력 또는 mode 0600 파일 저장
581
+ nhncloud nks cluster kubeconfig <cluster>
582
+ nhncloud nks cluster kubeconfig <cluster> --output ./kubeconfig
583
+ nhncloud nks cluster kubeconfig <cluster> --output ./kubeconfig --force
584
+
585
+ # 애드온 조회
586
+ nhncloud nks addon-type list
587
+ nhncloud nks addon-type get <addon-type>
588
+ nhncloud nks addon list --k8s-version v1.30.1
589
+ nhncloud nks addon get <addon>
590
+ nhncloud nks cluster addon list <cluster>
591
+ nhncloud nks cluster addon get <cluster> <addon>
592
+ ```
593
+
594
+ 복잡한 쓰기 작업은 공식 API payload를 JSON 파일로 전달한다.
595
+ 삭제·제거 명령은 비대화형 환경에서 `--yes` 가 필요하다.
596
+
597
+ ```bash
598
+ # 클러스터 / 노드 그룹 생성
599
+ nhncloud nks cluster create --file ./cluster-create.json
600
+ nhncloud nks nodegroup create <cluster> --file ./nodegroup-create.json
601
+
602
+ # resize / upgrade
603
+ nhncloud nks cluster resize <cluster> --nodegroup worker --node-count 3
604
+ nhncloud nks nodegroup upgrade <cluster> worker --version v1.30.1
605
+
606
+ # 삭제 / 노드 action
607
+ nhncloud nks cluster delete <cluster> --yes
608
+ nhncloud nks nodegroup delete <cluster> worker --yes
609
+ nhncloud nks nodegroup stop-node <cluster> worker --nodes node-1,node-2
610
+ nhncloud nks nodegroup start-node <cluster> worker --nodes node-1,node-2
611
+
612
+ # 애드온 설치 / 업데이트 / 제거
613
+ nhncloud nks cluster addon install <cluster> \
614
+ --name coredns \
615
+ --version 1.0.0 \
616
+ --resolve-conflicts overwrite
617
+
618
+ nhncloud nks cluster addon update <cluster> coredns \
619
+ --version 1.0.1 \
620
+ --resolve-conflicts preserve
621
+
622
+ nhncloud nks cluster addon remove <cluster> coredns --yes
623
+
624
+ # payload 파일 기반 변경
625
+ nhncloud nks cluster set-ipacl <cluster> --file ./ipacl.json
626
+ nhncloud nks cluster renew-certificate <cluster> --term-of-validity 3
627
+ nhncloud nks cluster update-sgw <cluster> --ncr-sgw <uuid> --obs-sgw <uuid>
628
+ nhncloud nks cluster set-control-plane-log <cluster> --file ./control-plane-log.json
629
+ nhncloud nks nodegroup set-autoscale <cluster> worker --file ./autoscale.json
630
+ nhncloud nks nodegroup set-metric-autoscale <cluster> worker --file ./metric-autoscale.json
631
+ nhncloud nks nodegroup set-userscript <cluster> worker --file ./userscript.sh
632
+ nhncloud nks nodegroup update-flavor <cluster> worker --flavor <flavor-uuid>
633
+ nhncloud nks nodegroup set-fip-auto-bind <cluster> worker --file ./fip-auto-bind.json
634
+ nhncloud nks nodegroup set-labels <cluster> worker --file ./labels.json
635
+ ```
636
+
547
637
  ## 개발
548
638
 
549
639
  ```bash
@@ -553,4 +643,5 @@ pnpm tsc --noEmit # 타입 체크
553
643
  node dist/index.js instance --help
554
644
  node dist/index.js logncrash search --help
555
645
  node dist/index.js ncr --help
646
+ node dist/index.js nks --help
556
647
  ```