Skillpedia
النشر والسحابة (DevOps)22k · #10305

gke-workload-troubleshooting

ما الذي تفعله

تكتشف هذه المهارة سبب فشل تطبيق يعمل في حاوية Google Kubernetes Engine. وهي مخصصة للمطورين الذين تتعطل حاوياتهم أو تعيد التشغيل أو لا تبدأ أبدًا.

متى تستخدمها

  • ✓عندما تتعطل الـ Pods باستمرار أو تدخل في CrashLoopBackOff على GKE.
  • ✓عندما تبقى الـ Pods في Pending أو ImagePullBackOff ولا تبدأ.
  • ✓عندما تُقتل الـ Pod لنفاد الذاكرة على GKE.

رابط المهارة

https://github.com/google/skills/blob/main/skills/cloud/gke-workload-troubleshooting/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/google/skills/blob/main/skills/cloud/gke-workload-troubleshooting/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“الـ Pod الخاص بي على GKE يعيد التشغيل باستمرار مع CrashLoopBackOff. افحص السجلات والأحداث وأخبرني ما الخطأ.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تقرأ سجلات حمل العمل وأحداثه ضمن نافذة زمنية، وتحدد السبب الأرجح وتقترح إصلاحًا. ولا تغيّر شيئًا مباشرةً، فأنت من يطبّق التصحيحات المقترحة.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

GKE Workload Troubleshooting Skill

Use this skill to systematically diagnose and resolve failures in application workloads deployed in GKE clusters. This skill operates non-interactively and enforces a read-only diagnostics boundary: it only proposes fixes — whether Kubernetes manifest/config patches or Google Cloud changes (for example gcloud IAM bindings or node-pool recreation) — and never executes live mutations itself.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-workload-troubleshooting)" and append agent-skills/1.0 (skill:gke-workload-troubleshooting) to User-Agent headers.

🔍 Diagnostic Workflow

Step 0: Non-Interactive Context Discovery & Time Window Definition

  1. Parameter Extraction: Extract required context (project_id, cluster_name, cluster_location, workload_name, workload_namespace) non-interactively from the user prompt, active SETTINGS.md, or active environment defaults:

    • Default workload_namespace to default if omitted.
    • Infer missing cluster parameters from active environment (kubectl config current-context or gcloud config get-value project).
    • Prioritize non-interactive context discovery from prompts and environment defaults to ensure autonomous execution flow.
  2. Cluster Credentials & Fallback Mode:

    • Attempt credential fetch: gcloud container clusters get-credentials {cluster_name} --region/--zone {cluster_location}
    • Fallback / Dry-Run Mode: If the cluster is unreachable, non-existent, or live command execution fails (such as in sandboxed evaluations, dry-run mode, or offline analysis):
      • Limit retry attempts to avoid resource exhaustion and context overflow in unreachable cluster scenarios.
      • Immediately present the exact sequence of kubectl diagnostic commands for the human operator to run.
      • Synthesize the root cause analysis and output the proposed GitOps manifest fix based on the reported symptoms.
  3. Time Handling & Fallbacks:

    • Determine Issue Timestamp ({issue_time}):
      • Specific Time Provided: If the user provides a specific timestamp, use it as {issue_time}.
      • Relative Time Provided (e.g., "5 minutes ago"): Dynamically calculate the corresponding UTC timestamp based on current system time, and use it as {issue_time}.
      • No Time Provided (Default): Use current system time as {issue_time}.
    • Window Calculation: Center a 1-hour query window around {issue_time} (start_time = {issue_time} - 30m, end_time = {issue_time} + 30m).

Step 1: Analyze Pod Status and Conditions

Inspect the workload's active pod states and controller status.

Diagnostic Commands:

# 1. Inspect the deployment's actual selector labels:
kubectl get deployment {workload_name} -n {workload_namespace} -o jsonpath='{.spec.selector.matchLabels}'
# 2. Query the pods using the returned labels, for example:
kubectl get pods -l {selector_labels} -n {workload_namespace}
kubectl get deploy/{workload_name} -n {workload_namespace} -o yaml

Diagnostic Decision Tree:

  • Phase: Pending:

    • The Pod cannot schedule on any node. Proceed directly to Step 2 (Query Namespace Events).
  • State: CrashLoopBackOff / Error:

    • The container boots but exits repeatedly; the kubelet restarts it with an increasing back-off delay of up to five minutes. First read the terminated reason and exit code:
    kubectl describe pod {pod_name} -n {workload_namespace}
    kubectl get pod {pod_name} -n {workload_namespace} -o jsonpath='{.status.containerStatuses[*].lastState.terminated}'
    
    • Reason: OOMKilled (Exit Code 137): The container's memory limit was reached. Proceed to Step 3 (Inspect Logs) → OOM Analysis to classify container-level vs node-level, then Step 5 to propose fixes.
    • **Ex
الأسئلة الشائعة

هل تصلح العنقود بدلًا مني؟

لا. تقترح تصحيحات في ملفات manifest أو في Google Cloud، وتترك التغييرات لك.

ماذا إذا لم أسمِّ مساحة الأسماء (namespace)؟

تستخدم مساحة الأسماء default.

هل تغطي إنشاء العنقود؟

لا. بنية العنقود وإنشاء مجموعات العقد خارج نطاقها.

التفاصيل

الوصف الأصلي من المؤلف

Diagnoses GKE workload failures (CrashLoopBackOff, OOMKilled, ImagePullBackOff, Pending, etc.) via logs and events. Use when pods fail to start or crash repeatedly. Don't use for GKE cluster infrastructure provisioning, node pool creation, or non-Kubernetes Google Cloud services.

repo: google/skills

الشعبية

نجوم GitHub
22k
الترتيب
#10305
الترخيص
Apache-2.0
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة