콘텐츠로 이동

DigitalOcean CLI (문서)

포괄적인 디지털 (주) Droplets, 로드밸런서, 데이터베이스 및 Kubernetes 클러스터 관리를위한 CLI 명령 및 워크플로우.

설치 및 인증

| | Command | Description | | | --- | --- | | | doctl auth init | Initialize authentication | | | | doctl auth list | List authentication contexts | | | | doctl auth switch --context CONTEXT_NAME | Switch authentication context | | | | doctl account get | Get account information | | | | doctl balance get | Get account balance | |

Droplets (가상 기계)

Droplet 관리

| | Command | Description | | | --- | --- | | | doctl compute droplet list | List all droplets | | | | doctl compute droplet create mydroplet --size s-1vcpu-1gb --image ubuntu-20-04-x64 --region nyc1 | Create droplet | | | | doctl compute droplet delete DROPLET_ID | Delete droplet | | | | doctl compute droplet get DROPLET_ID | Get droplet details | | | | doctl compute droplet reboot DROPLET_ID | Reboot droplet | | | | doctl compute droplet power-off DROPLET_ID | Power off droplet | | | | doctl compute droplet power-on DROPLET_ID | Power on droplet | | | | doctl compute droplet shutdown DROPLET_ID | Shutdown droplet | |

Droplet 활동

| | Command | Description | | | --- | --- | | | doctl compute droplet-action list DROPLET_ID | List droplet actions | | | | doctl compute droplet-action resize DROPLET_ID --size s-2vcpu-2gb | Resize droplet | | | | doctl compute droplet-action snapshot DROPLET_ID --snapshot-name my-snapshot | Create snapshot | | | | doctl compute droplet-action restore DROPLET_ID --image IMAGE_ID | Restore from image | | | | doctl compute droplet-action rebuild DROPLET_ID --image ubuntu-20-04-x64 | Rebuild droplet | |

SSH 및 액세스

| | Command | Description | | | --- | --- | | | doctl compute ssh DROPLET_NAME | SSH into droplet | | | | doctl compute ssh DROPLET_NAME --ssh-user root | SSH with specific user | | | | doctl compute ssh-key list | List SSH keys | | | | doctl compute ssh-key create --name mykey --public-key-file ~/.ssh/id_rsa.pub | Add SSH key | | | | doctl compute ssh-key delete KEY_ID | Delete SSH key | |

이미지 및 Snapshots

| | Command | Description | | | --- | --- | | | doctl compute image list | List all images | | | | doctl compute image list --public | List public images | | | | doctl compute image list-user | List user images | | | | doctl compute image get IMAGE_ID | Get image details | | | | doctl compute image delete IMAGE_ID | Delete image | | | | doctl compute image update IMAGE_ID --name new-name | Update image name | |

볼륨 (블록 저장)

| | Command | Description | | | --- | --- | | | doctl compute volume list | List all volumes | | | | doctl compute volume create myvolume --size 100GiB --region nyc1 | Create volume | | | | doctl compute volume delete VOLUME_ID | Delete volume | | | | doctl compute volume attach VOLUME_ID DROPLET_ID | Attach volume to droplet | | | | doctl compute volume detach VOLUME_ID | Detach volume | | | | doctl compute volume snapshot VOLUME_ID --snapshot-name my-volume-snapshot | Create volume snapshot | |

로드밸런서

| | Command | Description | | | --- | --- | | | doctl compute load-balancer list | List load balancers | | | | doctl compute load-balancer create --name mylb --forwarding-rules entry_protocol:http,entry_port:80,target_protocol:http,target_port:80 --region nyc1 | Create load balancer | | | | doctl compute load-balancer delete LB_ID | Delete load balancer | | | | doctl compute load-balancer add-droplets LB_ID --droplet-ids DROPLET_ID1,DROPLET_ID2 | Add droplets to LB | | | | doctl compute load-balancer remove-droplets LB_ID --droplet-ids DROPLET_ID1 | Remove droplets from LB | |

사업영역

방화벽

| | Command | Description | | | --- | --- | | | doctl compute firewall list | List firewalls | | | | doctl compute firewall create --name myfirewall --inbound-rules protocol:tcp,ports:22,sources:0.0.0.0/0 | Create firewall | | | | doctl compute firewall delete FIREWALL_ID | Delete firewall | | | | doctl compute firewall add-droplets FIREWALL_ID --droplet-ids DROPLET_ID | Add droplets to firewall | | | | doctl compute firewall remove-droplets FIREWALL_ID --droplet-ids DROPLET_ID | Remove droplets from firewall | |

모형: VPC 네트워크

| | Command | Description | | | --- | --- | | | doctl vpcs list | List VPCs | | | | doctl vpcs create --name myvpc --region nyc1 | Create VPC | | | | doctl vpcs delete VPC_ID | Delete VPC | | | | doctl vpcs get VPC_ID | Get VPC details | |

