Zum Inhalt

DigitalOcean CLI (doctl)

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

Installation & Authentifizierung

Befehl Beschreibung
doctl auth init Authentication initialisieren
doctl auth list Liste von Authentifizierungskontexten
doctl auth switch --context CONTEXT_NAME Authentifizierungskontext wechseln
doctl account get Kontoinformationen abrufen
doctl balance get Kontostand abrufen
## Droplets (Virtuelle Maschinen)

Droplet-Verwaltung

Befehl Beschreibung
doctl compute droplet list Alle Droplets auflisten
doctl compute droplet create mydroplet --size s-1vcpu-1gb --image ubuntu-20-04-x64 --region nyc1 Droplet erstellen
doctl compute droplet delete DROPLET_ID Droplet löschen
doctl compute droplet get DROPLET_ID Droplet-Details abrufen
doctl compute droplet reboot DROPLET_ID Droplet neu starten
doctl compute droplet power-off DROPLET_ID Droplet ausschalten
doctl compute droplet power-on DROPLET_ID Droplet einschalten
doctl compute droplet shutdown DROPLET_ID Droplet herunterfahren
### Droplet-Aktionen
Befehl Beschreibung
--------- -------------
doctl compute droplet-action list DROPLET_ID Droplet-Aktionen auflisten
doctl compute droplet-action resize DROPLET_ID --size s-2vcpu-2gb Droplet ändern
doctl compute droplet-action snapshot DROPLET_ID --snapshot-name my-snapshot Snapshot erstellen
doctl compute droplet-action restore DROPLET_ID --image IMAGE_ID Von Bild wiederherstellen
doctl compute droplet-action rebuild DROPLET_ID --image ubuntu-20-04-x64 Droplet neu aufbauen
### SSH und Zugriff
Befehl Beschreibung
--------- -------------
doctl compute ssh DROPLET_NAME SSH in Droplet
doctl compute ssh DROPLET_NAME --ssh-user root SSH mit spezifischem Benutzer
doctl compute ssh-key list SSH-Schlüssel auflisten
doctl compute ssh-key create --name mykey --public-key-file ~/.ssh/id_rsa.pub SSH-Schlüssel hinzufügen
doctl compute ssh-key delete KEY_ID SSH-Schlüssel löschen
## Images und Snapshots
Befehl Beschreibung
doctl compute image list Alle Bilder auflisten
doctl compute image list --public Öffentliche Images auflisten
doctl compute image list-user Benutzerbild-Liste
doctl compute image get IMAGE_ID Bild-Details abrufen
doctl compute image delete IMAGE_ID Bild löschen
doctl compute image update IMAGE_ID --name new-name Bildname aktualisieren
## Volumes (Blockspeicher)
Befehl Beschreibung
doctl compute volume list Alle Volumes auflisten
doctl compute volume create myvolume --size 100GiB --region nyc1 Volume erstellen
doctl compute volume delete VOLUME_ID Volume löschen
doctl compute volume attach VOLUME_ID DROPLET_ID Volume an Droplet anhängen
doctl compute volume detach VOLUME_ID Band trennen
doctl compute volume snapshot VOLUME_ID --snapshot-name my-volume-snapshot Volume-Snapshot erstellen
## Load Balancers
Befehl Beschreibung
doctl compute load-balancer list Load Balancer auflisten
doctl compute load-balancer create --name mylb --forwarding-rules entry_protocol:http,entry_port:80,target_protocol:http,target_port:80 --region nyc1 Load Balancer erstellen
doctl compute load-balancer delete LB_ID Load Balancer löschen
doctl compute load-balancer add-droplets LB_ID --droplet-ids DROPLET_ID1,DROPLET_ID2 Tropfen zu LB hinzufügen
doctl compute load-balancer remove-droplets LB_ID --droplet-ids DROPLET_ID1 Tropfen von LB entfernen
## Netzwerk

Firewalls

Befehl Beschreibung
doctl compute firewall list Liste von Firewalls
doctl compute firewall create --name myfirewall --inbound-rules protocol:tcp,ports:22,sources:0.0.0.0/0 Firewall erstellen
doctl compute firewall delete FIREWALL_ID Firewall löschen
doctl compute firewall add-droplets FIREWALL_ID --droplet-ids DROPLET_ID Droplets zum Firewall hinzufügen
doctl compute firewall remove-droplets FIREWALL_ID --droplet-ids DROPLET_ID Droplets vom Firewall entfernen
### VPC-Netzwerke
Befehl Beschreibung
--------- -------------
doctl vpcs list VPCs auflisten
doctl vpcs create --name myvpc --region nyc1 VPC erstellen
doctl vpcs delete VPC_ID VPC löschen
doctl vpcs get VPC_ID VPC-Details abrufen
### Floating IPs
Befehl Beschreibung
--------- -------------
doctl compute floating-ip list Liste von Floating IPs
doctl compute floating-ip create --region nyc1 Floating IP erstellen
doctl compute floating-ip delete FLOATING_IP Floating IP löschen
doctl compute floating-ip-action assign FLOATING_IP DROPLET_ID Floating IP zuweisen
doctl compute floating-ip-action unassign FLOATING_IP Floating IP aufheben
## Kubernetes (DOKS)

