Zum Inhalt springen

DigitalOcean CLI (doctl)

Umfassende DigitalOcean CLI-Befehle und Workflows zum Verwalten von Droplets, Load Balancern, Datenbanken und Kubernetes-Clustern.

Installation & Authentifizierung

BefehlBeschreibung
doctl auth initAuthentication initialisieren
doctl auth listListe von Authentifizierungskontexten
doctl auth switch --context CONTEXT_NAMEAuthentifizierungskontext wechseln
doctl account getKontoinformationen abrufen
doctl balance getKontostand abrufen

Droplets (Virtuelle Maschinen)

Droplet-Verwaltung

BefehlBeschreibung
doctl compute droplet listAlle Droplets auflisten
doctl compute droplet create mydroplet --size s-1vcpu-1gb --image ubuntu-20-04-x64 --region nyc1Droplet erstellen
doctl compute droplet delete DROPLET_IDDroplet löschen
doctl compute droplet get DROPLET_IDDroplet-Details abrufen
doctl compute droplet reboot DROPLET_IDDroplet neu starten
doctl compute droplet power-off DROPLET_IDDroplet ausschalten
doctl compute droplet power-on DROPLET_IDDroplet einschalten
doctl compute droplet shutdown DROPLET_IDDroplet herunterfahren

Droplet-Aktionen

BefehlBeschreibung
doctl compute droplet-action list DROPLET_IDDroplet-Aktionen auflisten
doctl compute droplet-action resize DROPLET_ID --size s-2vcpu-2gbDroplet ändern
doctl compute droplet-action snapshot DROPLET_ID --snapshot-name my-snapshotSnapshot erstellen
doctl compute droplet-action restore DROPLET_ID --image IMAGE_IDVon Bild wiederherstellen
doctl compute droplet-action rebuild DROPLET_ID --image ubuntu-20-04-x64Droplet neu aufbauen

SSH und Zugriff

BefehlBeschreibung
doctl compute ssh DROPLET_NAMESSH in Droplet
doctl compute ssh DROPLET_NAME --ssh-user rootSSH mit spezifischem Benutzer
doctl compute ssh-key listSSH-Schlüssel auflisten
doctl compute ssh-key create --name mykey --public-key-file ~/.ssh/id_rsa.pubSSH-Schlüssel hinzufügen
doctl compute ssh-key delete KEY_IDSSH-Schlüssel löschen

Images und Snapshots

BefehlBeschreibung
doctl compute image listAlle Bilder auflisten
doctl compute image list --publicÖffentliche Images auflisten
doctl compute image list-userBenutzerbild-Liste
doctl compute image get IMAGE_IDBild-Details abrufen
doctl compute image delete IMAGE_IDBild löschen
doctl compute image update IMAGE_ID --name new-nameBildname aktualisieren

Volumes (Blockspeicher)

BefehlBeschreibung
doctl compute volume listAlle Volumes auflisten
doctl compute volume create myvolume --size 100GiB --region nyc1Volume erstellen
doctl compute volume delete VOLUME_IDVolume löschen
doctl compute volume attach VOLUME_ID DROPLET_IDVolume an Droplet anhängen
doctl compute volume detach VOLUME_IDBand trennen
doctl compute volume snapshot VOLUME_ID --snapshot-name my-volume-snapshotVolume-Snapshot erstellen

Load Balancers

BefehlBeschreibung
doctl compute load-balancer listLoad Balancer auflisten
doctl compute load-balancer create --name mylb --forwarding-rules entry_protocol:http,entry_port:80,target_protocol:http,target_port:80 --region nyc1Load Balancer erstellen
doctl compute load-balancer delete LB_IDLoad Balancer löschen
doctl compute load-balancer add-droplets LB_ID --droplet-ids DROPLET_ID1,DROPLET_ID2Tropfen zu LB hinzufügen
doctl compute load-balancer remove-droplets LB_ID --droplet-ids DROPLET_ID1Tropfen von LB entfernen

Netzwerk

Firewalls

BefehlBeschreibung
doctl compute firewall listListe von Firewalls
doctl compute firewall create --name myfirewall --inbound-rules protocol:tcp,ports:22,sources:0.0.0.0/0Firewall erstellen
doctl compute firewall delete FIREWALL_IDFirewall löschen
doctl compute firewall add-droplets FIREWALL_ID --droplet-ids DROPLET_IDDroplets zum Firewall hinzufügen
doctl compute firewall remove-droplets FIREWALL_ID --droplet-ids DROPLET_IDDroplets vom Firewall entfernen

VPC-Netzwerke

BefehlBeschreibung
doctl vpcs listVPCs auflisten
doctl vpcs create --name myvpc --region nyc1VPC erstellen
doctl vpcs delete VPC_IDVPC löschen
doctl vpcs get VPC_IDVPC-Details abrufen

