deploying-cloud-k8s
部署到云端Kubernetes
部署应用到Kubernetes需要理解构建时变量与运行时的区别、架构匹配以及CI/CD配置。本技能提供了经过实战检验的部署模式,适用于AKS、GKE和DOKS,结合GitHub Actions和Helm使用。
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "deploying-cloud-k8s". Deploy my Next.js app to AKS with GitHub Actions
النتيجة المتوقعة:
- Architecture check: kubectl get nodes -o jsonpath='{.items[*].status.nodeInfo.architecture}'
- Build args: NEXT_PUBLIC_* variables must use ARG in Dockerfile, not runtime ENV
- Secrets: Pass via helm --set "secrets.databaseUrl=${{ secrets.DATABASE_URL }}"
- GitHub Actions: Use docker/build-push-action@v5 with platforms: linux/arm64
استخدام "deploying-cloud-k8s". My pods are failing with exec format error
النتيجة المتوقعة:
- Cause: Binary architecture does not match cluster node CPU architecture
- Check cluster: kubectl get nodes -o jsonpath='{.items[*].status.nodeInfo.architecture}'
- Fix Docker build: platforms: linux/arm64 (or amd64 to match)
- Rebuild with: no-cache: true to force fresh image
استخدام "deploying-cloud-k8s". Configure ArgoCD for production
النتيجة المتوقعة:
- ArgoCD Application manifest with repoURL and path to overlays/production
- Sync policy: automated with prune: true and selfHeal: true
- Kustomize overlays for environment differences (dev, staging, prod)
- RBAC configuration for service account with least privilege
التدقيق الأمني
آمنPure documentation skill with no executable code paths. Contains only YAML/JSON documentation, infrastructure patterns, and a read-only verification script that validates its own structure. Static findings incorrectly flagged documentation code examples as executable patterns.
عوامل الخطر
⚙️ الأوامر الخارجية (96)
🌐 الوصول إلى الشبكة (18)
📁 الوصول إلى نظام الملفات (5)
درجة الجودة
ماذا يمكنك بناءه
生产环境部署
建立可靠的CI/CD管道,部署到云端Kubernetes集群,并进行适当的密钥管理
容器故障排查
诊断和修复常见的部署问题,如架构不匹配和镜像拉取失败
GitOps配置
使用ArgoCD、Kustomize覆盖层和特定环境的配置实现GitOps工作流
جرّب هذه الموجهات
使用GitHub Actions将我的Next.js应用部署到Azure Kubernetes Service。我需要帮助处理NEXT_PUBLIC_*变量的构建参数和Helm密钥传递。
我的Pod显示ImagePullBackOff并出现'no match for platform'错误。帮我诊断并修复Docker构建与GKE集群之间的架构不匹配问题。
设置GitHub Actions工作流,仅基于修改的文件构建已更改的服务(api或web)。包括路径过滤器和Docker构建推送操作。
使用Kustomize覆盖层为生产部署配置ArgoCD应用程序。包括带有prune和self-heal启用的同步策略。
أفضل الممارسات
- 在构建镜像之前始终检查集群架构,以避免平台不匹配错误
- 通过Helm --set传递所有密钥,而不是嵌入values.yaml文件中
- 对于NEXT_PUBLIC_*变量使用构建参数(ARG),而不是Dockerfile中的运行时ENV
تجنب
- 在Docker镜像或values.yaml文件中嵌入密钥
- 在未验证集群架构的情况下构建镜像(arm64与amd64)
- 对必须在构建时嵌入的Next.js公共变量使用运行时ENV