콘텐츠로 이동

DigitalOcean CLI (doctl)

디지털오션 CLI 명령어와 워크플로우에 대한 포괄적인 가이드로, 드롭렛, 로드 밸런서, 데이터베이스, 쿠버네티스 클러스터를 관리합니다.

설치 및 인증

명령어설명
doctl auth init인증 초기화
doctl auth list인증 컨텍스트 목록
doctl auth switch --context CONTEXT_NAME인증 컨텍스트 전환
doctl account get계정 정보 가져오기
doctl balance get계정 잔액 확인

드롭렛 (가상 머신)

드롭렛 관리

명령어설명
doctl compute droplet list모든 droplets 나열하기
doctl compute droplet create mydroplet --size s-1vcpu-1gb --image ubuntu-20-04-x64 --region nyc1드롭렛 생성
doctl compute droplet delete DROPLET_ID드롭렛 삭제
doctl compute droplet get DROPLET_ID드롭렛 세부 정보 가져오기
doctl compute droplet reboot DROPLET_ID드롭렛 재부팅
doctl compute droplet power-off DROPLET_ID드롭렛 전원 끄기
doctl compute droplet power-on DROPLET_ID드롭렛 전원 켜기
doctl compute droplet shutdown DROPLET_ID드롭렛 종료

드롭렛 작업

명령어설명
doctl compute droplet-action list DROPLET_ID드롭렛 작업 목록
doctl compute droplet-action resize DROPLET_ID --size s-2vcpu-2gb드롭렛 크기 조정
doctl compute droplet-action snapshot DROPLET_ID --snapshot-name my-snapshot스냅샷 생성
doctl compute droplet-action restore DROPLET_ID --image IMAGE_ID이미지에서 복원
doctl compute droplet-action rebuild DROPLET_ID --image ubuntu-20-04-x64드롭렛 재구축

SSH 및 접근

명령어설명
doctl compute ssh DROPLET_NAMEdroplet에 SSH로 접속하기
doctl compute ssh DROPLET_NAME --ssh-user root특정 사용자로 SSH 연결하기
doctl compute ssh-key listSSH 키 목록
doctl compute ssh-key create --name mykey --public-key-file ~/.ssh/id_rsa.pubSSH 키 추가
doctl compute ssh-key delete KEY_IDSSH 키 삭제

이미지 및 스냅샷

명령어설명
doctl compute image list모든 이미지 나열하기
doctl compute image list --public공개 이미지 목록
doctl compute image list-user사용자 이미지 목록
doctl compute image get IMAGE_ID이미지 세부 정보 가져오기
doctl compute image delete IMAGE_ID이미지 삭제
doctl compute image update IMAGE_ID --name new-name이미지 이름 업데이트

볼륨 (블록 스토리지)

명령어설명
doctl compute volume list모든 볼륨 나열하기
doctl compute volume create myvolume --size 100GiB --region nyc1볼륨 생성
doctl compute volume delete VOLUME_ID볼륨 삭제
doctl compute volume attach VOLUME_ID DROPLET_ID볼륨을 드롭렛에 연결
doctl compute volume detach VOLUME_ID볼륨 분리
doctl compute volume snapshot VOLUME_ID --snapshot-name my-volume-snapshot볼륨 스냅샷 생성

로드 밸런서

명령어설명
doctl compute load-balancer list로드 밸런서 목록
doctl compute load-balancer create --name mylb --forwarding-rules entry_protocol:http,entry_port:80,target_protocol:http,target_port:80 --region nyc1로드 밸런서 생성
doctl compute load-balancer delete LB_ID로드 밸런서 삭제
doctl compute load-balancer add-droplets LB_ID --droplet-ids DROPLET_ID1,DROPLET_ID2LB에 드롭렛 추가
doctl compute load-balancer remove-droplets LB_ID --droplet-ids DROPLET_ID1LB에서 방울 제거

네트워킹

방화벽

명령어설명
doctl compute firewall list방화벽 목록
doctl compute firewall create --name myfirewall --inbound-rules protocol:tcp,ports:22,sources:0.0.0.0/0방화벽 생성
doctl compute firewall delete FIREWALL_ID방화벽 삭제
doctl compute firewall add-droplets FIREWALL_ID --droplet-ids DROPLET_ID방화벽에 droplets 추가
doctl compute firewall remove-droplets FIREWALL_ID --droplet-ids DROPLET_ID방화벽에서 드롭릿 제거

VPC 네트워크

명령어설명
doctl vpcs listVPC 목록
doctl vpcs create --name myvpc --region nyc1VPC 생성
doctl vpcs delete VPC_IDVPC 삭제
doctl vpcs get VPC_IDVPC 세부 정보 가져오기

플로팅 IP

명령어설명
doctl compute floating-ip list부동 IP 나열
doctl compute floating-ip create --region nyc1부동 IP 생성
doctl compute floating-ip delete FLOATING_IP부동 IP 삭제
doctl compute floating-ip-action assign FLOATING_IP DROPLET_ID부동 IP 할당
doctl compute floating-ip-action unassign FLOATING_IP부동 IP 할당 해제

쿠버네티스 (DOKS)

클러스터 관리

명령어설명
doctl kubernetes cluster listKubernetes 클러스터 나열
doctl kubernetes cluster create mycluster --region nyc1 --node-pool "name=worker-pool;size=s-2vcpu-2gb;count=3"클러스터 생성
doctl kubernetes cluster delete CLUSTER_ID클러스터 삭제
doctl kubernetes cluster get CLUSTER_ID클러스터 세부 정보 가져오기
doctl kubernetes cluster kubeconfig save CLUSTER_IDkubeconfig 저장하기

노드 풀

명령어설명
doctl kubernetes cluster node-pool list CLUSTER_ID노드 풀 나열하기
doctl kubernetes cluster node-pool create CLUSTER_ID --name new-pool --size s-2vcpu-2gb --count 2노드 풀 생성
doctl kubernetes cluster node-pool delete CLUSTER_ID POOL_ID노드 풀 삭제
doctl kubernetes cluster node-pool resize CLUSTER_ID POOL_ID --count 5노드 풀 크기 조정

데이터베이스

데이터베이스 클러스터

명령어설명
doctl databases list데이터베이스 클러스터 목록
doctl databases create mydb --engine mysql --size db-s-1vcpu-1gb --region nyc1데이터베이스 클러스터 생성
doctl databases delete DATABASE_ID데이터베이스 클러스터 삭제
doctl databases get DATABASE_ID데이터베이스 세부 정보 가져오기
doctl databases resize DATABASE_ID --size db-s-2vcpu-2gb데이터베이스 크기 조정

데이터베이스 작업

명령어설명
doctl databases db list DATABASE_ID데이터베이스 목록
doctl databases db create DATABASE_ID --name myapp데이터베이스 생성
doctl databases db delete DATABASE_ID myapp데이터베이스 삭제
doctl databases user list DATABASE_ID데이터베이스 사용자 목록
doctl databases user create DATABASE_ID --username myuser데이터베이스 사용자 생성

데이터베이스 백업

명령어설명
doctl databases backups list DATABASE_ID백업 목록
doctl databases backups restore DATABASE_ID BACKUP_ID백업에서 복원

스페이스 (객체 스토리지)

명령어설명
doctl compute cdn listCDN 엔드포인트 목록
doctl compute cdn create --origin spaces.example.com --domain cdn.example.comCDN 엔드포인트 생성
doctl compute cdn delete CDN_IDCDN 엔드포인트 삭제

앱 플랫폼

앱 관리

명령어설명
doctl apps list앱 목록
doctl apps create --spec app.yaml사양에서 앱 생성
doctl apps get APP_ID앱 세부 정보 가져오기
doctl apps delete APP_ID앱 삭제
doctl apps update APP_ID --spec app.yaml앱 업데이트

앱 배포

명령어설명
doctl apps list-deployments APP_ID배포 목록
doctl apps get-deployment APP_ID DEPLOYMENT_ID배포 세부 정보 가져오기
doctl apps logs APP_ID --type build빌드 로그 가져오기
doctl apps logs APP_ID --type run런타임 로그 가져오기

모니터링

알림

Would you like me to continue with the remaining sections? I noticed that some sections (3-20) are currently empty. If you have specific content for those sections, I can translate them as well.

명령어설명
doctl monitoring alert list경고 정책 목록
doctl monitoring alert create --spec alert.yaml경고 정책 생성
doctl monitoring alert delete ALERT_ID경고 정책 삭제
doctl monitoring alert get ALERT_ID알림 세부 정보 가져오기

프로젝트

명령어설명
doctl projects list프로젝트 목록
doctl projects create --name myproject --description "My project"프로젝트 생성
doctl projects get PROJECT_ID프로젝트 세부 정보 가져오기
doctl projects update PROJECT_ID --name "New name"프로젝트 업데이트
doctl projects resources list PROJECT_ID프로젝트 리소스 목록

지역 및 크기

명령어설명
doctl compute region list사용 가능한 지역 목록
doctl compute size list사용 가능한 드롭렛 크기 목록
doctl kubernetes options regionsKubernetes 리전 목록
doctl kubernetes options versionsKubernetes 버전 목록
doctl databases options engines데이터베이스 엔진 목록
doctl databases options sizes데이터베이스 크기 목록