شعار K8s Upgrade Readiness

K8s Upgrade Readiness

مؤسسة
k8s-servant
k8s-upgrade-readiness

استخدم هذه المهارة عندما توشك مجموعة Kubernetes على الترقية إلى الإصدار الفرعي التالي، أو عندما يسأل أحدهم «هل المجموعة جاهزة للترقية؟» أو «ما الذي سيتعطل عند الترقية؟» أو عن سبب توقف إخلاء العقدة أثناء الترقية: تتضمن الحالات PodDisruptionBudgets مع ALLOWED DISRUPTIONS 0، وpods بلا وحدة تحكم («cannot delete Pods that declare no controller»)، وwebhooks للقبول مع failurePolicy Fail ومن دون endpoints، وواجهات API مهملة أو محذوفة لا تزال قيد الاستخدام (apiserver_requested_deprecated_apis وإصدارات CRD المحددة على أنها مهملة)، واختلافًا غير مدعوم بين إصدارات kubelet ومستوى التحكم، وعقدًا تستخدم cgroup v1 أو containerd 1.x، وإضافات لا تدعم الإصدار المستهدف. توضح ما ينبغي إصلاحه أولًا. للقراءة فقط: لا تُجري ترقية أو إخلاءً ولا تغيّر أي شيء بنفسها.

نظرة عامة

الناشرk8s-servant
المستودعk8s-skills
اسم المهارةk8s-upgrade-readiness
النجوم
36
التفريعات
7
الملفات المرفقة
2
الترخيصApache-2.0
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 2

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها k8s-servant على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي K8s Upgrade Readiness في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-upgrade-readiness
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/k8s-servant/k8s-skills.git /tmp/k8s-skills
mkdir -p .claude/skills
cp -r /tmp/k8s-skills/skills/k8s-upgrade-readiness .claude/skills/k8s-upgrade-readiness
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل K8s Upgrade Readiness في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة K8s Upgrade Readiness تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط K8s Upgrade Readiness بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Upgrade readiness

Check a cluster before a Kubernetes minor version upgrade, and report what has to be fixed first. Read only. Run the investigation commands freely. Never upgrade, drain, cordon or evict anything, and never change a workload, a PodDisruptionBudget or a webhook yourself: everything here is a proposed fix for the user and the owners of each object. Never read Secrets.

An upgrade replaces the control plane first, one minor version at a time, and then every node: each node is cordoned and drained (its pods are evicted and recreated elsewhere), then replaced or upgraded. Managed clusters (AKS, EKS, GKE) do both for you, but they drain nodes the same way. So most of what breaks an upgrade is in the cluster: pods that cannot be evicted, pods that cannot be recreated, and clients or add-ons that use an API or a node setup the new version no longer supports.

The commands use placeholders: my-namespace, my-app, my-node. Replace them with the real names. Some checks need more than the built-in view role (nodes, CRDs, webhook configurations, the API server's metrics); if a command is forbidden, say which check it was and give the user the command to run.

When to use

  • Before a minor version upgrade, or when planning one.
  • A node drain during an upgrade hangs, or a managed upgrade fails or stalls on evictions.
  • After an upgrade, clients fail with no matches for kind or the server could not find the requested resource.

Hand-offs, by skill name. When the evidence points elsewhere, continue with that skill; if it is not installed, keep going with the steps here and tell the user which skill would help:

  • On AKS: available versions, node pool upgrades and upgrades that failed: k8s-aks-troubleshooting.
  • A webhook or an APIService is already failing requests today: k8s-api-troubleshooting.
  • A node is NotReady or under pressure today: k8s-node-troubleshooting.
  • Pods are already failing today: k8s-workload-troubleshooting, or k8s-triage for a first look.
  • The Gateway API CRDs and their versions: k8s-gateway-api-troubleshooting.

Investigate

Run every step: the goal is a complete list, not the first problem. Note the current version and the target version (the next minor) first.

1. Versions and skew: the API server, every kubelet, the container runtime, the kernel and the OS image.

bash
kubectl version
kubectl get nodes -o wide
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{" kubelet="}{.status.nodeInfo.kubeletVersion}{" runtime="}{.status.nodeInfo.containerRuntimeVersion}{" kernel="}{.status.nodeInfo.kernelVersion}{" os="}{.status.nodeInfo.osImage}{"\n"}{end}'
kubectl get pods -n kube-system -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.spec.containers[*].image}{"\n"}{end}'

2. Nodes that are not ready, cordoned or under pressure.

bash
kubectl get nodes
kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{" unschedulable="}{.spec.unschedulable}{" "}{range .status.conditions[?(@.status=="True")]}{.type}{" "}{end}{"\n"}{end}'

3. What a drain cannot evict: PodDisruptionBudgets that allow no disruption, and pods with no controller.

bash
kubectl get pdb -A
kubectl get pdb -A -o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{" allowed="}{.status.disruptionsAllowed}{" healthy="}{.status.currentHealthy}/{.status.desiredHealthy}{" selector="}{.spec.selector}{" unhealthyPodEvictionPolicy="}{.spec.unhealthyPodEvictionPolicy}{"\n"}{end}'
kubectl get pods -A -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,OWNER:.metadata.ownerReferences[0].kind,NODE:.spec.nodeName
kubectl get deployments,statefulsets -A

4. What would refuse the recreated pods: admission webhooks that fail closed, and whether their Services have endpoints.

bash
kubectl get validatingwebhookconfigurations,mutatingwebhookconfigurations
kubectl get validatingwebhookconfigurations -o jsonpath='{range .items[*]}{range .webhooks[*]}{.name}{" failurePolicy="}{.failurePolicy}{" service="}{.clientConfig.service.namespace}/{.clientConfig.service.name}{" rules="}{.rules}{" namespaceSelector="}{.namespaceSelector}{"\n"}{end}{end}'
kubectl get mutatingwebhookconfigurations -o jsonpath='{range .items[*]}{range .webhooks[*]}{.name}{" failurePolicy="}{.failurePolicy}{" service="}{.clientConfig.service.namespace}/{.clientConfig.service.name}{" rules="}{.rules}{" namespaceSelector="}{.namespaceSelector}{"\n"}{end}{end}'
kubectl get endpointslices -n my-namespace

5. Deprecated APIs still in use: requests the API server has served for deprecated versions since it started, and custom resource versions marked deprecated or still stored.

bash
kubectl get --raw /metrics | grep apiserver_requested_deprecated_apis
kubectl get crds -o jsonpath='{range .items[*]}{.metadata.name}{" stored="}{.status.storedVersions}{" deprecated="}{.spec.versions[?(@.deprecated==true)].name}{"\n"}{end}'
kubectl api-versions

6. Add-ons and their versions: what runs as part of the cluster, to check against each project's supported Kubernetes versions.

bash
kubectl get deployments,daemonsets,statefulsets -A -o jsonpath='{range .items[*]}{.kind}{" "}{.metadata.namespace}/{.metadata.name}{" "}{.spec.template.spec.containers[*].image}{"\n"}{end}'
kubectl get apiservices

7. Open the matching reference for the details:

What you checkReference
Version skew, the upgrade order, cgroup v1, containerd 1.x, deprecated and removed APIs, CRD stored versions, add-on compatibilityreferences/versions-and-apis.md
PodDisruptionBudgets, unmanaged pods, local storage, single replicas, webhooks during a drainreferences/drains.md

Read the results

