هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
gcloud works like az and aws: gcloud GROUP COMMAND. Everything belongs to a project; set it once with gcloud config set project. gcloud auth login is for you, service accounts or Workload Identity Federation are for CI (no long-lived keys).
It is part of the Google Cloud CLI, together with gsutil / gcloud storage and bq.
طريقة الكتابة
gcloud GROUP [SUBGROUP] COMMAND [OPTIONS]الأجزاء الرئيسية
Main groups
authlogin/authlist- Log in / show accounts.
configset|list|configurations- Defaults (project, region) and profiles.
projectslist- Your projects.
computeinstances…- VMs (create, list, ssh, stop).
containerclusters…- GKE clusters and their credentials.
rundeploy|services- Cloud Run.
storagels|cp- Cloud Storage buckets.
iamservice-accounts/projectsadd-iam-policy-binding- Identities and roles.
artifactsrepositories/docker- Artifact Registry.
loggingread- Read logs.
الخيارات 7
الأكثر استخدامًا
Common flags
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 11
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Log in and set the default project
gcloud auth login gcloud config set project acme-shop-prod gcloud config set compute/region europe-west42One profile per environment
gcloud config configurations create dev gcloud config configurations activate prod3Get kubeconfig for a GKE cluster
gcloud container clusters get-credentials shop-gke --region europe-west4 kubectl get nodes4Create a small VM
gcloud compute instances create web-1 --zone europe-west4-a --machine-type e2-small --image-family rocky-linux-9 --image-project rocky-linux-cloud5SSH through IAP (no public IP)
gcloud compute ssh web-1 --zone europe-west4-a --tunnel-through-iap6Deploy a container to Cloud Run
gcloud run deploy shop --image europe-west4-docker.pkg.dev/acme/apps/shop:1.4.0 --region europe-west4 --no-allow-unauthenticated7Docker login for Artifact Registry
gcloud auth configure-docker europe-west4-docker.pkg.dev8Only names and states, as values for a script
gcloud compute instances list --filter="status=RUNNING" --format="value(name,zone)"9Give a service account a role (least privilege)
gcloud projects add-iam-policy-binding acme-shop-prod --member="serviceAccount:ci@acme-shop-prod.iam.gserviceaccount.com" --role="roles/run.developer"10Read the last errors of Cloud Run
gcloud logging read 'resource.type="cloud_run_revision" AND severity>=ERROR' --limit 20 --freshness 1h11Copy files to a bucket
gcloud storage cp backup.tar.gz gs://acme-backups/2026-10-31/
لا يوجد شيء يطابق هذا الفلتر.
انتبه
- Service account key files are long-lived secrets; prefer Workload Identity Federation for GitHub Actions.
- Check the active project (
gcloud config list) before you delete anything.
الملفات
~/.config/gcloud/- Credentials and configurations.
رموز الخروج
0 | OK. |
1 | Error. |