Cluster-Verwaltung

Befehl Beschreibung
doctl kubernetes cluster list Kubernetes-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_ID Cluster löschen
doctl kubernetes cluster get CLUSTER_ID Cluster-Details abrufen
doctl kubernetes cluster kubeconfig save CLUSTER_ID kubeconfig speichern
### Node Pools
Befehl Beschreibung
--------- -------------
doctl kubernetes cluster node-pool list CLUSTER_ID Liste von Knotenpools
doctl kubernetes cluster node-pool create CLUSTER_ID --name new-pool --size s-2vcpu-2gb --count 2 Node-Pool erstellen
doctl kubernetes cluster node-pool delete CLUSTER_ID POOL_ID Knotenpool löschen
doctl kubernetes cluster node-pool resize CLUSTER_ID POOL_ID --count 5 Größe des Knotenpools ändern
## Datenbanken

Datenbank-Cluster

Befehl Beschreibung
doctl databases list Datenbankcluster auflisten
doctl databases create mydb --engine mysql --size db-s-1vcpu-1gb --region nyc1 Datenbankcluster erstellen
doctl databases delete DATABASE_ID Datenbankcluster löschen
doctl databases get DATABASE_ID Datenbank-Details abrufen
doctl databases resize DATABASE_ID --size db-s-2vcpu-2gb Größe der Datenbank ändern
### Datenbank-Operationen
Befehl Beschreibung
--------- -------------
doctl databases db list DATABASE_ID Datenbanken auflisten
doctl databases db create DATABASE_ID --name myapp Datenbank erstellen
doctl databases db delete DATABASE_ID myapp Datenbank löschen
doctl databases user list DATABASE_ID Datenbankbenutzer auflisten
doctl databases user create DATABASE_ID --username myuser Datenbankbenutzer erstellen
### Datenbank-Backups
Befehl Beschreibung
--------- -------------
doctl databases backups list DATABASE_ID Sicherungskopien auflisten
doctl databases backups restore DATABASE_ID BACKUP_ID Von Backup wiederherstellen
## Spaces (Objektspeicher)
Befehl Beschreibung
doctl compute cdn list CDN-Endpunkte auflisten
doctl compute cdn create --origin spaces.example.com --domain cdn.example.com CDN-Endpunkt erstellen
doctl compute cdn delete CDN_ID CDN-Endpunkt löschen
## Apps Platform

App-Verwaltung

Befehl Beschreibung
doctl apps list Apps auflisten
doctl apps create --spec app.yaml App aus Spezifikation erstellen
doctl apps get APP_ID App-Details abrufen
doctl apps delete APP_ID App löschen
doctl apps update APP_ID --spec app.yaml App aktualisieren
### App-Bereitstellungen
Befehl Beschreibung
--------- -------------
doctl apps list-deployments APP_ID Deployments auflisten
doctl apps get-deployment APP_ID DEPLOYMENT_ID Deployment-Details abrufen
doctl apps logs APP_ID --type build Build-Protokolle abrufen
doctl apps logs APP_ID --type run Laufzeit-Logs abrufen
## Monitoring

Warnungen

Would you like me to continue with the remaining sections? | Befehl | Beschreibung | |---------|-------------| | doctl monitoring alert list | Liste von Warnungsrichtlinien | | doctl monitoring alert create --spec alert.yaml | Warnungsrichtlinie erstellen | | doctl monitoring alert delete ALERT_ID | Warnrichtlinie löschen | | doctl monitoring alert get ALERT_ID | Alert-Details abrufen |

Projekte

Befehl Beschreibung
doctl projects list Projekte auflisten
doctl projects create --name myproject --description "My project" Projekt erstellen
doctl projects get PROJECT_ID Projektdetails abrufen
doctl projects update PROJECT_ID --name "New name" Projekt aktualisieren
doctl projects resources list PROJECT_ID Projektressourcen auflisten
## Regionen und Größen
Befehl Beschreibung
--------- -------------
doctl compute region list Verfügbare Regionen auflisten
doctl compute size list Verfügbare Droplet-Größen auflisten
doctl kubernetes options regions Kubernetes-Regionen auflisten
doctl kubernetes options versions Kubernetes-Versionen auflisten
doctl databases options engines Datenbankengines auflisten
doctl databases options sizes Datenbankgrößen auflisten