What the common findings mean (Kubernetes 1.37):

  • A PDB with ALLOWED DISRUPTIONS 0 while its pods are healthy (for example minAvailable equal to the replicas, or maxUnavailable: 0): no pod it selects can be evicted, so a drain of a node running one of them waits forever, and managed upgrades stall or fail on it. A PDB with 0 because pods are unhealthy blocks the same way unless its unhealthyPodEvictionPolicy is AlwaysAllow.
  • A pod with no owner (OWNER <none>): kubectl drain refuses it with cannot delete Pods that declare no controller (use --force to override); with --force it is deleted and nothing recreates it. Pods owned by a Node are static (mirror) pods, and DaemonSet pods are skipped by drains; both are fine.
  • A pod with an emptyDir volume: drain refuses it with cannot delete Pods with local storage (use --delete-emptydir-data to override); the data is lost on eviction. Usually expected; say so only if the data matters.
  • A webhook with failurePolicy: Fail whose Service has no endpoints: requests it matches are refused. If it matches pods, every pod a drain evicts in those namespaces cannot be recreated, although the running ones look fine today.
  • A kubelet newer than the API server, or more than three minor versions older: outside the version skew policy. Its upgrade order is stricter: before the API server moves to the target, every kubelet should be at most two minor versions older than the target. Upgrade those nodes first. The API server itself moves one minor version at a time.
  • A containerRuntimeVersion of containerd://1.x with a target of 1.36 or later: the kubelet no longer supports containerd 1.x; upgrade containerd to 2.0 or later first. A kernel older than 5.8, or an OS image that still uses cgroup v1: since 1.35 the kubelet does not start on cgroup v1 by default.
  • apiserver_requested_deprecated_apis lines: a client used that group, version and resource since the API server started. A removed_release at or below the target version means that client breaks after the upgrade. version="v1" resource="endpoints" is the core Endpoints API, deprecated in favour of EndpointSlices with no removal planned.
  • A CRD whose storedVersions contains a version marked deprecated, or a version the next release of its add-on drops: objects are still stored in that version. They must be migrated, and storedVersions trimmed, before the add-on removes it.
  • Add-on versions: compare each against the project's compatibility table for the target version; an add-on that does not support it is upgraded first.

Report the result as a list, most important first: blockers (the upgrade will fail or cause an outage), then risks (downtime, data loss, a client that will break), then what was checked and found fine. For each, the object, the evidence and the proposed fix.

Proposed fix

Show each fix to the user; the agent runs none of them. Every finding here belongs to the owner of the object (an application team, a platform team), and changing a PDB, a webhook or a workload's replicas during an upgrade window affects availability. Write each undo with the values you found.

Let a single-replica app keep a pod running while another starts (two or more replicas; the PDB then allows one disruption):

Proposed fix: review before running. The agent does not run this.

bash
kubectl scale deployment my-app -n my-namespace --replicas=2
# Undo: kubectl scale deployment my-app -n my-namespace --replicas=1

Allow one disruption instead of keeping every pod (for the app's owners; prefer the change in the app's source):

Proposed fix: review before running. The agent does not run this.

bash
kubectl patch pdb my-app -n my-namespace --type=json -p '[{"op": "remove", "path": "/spec/minAvailable"}, {"op": "add", "path": "/spec/maxUnavailable", "value": 1}]'
# Undo: kubectl patch pdb my-app -n my-namespace --type=json -p '[{"op": "remove", "path": "/spec/maxUnavailable"}, {"op": "add", "path": "/spec/minAvailable", "value": 1}]'

A pod with no controller is recreated under a Deployment (or a Job) by its owner, or deleted if nobody needs it, before the upgrade. A webhook without endpoints gets its backend back before the upgrade (see k8s-api-troubleshooting). Clients and manifests that use a removed API are moved to its replacement version first. The references give the commands for each.

Sources

Checked against the Kubernetes 1.37 documentation, and on a Kubernetes 1.37 kind cluster:

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي K8s Upgrade Readiness؟

استخدم هذه المهارة عندما توشك مجموعة Kubernetes على الترقية إلى الإصدار الفرعي التالي، أو عندما يسأل أحدهم «هل المجموعة جاهزة للترقية؟» أو «ما الذي سيتعطل عند الترقية؟» أو عن سبب توقف إخلاء العقدة أثناء الترقية: تتضمن الحالات PodDisruptionBudgets مع ALLOWED DISRUPTIONS 0، وpods بلا وحدة تحكم («cannot delete Pods that declare no controller»)، وwebhooks للقبول مع failurePolicy Fail ومن دون endpoints، وواجهات API مهملة أو محذوفة لا تزال قيد الاستخدام (apiserver_requested_deprecated_apis وإصدارات CRD المحددة على أنها مهملة)، واختلافًا غير مدعوم بين إصدارات kubelet ومستوى التحكم، وعقدًا تستخدم c...

لماذا تستخدم K8s Upgrade Readiness على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة K8s Upgrade Readiness عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت K8s Upgrade Readiness في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-upgrade-readiness. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام K8s Upgrade Readiness؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع K8s Upgrade Readiness؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام K8s Upgrade Readiness معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي K8s Upgrade Readiness مجانية؟

نعم. نشرها k8s-servant على GitHub بموجب ترخيص Apache-2.0. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