뜨 IPs

| | Command | Description | | | --- | --- | | | doctl compute floating-ip list | List floating IPs | | | | doctl compute floating-ip create --region nyc1 | Create floating IP | | | | doctl compute floating-ip delete FLOATING_IP | Delete floating IP | | | | doctl compute floating-ip-action assign FLOATING_IP DROPLET_ID | Assign floating IP | | | | doctl compute floating-ip-action unassign FLOATING_IP | Unassign floating IP | |

쿠버네티스 (DOKS)

Cluster 관리

| | Command | Description | | | --- | --- | | | doctl kubernetes cluster list | List Kubernetes clusters | | | | doctl kubernetes cluster create mycluster --region nyc1 --node-pool "name=worker-pool;size=s-2vcpu-2gb;count=3" | Create cluster | | | | doctl kubernetes cluster delete CLUSTER_ID | Delete cluster | | | | doctl kubernetes cluster get CLUSTER_ID | Get cluster details | | | | doctl kubernetes cluster kubeconfig save CLUSTER_ID | Save kubeconfig | |

노드 풀

| | Command | Description | | | --- | --- | | | doctl kubernetes cluster node-pool list CLUSTER_ID | List node pools | | | | doctl kubernetes cluster node-pool create CLUSTER_ID --name new-pool --size s-2vcpu-2gb --count 2 | Create node pool | | | | doctl kubernetes cluster node-pool delete CLUSTER_ID POOL_ID | Delete node pool | | | | doctl kubernetes cluster node-pool resize CLUSTER_ID POOL_ID --count 5 | Resize node pool | |

데이터베이스

데이터베이스 클러스터

| | Command | Description | | | --- | --- | | | doctl databases list | List database clusters | | | | doctl databases create mydb --engine mysql --size db-s-1vcpu-1gb --region nyc1 | Create database cluster | | | | doctl databases delete DATABASE_ID | Delete database cluster | | | | doctl databases get DATABASE_ID | Get database details | | | | doctl databases resize DATABASE_ID --size db-s-2vcpu-2gb | Resize database | |

Database 운영

| | Command | Description | | | --- | --- | | | doctl databases db list DATABASE_ID | List databases | | | | doctl databases db create DATABASE_ID --name myapp | Create database | | | | doctl databases db delete DATABASE_ID myapp | Delete database | | | | doctl databases user list DATABASE_ID | List database users | | | | doctl databases user create DATABASE_ID --username myuser | Create database user | |

데이터베이스 백업

| | Command | Description | | | --- | --- | | | doctl databases backups list DATABASE_ID | List backups | | | | doctl databases backups restore DATABASE_ID BACKUP_ID | Restore from backup | |

공간 (Object Storage)

| | Command | Description | | | --- | --- | | | doctl compute cdn list | List CDN endpoints | | | | doctl compute cdn create --origin spaces.example.com --domain cdn.example.com | Create CDN endpoint | | | | doctl compute cdn delete CDN_ID | Delete CDN endpoint | |

앱 플랫폼

앱 관리

| | Command | Description | | | --- | --- | | | doctl apps list | List apps | | | | doctl apps create --spec app.yaml | Create app from spec | | | | doctl apps get APP_ID | Get app details | | | | doctl apps delete APP_ID | Delete app | | | | doctl apps update APP_ID --spec app.yaml | Update app | |

앱 배포

| | Command | Description | | | --- | --- | | | doctl apps list-deployments APP_ID | List deployments | | | | doctl apps get-deployment APP_ID DEPLOYMENT_ID | Get deployment details | | | | doctl apps logs APP_ID --type build | Get build logs | | | | doctl apps logs APP_ID --type run | Get runtime logs | |

관련 기사

제품정보

| | Command | Description | | | --- | --- | | | doctl monitoring alert list | List alert policies | | | | doctl monitoring alert create --spec alert.yaml | Create alert policy | | | | doctl monitoring alert delete ALERT_ID | Delete alert policy | | | | doctl monitoring alert get ALERT_ID | Get alert details | |

프로젝트

| | Command | Description | | | --- | --- | | | doctl projects list | List projects | | | | doctl projects create --name myproject --description "My project" | Create project | | | | doctl projects get PROJECT_ID | Get project details | | | | doctl projects update PROJECT_ID --name "New name" | Update project | | | | doctl projects resources list PROJECT_ID | List project resources | |

지역 및 크기

| | Command | Description | | | --- | --- | | | doctl compute region list | List available regions | | | | doctl compute size list | List available droplet sizes | | | | doctl kubernetes options regions | List Kubernetes regions | | | | doctl kubernetes options versions | List Kubernetes versions | | | | doctl databases options engines | List database engines | | | | doctl databases options sizes | List database sizes | |