Floating IPs

BefehlBeschreibung
doctl compute floating-ip listListe von Floating IPs
doctl compute floating-ip create --region nyc1Floating IP erstellen
doctl compute floating-ip delete FLOATING_IPFloating IP löschen
doctl compute floating-ip-action assign FLOATING_IP DROPLET_IDFloating IP zuweisen
doctl compute floating-ip-action unassign FLOATING_IPFloating IP aufheben

Kubernetes (DOKS)

Cluster-Verwaltung

BefehlBeschreibung
doctl kubernetes cluster listKubernetes-Cluster auflisten
doctl kubernetes cluster create mycluster --region nyc1 --node-pool "name=worker-pool;size=s-2vcpu-2gb;count=3"Cluster erstellen
doctl kubernetes cluster delete CLUSTER_IDCluster löschen
doctl kubernetes cluster get CLUSTER_IDCluster-Details abrufen
doctl kubernetes cluster kubeconfig save CLUSTER_IDkubeconfig speichern

Node Pools

BefehlBeschreibung
doctl kubernetes cluster node-pool list CLUSTER_IDListe von Knotenpools
doctl kubernetes cluster node-pool create CLUSTER_ID --name new-pool --size s-2vcpu-2gb --count 2Node-Pool erstellen
doctl kubernetes cluster node-pool delete CLUSTER_ID POOL_IDKnotenpool löschen
doctl kubernetes cluster node-pool resize CLUSTER_ID POOL_ID --count 5Größe des Knotenpools ändern

Datenbanken

Datenbank-Cluster

BefehlBeschreibung
doctl databases listDatenbankcluster auflisten
doctl databases create mydb --engine mysql --size db-s-1vcpu-1gb --region nyc1Datenbankcluster erstellen
doctl databases delete DATABASE_IDDatenbankcluster löschen
doctl databases get DATABASE_IDDatenbank-Details abrufen
doctl databases resize DATABASE_ID --size db-s-2vcpu-2gbGröße der Datenbank ändern

Datenbank-Operationen

BefehlBeschreibung
doctl databases db list DATABASE_IDDatenbanken auflisten
doctl databases db create DATABASE_ID --name myappDatenbank erstellen
doctl databases db delete DATABASE_ID myappDatenbank löschen
doctl databases user list DATABASE_IDDatenbankbenutzer auflisten
doctl databases user create DATABASE_ID --username myuserDatenbankbenutzer erstellen

Datenbank-Backups

BefehlBeschreibung
doctl databases backups list DATABASE_IDSicherungskopien auflisten
doctl databases backups restore DATABASE_ID BACKUP_IDVon Backup wiederherstellen

Spaces (Objektspeicher)

BefehlBeschreibung
doctl compute cdn listCDN-Endpunkte auflisten
doctl compute cdn create --origin spaces.example.com --domain cdn.example.comCDN-Endpunkt erstellen
doctl compute cdn delete CDN_IDCDN-Endpunkt löschen

Apps Platform

App-Verwaltung

BefehlBeschreibung
doctl apps listApps auflisten
doctl apps create --spec app.yamlApp aus Spezifikation erstellen
doctl apps get APP_IDApp-Details abrufen
doctl apps delete APP_IDApp löschen
doctl apps update APP_ID --spec app.yamlApp aktualisieren

App-Bereitstellungen

BefehlBeschreibung
doctl apps list-deployments APP_IDDeployments auflisten
doctl apps get-deployment APP_ID DEPLOYMENT_IDDeployment-Details abrufen
doctl apps logs APP_ID --type buildBuild-Protokolle abrufen
doctl apps logs APP_ID --type runLaufzeit-Logs abrufen

Monitoring

Warnungen

Would you like me to continue with the remaining sections?

BefehlBeschreibung
doctl monitoring alert listListe von Warnungsrichtlinien
doctl monitoring alert create --spec alert.yamlWarnungsrichtlinie erstellen
doctl monitoring alert delete ALERT_IDWarnrichtlinie löschen
doctl monitoring alert get ALERT_IDAlert-Details abrufen

Projekte

BefehlBeschreibung
doctl projects listProjekte auflisten
doctl projects create --name myproject --description "My project"Projekt erstellen
doctl projects get PROJECT_IDProjektdetails abrufen
doctl projects update PROJECT_ID --name "New name"Projekt aktualisieren
doctl projects resources list PROJECT_IDProjektressourcen auflisten

Regionen und Größen

BefehlBeschreibung
doctl compute region listVerfügbare Regionen auflisten
doctl compute size listVerfügbare Droplet-Größen auflisten
doctl kubernetes options regionsKubernetes-Regionen auflisten
doctl kubernetes options versionsKubernetes-Versionen auflisten
doctl databases options enginesDatenbankengines auflisten
doctl databases options sizesDatenbankgrößen auflisten