opencode-skills-collection 4.0.68 → 4.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-skills/.antigravity-install-manifest.json +266 -1
- package/bundled-skills/access-review/SKILL.md +394 -0
- package/bundled-skills/access-review/references/details.md +121 -0
- package/bundled-skills/agent-evals/SKILL.md +420 -0
- package/bundled-skills/agent-observability/SKILL.md +346 -0
- package/bundled-skills/agent-observability/references/details.md +786 -0
- package/bundled-skills/ai-agent-security/SKILL.md +393 -0
- package/bundled-skills/ai-agent-security/references/details.md +912 -0
- package/bundled-skills/ai-coding-agent-guardrails/SKILL.md +442 -0
- package/bundled-skills/ai-coding-agent-guardrails/references/details.md +753 -0
- package/bundled-skills/ai-inference-service-mesh/SKILL.md +449 -0
- package/bundled-skills/ai-pipeline-orchestration/SKILL.md +287 -0
- package/bundled-skills/ai-red-teaming/SKILL.md +409 -0
- package/bundled-skills/ai-security-hardening/SKILL.md +343 -0
- package/bundled-skills/ai-sre-incident-response/SKILL.md +336 -0
- package/bundled-skills/alerting-oncall/SKILL.md +458 -0
- package/bundled-skills/alerting-oncall/references/details.md +84 -0
- package/bundled-skills/apk-redteam-pipeline/SKILL.md +446 -0
- package/bundled-skills/argocd-gitops/SKILL.md +469 -0
- package/bundled-skills/arm-templates/SKILL.md +438 -0
- package/bundled-skills/arm-templates/references/details.md +64 -0
- package/bundled-skills/asset-inventory/SKILL.md +412 -0
- package/bundled-skills/asset-inventory/references/details.md +127 -0
- package/bundled-skills/audit-logging/SKILL.md +476 -0
- package/bundled-skills/aws-cloudtrail/SKILL.md +486 -0
- package/bundled-skills/aws-cost-optimization/SKILL.md +331 -0
- package/bundled-skills/aws-ec2/SKILL.md +426 -0
- package/bundled-skills/aws-ecs-fargate/SKILL.md +388 -0
- package/bundled-skills/aws-iam/SKILL.md +463 -0
- package/bundled-skills/aws-lambda/SKILL.md +428 -0
- package/bundled-skills/aws-rds/SKILL.md +380 -0
- package/bundled-skills/aws-s3/SKILL.md +434 -0
- package/bundled-skills/aws-secrets-manager/SKILL.md +486 -0
- package/bundled-skills/aws-vpc/SKILL.md +436 -0
- package/bundled-skills/azure-ai-document-intelligence-ts/SKILL.md +1 -1
- package/bundled-skills/azure-aks/SKILL.md +423 -0
- package/bundled-skills/azure-devops/SKILL.md +457 -0
- package/bundled-skills/azure-functions-devsec/SKILL.md +436 -0
- package/bundled-skills/azure-keyvault/SKILL.md +455 -0
- package/bundled-skills/azure-keyvault/references/details.md +83 -0
- package/bundled-skills/azure-monitor-audit/SKILL.md +379 -0
- package/bundled-skills/azure-networking/SKILL.md +448 -0
- package/bundled-skills/azure-networking/references/details.md +135 -0
- package/bundled-skills/azure-sql/SKILL.md +413 -0
- package/bundled-skills/azure-sql/references/details.md +113 -0
- package/bundled-skills/azure-vms/SKILL.md +402 -0
- package/bundled-skills/azure-vms/references/details.md +134 -0
- package/bundled-skills/backup-recovery/SKILL.md +388 -0
- package/bundled-skills/bb-methodology/SKILL.md +451 -0
- package/bundled-skills/bb-methodology/references/details.md +120 -0
- package/bundled-skills/block-storage/SKILL.md +371 -0
- package/bundled-skills/blue-green-deploy/SKILL.md +453 -0
- package/bundled-skills/blue-green-deploy/references/details.md +90 -0
- package/bundled-skills/bug-bounty/SKILL.md +447 -0
- package/bundled-skills/bug-bounty/references/details.md +1316 -0
- package/bundled-skills/bugcrowd-reporting/SKILL.md +351 -0
- package/bundled-skills/business-continuity/SKILL.md +463 -0
- package/bundled-skills/career-ops/SKILL.md +186 -0
- package/bundled-skills/cdn-setup/SKILL.md +374 -0
- package/bundled-skills/change-management/SKILL.md +438 -0
- package/bundled-skills/change-management/references/details.md +105 -0
- package/bundled-skills/circleci/SKILL.md +475 -0
- package/bundled-skills/cis-benchmarks/SKILL.md +150 -0
- package/bundled-skills/cloudflare-pages/SKILL.md +318 -0
- package/bundled-skills/cloudflare-r2/SKILL.md +353 -0
- package/bundled-skills/cloudflare-workers/SKILL.md +415 -0
- package/bundled-skills/cloudflare-zero-trust/SKILL.md +361 -0
- package/bundled-skills/cloudformation/SKILL.md +461 -0
- package/bundled-skills/constraint-driven-development/SKILL.md +335 -0
- package/bundled-skills/constraint-driven-development/references/floor-guard.md +99 -0
- package/bundled-skills/container-hardening/SKILL.md +126 -0
- package/bundled-skills/container-registries/SKILL.md +435 -0
- package/bundled-skills/container-scanning/SKILL.md +416 -0
- package/bundled-skills/convex-backend/SKILL.md +338 -0
- package/bundled-skills/dast-scanning/SKILL.md +437 -0
- package/bundled-skills/database-backups/SKILL.md +425 -0
- package/bundled-skills/datadog/SKILL.md +487 -0
- package/bundled-skills/dependency-scanning/SKILL.md +457 -0
- package/bundled-skills/devcontainers-nix/SKILL.md +416 -0
- package/bundled-skills/disaster-recovery/SKILL.md +374 -0
- package/bundled-skills/disaster-recovery/references/details.md +219 -0
- package/bundled-skills/dns-management/SKILL.md +375 -0
- package/bundled-skills/docker-compose/SKILL.md +482 -0
- package/bundled-skills/docker-management/SKILL.md +426 -0
- package/bundled-skills/ebpf-observability/SKILL.md +436 -0
- package/bundled-skills/ebpf-observability/references/details.md +542 -0
- package/bundled-skills/elk-stack/SKILL.md +487 -0
- package/bundled-skills/enterprise-vpn-attack/SKILL.md +395 -0
- package/bundled-skills/evidence-hygiene/SKILL.md +404 -0
- package/bundled-skills/feature-flags/SKILL.md +426 -0
- package/bundled-skills/feature-flags/references/details.md +86 -0
- package/bundled-skills/fedramp-compliance/SKILL.md +453 -0
- package/bundled-skills/firebase-app-platform/SKILL.md +381 -0
- package/bundled-skills/firewall-config/SKILL.md +479 -0
- package/bundled-skills/gcp-audit-logs/SKILL.md +452 -0
- package/bundled-skills/gcp-audit-logs/references/details.md +56 -0
- package/bundled-skills/gcp-cloud-functions/SKILL.md +284 -0
- package/bundled-skills/gcp-cloud-sql/SKILL.md +277 -0
- package/bundled-skills/gcp-compute/SKILL.md +319 -0
- package/bundled-skills/gcp-gke/SKILL.md +307 -0
- package/bundled-skills/gcp-networking/SKILL.md +293 -0
- package/bundled-skills/gcp-secret-manager/SKILL.md +421 -0
- package/bundled-skills/gcp-secret-manager/references/details.md +131 -0
- package/bundled-skills/gdpr-compliance/SKILL.md +451 -0
- package/bundled-skills/gdpr-compliance/references/details.md +145 -0
- package/bundled-skills/geo-audit/SKILL.md +368 -0
- package/bundled-skills/geo-brand-mentions/SKILL.md +68 -0
- package/bundled-skills/geo-brand-mentions/references/details.md +471 -0
- package/bundled-skills/geo-citability/SKILL.md +350 -0
- package/bundled-skills/geo-compare/SKILL.md +340 -0
- package/bundled-skills/geo-content/SKILL.md +383 -0
- package/bundled-skills/geo-crawlers/SKILL.md +408 -0
- package/bundled-skills/geo-llmstxt/SKILL.md +464 -0
- package/bundled-skills/geo-platform-optimizer/SKILL.md +314 -0
- package/bundled-skills/geo-proposal/SKILL.md +378 -0
- package/bundled-skills/geo-prospect/SKILL.md +225 -0
- package/bundled-skills/geo-report/SKILL.md +436 -0
- package/bundled-skills/geo-report-pdf/SKILL.md +157 -0
- package/bundled-skills/geo-schema/SKILL.md +408 -0
- package/bundled-skills/geo-technical/SKILL.md +78 -0
- package/bundled-skills/geo-technical/references/details.md +543 -0
- package/bundled-skills/git-workflow/SKILL.md +460 -0
- package/bundled-skills/github-actions/SKILL.md +368 -0
- package/bundled-skills/gitlab-ci/SKILL.md +340 -0
- package/bundled-skills/gpu-kubernetes-operations/SKILL.md +468 -0
- package/bundled-skills/gpu-server-management/SKILL.md +236 -0
- package/bundled-skills/hashicorp-vault/SKILL.md +408 -0
- package/bundled-skills/helm-charts/SKILL.md +469 -0
- package/bundled-skills/hipaa-compliance/SKILL.md +451 -0
- package/bundled-skills/hunt-aspnet/SKILL.md +321 -0
- package/bundled-skills/hunt-ato/SKILL.md +184 -0
- package/bundled-skills/hunt-auth-bypass/SKILL.md +426 -0
- package/bundled-skills/hunt-auth-bypass/references/details.md +80 -0
- package/bundled-skills/hunt-brute-force/SKILL.md +341 -0
- package/bundled-skills/hunt-business-logic/SKILL.md +281 -0
- package/bundled-skills/hunt-cache-poison/SKILL.md +382 -0
- package/bundled-skills/hunt-captcha-bypass/SKILL.md +136 -0
- package/bundled-skills/hunt-cicd/SKILL.md +311 -0
- package/bundled-skills/hunt-clickjacking/SKILL.md +110 -0
- package/bundled-skills/hunt-cors/SKILL.md +335 -0
- package/bundled-skills/hunt-dom/SKILL.md +323 -0
- package/bundled-skills/hunt-exceptional-conditions/SKILL.md +111 -0
- package/bundled-skills/hunt-file-upload/SKILL.md +202 -0
- package/bundled-skills/hunt-fintech-graphql/SKILL.md +289 -0
- package/bundled-skills/hunt-forgot-password/SKILL.md +114 -0
- package/bundled-skills/hunt-grpc/SKILL.md +317 -0
- package/bundled-skills/hunt-host-header/SKILL.md +309 -0
- package/bundled-skills/hunt-html-injection/SKILL.md +106 -0
- package/bundled-skills/hunt-http-smuggling/SKILL.md +129 -0
- package/bundled-skills/hunt-http-smuggling/references/phase2h-smuggling-cachepoison.md +177 -0
- package/bundled-skills/hunt-idor/SKILL.md +434 -0
- package/bundled-skills/hunt-jwt-crypto/SKILL.md +221 -0
- package/bundled-skills/hunt-k8s/SKILL.md +337 -0
- package/bundled-skills/hunt-laravel/SKILL.md +255 -0
- package/bundled-skills/hunt-ldap/SKILL.md +351 -0
- package/bundled-skills/hunt-lfi/SKILL.md +311 -0
- package/bundled-skills/hunt-llm-ai/SKILL.md +289 -0
- package/bundled-skills/hunt-mfa-bypass/SKILL.md +177 -0
- package/bundled-skills/hunt-misc/SKILL.md +378 -0
- package/bundled-skills/hunt-nextjs/SKILL.md +299 -0
- package/bundled-skills/hunt-nodejs/SKILL.md +263 -0
- package/bundled-skills/hunt-nosqli/SKILL.md +210 -0
- package/bundled-skills/hunt-ntlm-info/SKILL.md +314 -0
- package/bundled-skills/hunt-oauth/SKILL.md +459 -0
- package/bundled-skills/hunt-open-redirect/SKILL.md +223 -0
- package/bundled-skills/hunt-race-condition/SKILL.md +381 -0
- package/bundled-skills/hunt-race-condition/references/details.md +159 -0
- package/bundled-skills/hunt-rag-vector/SKILL.md +212 -0
- package/bundled-skills/hunt-rce/SKILL.md +444 -0
- package/bundled-skills/hunt-rce/references/details.md +110 -0
- package/bundled-skills/hunt-saml/SKILL.md +156 -0
- package/bundled-skills/hunt-session/SKILL.md +342 -0
- package/bundled-skills/hunt-shadow-api/SKILL.md +198 -0
- package/bundled-skills/hunt-source-leak/SKILL.md +345 -0
- package/bundled-skills/hunt-spa-api/SKILL.md +163 -0
- package/bundled-skills/hunt-springboot/SKILL.md +285 -0
- package/bundled-skills/hunt-sqli/SKILL.md +466 -0
- package/bundled-skills/hunt-ssrf/SKILL.md +396 -0
- package/bundled-skills/hunt-ssrf/references/details.md +179 -0
- package/bundled-skills/hunt-ssti/SKILL.md +163 -0
- package/bundled-skills/hunt-subdomain/SKILL.md +379 -0
- package/bundled-skills/hunt-tls-network/SKILL.md +399 -0
- package/bundled-skills/hunt-xxe/SKILL.md +466 -0
- package/bundled-skills/i-have-adhd/SKILL.md +170 -0
- package/bundled-skills/identity-access-management/SKILL.md +382 -0
- package/bundled-skills/identity-access-management/references/details.md +524 -0
- package/bundled-skills/incident-management/SKILL.md +484 -0
- package/bundled-skills/incident-response/SKILL.md +448 -0
- package/bundled-skills/incident-response/references/details.md +113 -0
- package/bundled-skills/interview-me/SKILL.md +248 -0
- package/bundled-skills/iso27001-compliance/SKILL.md +460 -0
- package/bundled-skills/jenkins/SKILL.md +462 -0
- package/bundled-skills/jev-use/SKILL.md +158 -0
- package/bundled-skills/kubernetes-hardening/SKILL.md +154 -0
- package/bundled-skills/kubernetes-ops/SKILL.md +449 -0
- package/bundled-skills/kubernetes-ops/references/details.md +108 -0
- package/bundled-skills/kustomize/SKILL.md +478 -0
- package/bundled-skills/linux-administration/SKILL.md +367 -0
- package/bundled-skills/linux-hardening/SKILL.md +154 -0
- package/bundled-skills/llm-app-security/SKILL.md +389 -0
- package/bundled-skills/llm-app-security/references/details.md +674 -0
- package/bundled-skills/llm-caching/SKILL.md +334 -0
- package/bundled-skills/llm-cost-optimization/SKILL.md +311 -0
- package/bundled-skills/llm-fine-tuning/SKILL.md +329 -0
- package/bundled-skills/llm-gateway/SKILL.md +282 -0
- package/bundled-skills/llm-inference-scaling/SKILL.md +286 -0
- package/bundled-skills/llmops-platform-engineering/SKILL.md +472 -0
- package/bundled-skills/load-balancing/SKILL.md +403 -0
- package/bundled-skills/loki-logging/SKILL.md +479 -0
- package/bundled-skills/m365-entra-attack/SKILL.md +423 -0
- package/bundled-skills/mac-mini-llm-lab/SKILL.md +350 -0
- package/bundled-skills/mcp-server-security/SKILL.md +356 -0
- package/bundled-skills/mcp-server-security/references/details.md +745 -0
- package/bundled-skills/mdm-device-management/SKILL.md +404 -0
- package/bundled-skills/mdm-device-management/references/details.md +410 -0
- package/bundled-skills/meme-coin-audit/SKILL.md +402 -0
- package/bundled-skills/mid-engagement-ir-detection/SKILL.md +377 -0
- package/bundled-skills/model-registry-governance/SKILL.md +452 -0
- package/bundled-skills/model-serving-kubernetes/SKILL.md +339 -0
- package/bundled-skills/model-supply-chain-security/SKILL.md +427 -0
- package/bundled-skills/mongodb/SKILL.md +436 -0
- package/bundled-skills/multi-tenant-llm-hosting/SKILL.md +435 -0
- package/bundled-skills/multi-tenant-llm-hosting/references/details.md +211 -0
- package/bundled-skills/mysql/SKILL.md +390 -0
- package/bundled-skills/new-relic/SKILL.md +472 -0
- package/bundled-skills/nfs-storage/SKILL.md +356 -0
- package/bundled-skills/object-storage/SKILL.md +378 -0
- package/bundled-skills/offensive-osint/SKILL.md +443 -0
- package/bundled-skills/okta-attack/SKILL.md +436 -0
- package/bundled-skills/ollama-stack/SKILL.md +379 -0
- package/bundled-skills/openclaw-deployment-hardening/SKILL.md +135 -0
- package/bundled-skills/openclaw-local-mac-mini/SKILL.md +426 -0
- package/bundled-skills/openclaw-local-mac-mini/references/details.md +221 -0
- package/bundled-skills/openclaw-security-hardening/SKILL.md +135 -0
- package/bundled-skills/openshift/SKILL.md +485 -0
- package/bundled-skills/opentelemetry/SKILL.md +438 -0
- package/bundled-skills/opentelemetry/references/details.md +78 -0
- package/bundled-skills/opentofu-migration/SKILL.md +349 -0
- package/bundled-skills/osint-methodology/SKILL.md +460 -0
- package/bundled-skills/osint-methodology/references/details.md +1350 -0
- package/bundled-skills/pci-dss-compliance/SKILL.md +446 -0
- package/bundled-skills/penetration-testing/SKILL.md +152 -0
- package/bundled-skills/performance-tuning/SKILL.md +381 -0
- package/bundled-skills/planetscale/SKILL.md +297 -0
- package/bundled-skills/platform-engineering/SKILL.md +348 -0
- package/bundled-skills/platform-engineering/references/details.md +944 -0
- package/bundled-skills/podman/SKILL.md +405 -0
- package/bundled-skills/policy-as-code/SKILL.md +434 -0
- package/bundled-skills/policy-as-code/references/details.md +204 -0
- package/bundled-skills/postgresql-devsec/SKILL.md +378 -0
- package/bundled-skills/prometheus-grafana/SKILL.md +469 -0
- package/bundled-skills/prompt-injection-defense/SKILL.md +483 -0
- package/bundled-skills/rag-infrastructure/SKILL.md +269 -0
- package/bundled-skills/rag-observability-evals/SKILL.md +444 -0
- package/bundled-skills/rag-observability-evals/references/details.md +92 -0
- package/bundled-skills/recon-scope-triage/SKILL.md +128 -0
- package/bundled-skills/redis/SKILL.md +421 -0
- package/bundled-skills/redteam-report-template/SKILL.md +370 -0
- package/bundled-skills/report-writing/SKILL.md +426 -0
- package/bundled-skills/report-writing/references/details.md +187 -0
- package/bundled-skills/reverse-proxy/SKILL.md +420 -0
- package/bundled-skills/runbook-creation/SKILL.md +438 -0
- package/bundled-skills/runbook-creation/references/details.md +71 -0
- package/bundled-skills/saas-security-posture/SKILL.md +415 -0
- package/bundled-skills/sast-scanning/SKILL.md +444 -0
- package/bundled-skills/sbom-supply-chain/SKILL.md +433 -0
- package/bundled-skills/security-arsenal/SKILL.md +446 -0
- package/bundled-skills/security-arsenal/references/details.md +540 -0
- package/bundled-skills/security-automation/SKILL.md +146 -0
- package/bundled-skills/semantic-versioning/SKILL.md +434 -0
- package/bundled-skills/semantic-versioning/references/details.md +83 -0
- package/bundled-skills/service-mesh/SKILL.md +422 -0
- package/bundled-skills/soc2-compliance/SKILL.md +409 -0
- package/bundled-skills/sops-encryption/SKILL.md +124 -0
- package/bundled-skills/sre-dashboards/SKILL.md +143 -0
- package/bundled-skills/ssh-configuration/SKILL.md +324 -0
- package/bundled-skills/ssl-tls-management/SKILL.md +428 -0
- package/bundled-skills/ssl-tls-management/references/details.md +99 -0
- package/bundled-skills/startup-it-troubleshooting/SKILL.md +415 -0
- package/bundled-skills/supply-chain-attack-recon/SKILL.md +453 -0
- package/bundled-skills/supply-chain-attack-recon/references/details.md +258 -0
- package/bundled-skills/systemd-services/SKILL.md +379 -0
- package/bundled-skills/terraform-aws/SKILL.md +125 -0
- package/bundled-skills/terraform-azure/SKILL.md +415 -0
- package/bundled-skills/terraform-azure/references/details.md +231 -0
- package/bundled-skills/terraform-gcp/SKILL.md +369 -0
- package/bundled-skills/threat-modeling/SKILL.md +487 -0
- package/bundled-skills/user-management/SKILL.md +383 -0
- package/bundled-skills/using-agent-skills/SKILL.md +220 -0
- package/bundled-skills/vector-database-ops/SKILL.md +300 -0
- package/bundled-skills/vendor-management/SKILL.md +439 -0
- package/bundled-skills/vendor-management/references/details.md +109 -0
- package/bundled-skills/vercel-deployments/SKILL.md +296 -0
- package/bundled-skills/vllm-server/SKILL.md +236 -0
- package/bundled-skills/vmware-vcenter-attack/SKILL.md +412 -0
- package/bundled-skills/vpn-setup/SKILL.md +452 -0
- package/bundled-skills/vulnerability-scanning/SKILL.md +448 -0
- package/bundled-skills/waf-setup/SKILL.md +354 -0
- package/bundled-skills/waf-setup/references/details.md +211 -0
- package/bundled-skills/web2-recon/SKILL.md +440 -0
- package/bundled-skills/web2-recon/references/details.md +319 -0
- package/bundled-skills/web3-audit/SKILL.md +445 -0
- package/bundled-skills/web3-audit/references/details.md +224 -0
- package/bundled-skills/windows-hardening/SKILL.md +454 -0
- package/bundled-skills/windows-hardening/references/details.md +204 -0
- package/bundled-skills/windows-server/SKILL.md +318 -0
- package/bundled-skills/zero-trust/SKILL.md +461 -0
- package/package.json +1 -1
- package/skills_index.json +6943 -323
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kubernetes-hardening
|
|
3
|
+
description: Implement Kubernetes security contexts, Pod Security Standards, and network
|
|
4
|
+
policies.
|
|
5
|
+
category: security
|
|
6
|
+
risk: critical
|
|
7
|
+
source: https://github.com/BagelHole/DevOps-Security-Agent-Skills
|
|
8
|
+
source_repo: BagelHole/DevOps-Security-Agent-Skills
|
|
9
|
+
source_type: community
|
|
10
|
+
date_added: '2026-09-20'
|
|
11
|
+
license: MIT
|
|
12
|
+
license_source: https://github.com/BagelHole/DevOps-Security-Agent-Skills/blob/main/LICENSE
|
|
13
|
+
compatibility: Requires the relevant security tooling (scanners, vault CLIs) and an
|
|
14
|
+
authorized scope for any active assessment. Docs-only; helper scripts and templates
|
|
15
|
+
not bundled.
|
|
16
|
+
metadata:
|
|
17
|
+
author: devops-skills
|
|
18
|
+
version: '1.0'
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Kubernetes Hardening
|
|
22
|
+
|
|
23
|
+
Secure Kubernetes clusters and workloads.
|
|
24
|
+
|
|
25
|
+
## When to Use This Skill
|
|
26
|
+
|
|
27
|
+
Use this skill when:
|
|
28
|
+
- Hardening Kubernetes clusters
|
|
29
|
+
- Implementing Pod Security Standards
|
|
30
|
+
- Configuring network policies
|
|
31
|
+
- Meeting security compliance
|
|
32
|
+
|
|
33
|
+
## Pod Security Standards
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
# Namespace with restricted policy
|
|
37
|
+
apiVersion: v1
|
|
38
|
+
kind: Namespace
|
|
39
|
+
metadata:
|
|
40
|
+
name: production
|
|
41
|
+
labels:
|
|
42
|
+
pod-security.kubernetes.io/enforce: restricted
|
|
43
|
+
pod-security.kubernetes.io/audit: restricted
|
|
44
|
+
pod-security.kubernetes.io/warn: restricted
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Security Context
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
apiVersion: v1
|
|
51
|
+
kind: Pod
|
|
52
|
+
metadata:
|
|
53
|
+
name: secure-pod
|
|
54
|
+
spec:
|
|
55
|
+
securityContext:
|
|
56
|
+
runAsNonRoot: true
|
|
57
|
+
runAsUser: 1000
|
|
58
|
+
runAsGroup: 1000
|
|
59
|
+
fsGroup: 1000
|
|
60
|
+
seccompProfile:
|
|
61
|
+
type: RuntimeDefault
|
|
62
|
+
containers:
|
|
63
|
+
- name: app
|
|
64
|
+
image: myapp:latest
|
|
65
|
+
securityContext:
|
|
66
|
+
allowPrivilegeEscalation: false
|
|
67
|
+
readOnlyRootFilesystem: true
|
|
68
|
+
capabilities:
|
|
69
|
+
drop: ["ALL"]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Network Policies
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
apiVersion: networking.k8s.io/v1
|
|
76
|
+
kind: NetworkPolicy
|
|
77
|
+
metadata:
|
|
78
|
+
name: default-deny-all
|
|
79
|
+
spec:
|
|
80
|
+
podSelector: {}
|
|
81
|
+
policyTypes:
|
|
82
|
+
- Ingress
|
|
83
|
+
- Egress
|
|
84
|
+
---
|
|
85
|
+
apiVersion: networking.k8s.io/v1
|
|
86
|
+
kind: NetworkPolicy
|
|
87
|
+
metadata:
|
|
88
|
+
name: allow-web
|
|
89
|
+
spec:
|
|
90
|
+
podSelector:
|
|
91
|
+
matchLabels:
|
|
92
|
+
app: web
|
|
93
|
+
ingress:
|
|
94
|
+
- from:
|
|
95
|
+
- podSelector:
|
|
96
|
+
matchLabels:
|
|
97
|
+
app: frontend
|
|
98
|
+
ports:
|
|
99
|
+
- port: 8080
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## RBAC
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
106
|
+
kind: Role
|
|
107
|
+
metadata:
|
|
108
|
+
name: app-reader
|
|
109
|
+
rules:
|
|
110
|
+
- apiGroups: [""]
|
|
111
|
+
resources: ["pods", "services"]
|
|
112
|
+
verbs: ["get", "list"]
|
|
113
|
+
---
|
|
114
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
115
|
+
kind: RoleBinding
|
|
116
|
+
metadata:
|
|
117
|
+
name: app-reader-binding
|
|
118
|
+
subjects:
|
|
119
|
+
- kind: ServiceAccount
|
|
120
|
+
name: myapp
|
|
121
|
+
roleRef:
|
|
122
|
+
kind: Role
|
|
123
|
+
name: app-reader
|
|
124
|
+
apiGroup: rbac.authorization.k8s.io
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Best Practices
|
|
128
|
+
|
|
129
|
+
- Enable Pod Security Standards
|
|
130
|
+
- Implement network policies
|
|
131
|
+
- Use RBAC with least privilege
|
|
132
|
+
- Enable audit logging
|
|
133
|
+
- Secure etcd with encryption
|
|
134
|
+
- Use service mesh for mTLS
|
|
135
|
+
- Regular security scanning
|
|
136
|
+
|
|
137
|
+
## Related Skills
|
|
138
|
+
|
|
139
|
+
- kubernetes-ops (`kubernetes-ops`) - K8s operations
|
|
140
|
+
- container-hardening (`container-hardening`) - Container security
|
|
141
|
+
|
|
142
|
+
## Limitations
|
|
143
|
+
|
|
144
|
+
- Apply guidance only within authorized scope; test destructive steps in non-production first.
|
|
145
|
+
- Docs-only import: upstream scripts and templates not bundled.
|
|
146
|
+
|
|
147
|
+
### Example
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Read-only first: inventory before any active step.
|
|
151
|
+
which <tool> && <tool> --help | head -n 20
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
> Adapted from [BagelHole/DevOps-Security-Agent-Skills](https://github.com/BagelHole/DevOps-Security-Agent-Skills) (MIT); frontmatter, When to Use/Limitations, and safety boundaries added for upstream compliance. Docs-only import: helper scripts and templates not bundled.
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kubernetes-ops
|
|
3
|
+
description: Deploy, scale, and manage Kubernetes workloads.
|
|
4
|
+
category: devops
|
|
5
|
+
risk: critical
|
|
6
|
+
source: https://github.com/BagelHole/DevOps-Security-Agent-Skills
|
|
7
|
+
source_repo: BagelHole/DevOps-Security-Agent-Skills
|
|
8
|
+
source_type: community
|
|
9
|
+
date_added: '2026-09-20'
|
|
10
|
+
license: MIT
|
|
11
|
+
license_source: https://github.com/BagelHole/DevOps-Security-Agent-Skills/blob/main/LICENSE
|
|
12
|
+
compatibility: Requires the relevant platform CLIs (kubectl, helm, terraform, git,
|
|
13
|
+
CI runners) and authorized access to the target environment. Docs-only; helper scripts
|
|
14
|
+
and templates not bundled.
|
|
15
|
+
metadata:
|
|
16
|
+
author: devops-skills
|
|
17
|
+
version: '1.0'
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Kubernetes Operations
|
|
21
|
+
|
|
22
|
+
Deploy and manage containerized applications on Kubernetes clusters.
|
|
23
|
+
|
|
24
|
+
## Prerequisites
|
|
25
|
+
|
|
26
|
+
- kubectl installed and configured
|
|
27
|
+
- Access to a Kubernetes cluster
|
|
28
|
+
- Basic understanding of containers
|
|
29
|
+
|
|
30
|
+
## Core Resources
|
|
31
|
+
|
|
32
|
+
### Deployment
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
apiVersion: apps/v1
|
|
36
|
+
kind: Deployment
|
|
37
|
+
metadata:
|
|
38
|
+
name: myapp
|
|
39
|
+
labels:
|
|
40
|
+
app: myapp
|
|
41
|
+
spec:
|
|
42
|
+
replicas: 3
|
|
43
|
+
selector:
|
|
44
|
+
matchLabels:
|
|
45
|
+
app: myapp
|
|
46
|
+
template:
|
|
47
|
+
metadata:
|
|
48
|
+
labels:
|
|
49
|
+
app: myapp
|
|
50
|
+
spec:
|
|
51
|
+
containers:
|
|
52
|
+
- name: myapp
|
|
53
|
+
image: myapp:1.0.0
|
|
54
|
+
ports:
|
|
55
|
+
- containerPort: 8080
|
|
56
|
+
resources:
|
|
57
|
+
requests:
|
|
58
|
+
memory: "128Mi"
|
|
59
|
+
cpu: "100m"
|
|
60
|
+
limits:
|
|
61
|
+
memory: "256Mi"
|
|
62
|
+
cpu: "500m"
|
|
63
|
+
livenessProbe:
|
|
64
|
+
httpGet:
|
|
65
|
+
path: /health
|
|
66
|
+
port: 8080
|
|
67
|
+
initialDelaySeconds: 10
|
|
68
|
+
periodSeconds: 10
|
|
69
|
+
readinessProbe:
|
|
70
|
+
httpGet:
|
|
71
|
+
path: /ready
|
|
72
|
+
port: 8080
|
|
73
|
+
initialDelaySeconds: 5
|
|
74
|
+
periodSeconds: 5
|
|
75
|
+
env:
|
|
76
|
+
- name: DATABASE_URL
|
|
77
|
+
valueFrom:
|
|
78
|
+
secretKeyRef:
|
|
79
|
+
name: myapp-secrets
|
|
80
|
+
key: database-url
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Service
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
apiVersion: v1
|
|
87
|
+
kind: Service
|
|
88
|
+
metadata:
|
|
89
|
+
name: myapp
|
|
90
|
+
spec:
|
|
91
|
+
selector:
|
|
92
|
+
app: myapp
|
|
93
|
+
ports:
|
|
94
|
+
- port: 80
|
|
95
|
+
targetPort: 8080
|
|
96
|
+
type: ClusterIP
|
|
97
|
+
---
|
|
98
|
+
# LoadBalancer for external access
|
|
99
|
+
apiVersion: v1
|
|
100
|
+
kind: Service
|
|
101
|
+
metadata:
|
|
102
|
+
name: myapp-external
|
|
103
|
+
spec:
|
|
104
|
+
selector:
|
|
105
|
+
app: myapp
|
|
106
|
+
ports:
|
|
107
|
+
- port: 80
|
|
108
|
+
targetPort: 8080
|
|
109
|
+
type: LoadBalancer
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Ingress
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
apiVersion: networking.k8s.io/v1
|
|
116
|
+
kind: Ingress
|
|
117
|
+
metadata:
|
|
118
|
+
name: myapp
|
|
119
|
+
annotations:
|
|
120
|
+
nginx.ingress.kubernetes.io/rewrite-target: /
|
|
121
|
+
spec:
|
|
122
|
+
ingressClassName: nginx
|
|
123
|
+
tls:
|
|
124
|
+
- hosts:
|
|
125
|
+
- myapp.example.com
|
|
126
|
+
secretName: myapp-tls
|
|
127
|
+
rules:
|
|
128
|
+
- host: myapp.example.com
|
|
129
|
+
http:
|
|
130
|
+
paths:
|
|
131
|
+
- path: /
|
|
132
|
+
pathType: Prefix
|
|
133
|
+
backend:
|
|
134
|
+
service:
|
|
135
|
+
name: myapp
|
|
136
|
+
port:
|
|
137
|
+
number: 80
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Configuration Management
|
|
141
|
+
|
|
142
|
+
### ConfigMap
|
|
143
|
+
|
|
144
|
+
```yaml
|
|
145
|
+
apiVersion: v1
|
|
146
|
+
kind: ConfigMap
|
|
147
|
+
metadata:
|
|
148
|
+
name: myapp-config
|
|
149
|
+
data:
|
|
150
|
+
config.yaml: |
|
|
151
|
+
server:
|
|
152
|
+
port: 8080
|
|
153
|
+
logging:
|
|
154
|
+
level: info
|
|
155
|
+
APP_ENV: production
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
```yaml
|
|
159
|
+
# Using ConfigMap
|
|
160
|
+
containers:
|
|
161
|
+
- name: myapp
|
|
162
|
+
envFrom:
|
|
163
|
+
- configMapRef:
|
|
164
|
+
name: myapp-config
|
|
165
|
+
volumeMounts:
|
|
166
|
+
- name: config
|
|
167
|
+
mountPath: /etc/config
|
|
168
|
+
volumes:
|
|
169
|
+
- name: config
|
|
170
|
+
configMap:
|
|
171
|
+
name: myapp-config
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Secret
|
|
175
|
+
|
|
176
|
+
```yaml
|
|
177
|
+
apiVersion: v1
|
|
178
|
+
kind: Secret
|
|
179
|
+
metadata:
|
|
180
|
+
name: myapp-secrets
|
|
181
|
+
type: Opaque
|
|
182
|
+
stringData:
|
|
183
|
+
database-url: postgres://user:pass@host:5432/db
|
|
184
|
+
api-key: secret-key-value
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Create secret from command line
|
|
189
|
+
kubectl create secret generic myapp-secrets \
|
|
190
|
+
--from-literal=database-url='postgres://...' \
|
|
191
|
+
--from-file=tls.crt=cert.pem
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## kubectl Commands
|
|
195
|
+
|
|
196
|
+
### Resource Management
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# Apply configuration
|
|
200
|
+
kubectl apply -f deployment.yaml
|
|
201
|
+
|
|
202
|
+
# Get resources
|
|
203
|
+
kubectl get pods
|
|
204
|
+
kubectl get deployments
|
|
205
|
+
kubectl get services
|
|
206
|
+
kubectl get all -n myapp
|
|
207
|
+
|
|
208
|
+
# Describe resource
|
|
209
|
+
kubectl describe pod myapp-xxx
|
|
210
|
+
|
|
211
|
+
# Delete resource
|
|
212
|
+
kubectl delete -f deployment.yaml
|
|
213
|
+
kubectl delete pod myapp-xxx
|
|
214
|
+
|
|
215
|
+
# Edit resource
|
|
216
|
+
kubectl edit deployment myapp
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Debugging
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# View logs
|
|
223
|
+
kubectl logs myapp-xxx
|
|
224
|
+
kubectl logs -f myapp-xxx --tail=100
|
|
225
|
+
kubectl logs myapp-xxx -c sidecar # specific container
|
|
226
|
+
|
|
227
|
+
# Execute command
|
|
228
|
+
kubectl exec -it myapp-xxx -- /bin/sh
|
|
229
|
+
|
|
230
|
+
# Port forward
|
|
231
|
+
kubectl port-forward svc/myapp 8080:80
|
|
232
|
+
kubectl port-forward pod/myapp-xxx 8080:8080
|
|
233
|
+
|
|
234
|
+
# View events
|
|
235
|
+
kubectl get events --sort-by='.lastTimestamp'
|
|
236
|
+
|
|
237
|
+
# Debug pod
|
|
238
|
+
kubectl debug myapp-xxx -it --image=busybox
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Scaling
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Manual scaling
|
|
245
|
+
kubectl scale deployment myapp --replicas=5
|
|
246
|
+
|
|
247
|
+
# Autoscaling
|
|
248
|
+
kubectl autoscale deployment myapp \
|
|
249
|
+
--min=2 --max=10 \
|
|
250
|
+
--cpu-percent=80
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Horizontal Pod Autoscaler
|
|
254
|
+
|
|
255
|
+
```yaml
|
|
256
|
+
apiVersion: autoscaling/v2
|
|
257
|
+
kind: HorizontalPodAutoscaler
|
|
258
|
+
metadata:
|
|
259
|
+
name: myapp
|
|
260
|
+
spec:
|
|
261
|
+
scaleTargetRef:
|
|
262
|
+
apiVersion: apps/v1
|
|
263
|
+
kind: Deployment
|
|
264
|
+
name: myapp
|
|
265
|
+
minReplicas: 2
|
|
266
|
+
maxReplicas: 10
|
|
267
|
+
metrics:
|
|
268
|
+
- type: Resource
|
|
269
|
+
resource:
|
|
270
|
+
name: cpu
|
|
271
|
+
target:
|
|
272
|
+
type: Utilization
|
|
273
|
+
averageUtilization: 80
|
|
274
|
+
- type: Resource
|
|
275
|
+
resource:
|
|
276
|
+
name: memory
|
|
277
|
+
target:
|
|
278
|
+
type: Utilization
|
|
279
|
+
averageUtilization: 80
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Persistent Storage
|
|
283
|
+
|
|
284
|
+
### PersistentVolumeClaim
|
|
285
|
+
|
|
286
|
+
```yaml
|
|
287
|
+
apiVersion: v1
|
|
288
|
+
kind: PersistentVolumeClaim
|
|
289
|
+
metadata:
|
|
290
|
+
name: myapp-data
|
|
291
|
+
spec:
|
|
292
|
+
accessModes:
|
|
293
|
+
- ReadWriteOnce
|
|
294
|
+
storageClassName: standard
|
|
295
|
+
resources:
|
|
296
|
+
requests:
|
|
297
|
+
storage: 10Gi
|
|
298
|
+
---
|
|
299
|
+
# Using PVC
|
|
300
|
+
containers:
|
|
301
|
+
- name: myapp
|
|
302
|
+
volumeMounts:
|
|
303
|
+
- name: data
|
|
304
|
+
mountPath: /data
|
|
305
|
+
volumes:
|
|
306
|
+
- name: data
|
|
307
|
+
persistentVolumeClaim:
|
|
308
|
+
claimName: myapp-data
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## StatefulSet
|
|
312
|
+
|
|
313
|
+
```yaml
|
|
314
|
+
apiVersion: apps/v1
|
|
315
|
+
kind: StatefulSet
|
|
316
|
+
metadata:
|
|
317
|
+
name: postgres
|
|
318
|
+
spec:
|
|
319
|
+
serviceName: postgres
|
|
320
|
+
replicas: 3
|
|
321
|
+
selector:
|
|
322
|
+
matchLabels:
|
|
323
|
+
app: postgres
|
|
324
|
+
template:
|
|
325
|
+
metadata:
|
|
326
|
+
labels:
|
|
327
|
+
app: postgres
|
|
328
|
+
spec:
|
|
329
|
+
containers:
|
|
330
|
+
- name: postgres
|
|
331
|
+
image: postgres:15
|
|
332
|
+
ports:
|
|
333
|
+
- containerPort: 5432
|
|
334
|
+
volumeMounts:
|
|
335
|
+
- name: data
|
|
336
|
+
mountPath: /var/lib/postgresql/data
|
|
337
|
+
volumeClaimTemplates:
|
|
338
|
+
- metadata:
|
|
339
|
+
name: data
|
|
340
|
+
spec:
|
|
341
|
+
accessModes: ["ReadWriteOnce"]
|
|
342
|
+
resources:
|
|
343
|
+
requests:
|
|
344
|
+
storage: 10Gi
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Jobs and CronJobs
|
|
348
|
+
|
|
349
|
+
### Job
|
|
350
|
+
|
|
351
|
+
```yaml
|
|
352
|
+
apiVersion: batch/v1
|
|
353
|
+
kind: Job
|
|
354
|
+
metadata:
|
|
355
|
+
name: migration
|
|
356
|
+
spec:
|
|
357
|
+
template:
|
|
358
|
+
spec:
|
|
359
|
+
containers:
|
|
360
|
+
- name: migrate
|
|
361
|
+
image: myapp:1.0.0
|
|
362
|
+
command: ["./migrate.sh"]
|
|
363
|
+
restartPolicy: Never
|
|
364
|
+
backoffLimit: 3
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### CronJob
|
|
368
|
+
|
|
369
|
+
```yaml
|
|
370
|
+
apiVersion: batch/v1
|
|
371
|
+
kind: CronJob
|
|
372
|
+
metadata:
|
|
373
|
+
name: backup
|
|
374
|
+
spec:
|
|
375
|
+
schedule: "0 2 * * *"
|
|
376
|
+
jobTemplate:
|
|
377
|
+
spec:
|
|
378
|
+
template:
|
|
379
|
+
spec:
|
|
380
|
+
containers:
|
|
381
|
+
- name: backup
|
|
382
|
+
image: backup-tool:latest
|
|
383
|
+
command: ["./backup.sh"]
|
|
384
|
+
restartPolicy: OnFailure
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
## Network Policies
|
|
388
|
+
|
|
389
|
+
```yaml
|
|
390
|
+
apiVersion: networking.k8s.io/v1
|
|
391
|
+
kind: NetworkPolicy
|
|
392
|
+
metadata:
|
|
393
|
+
name: myapp-network-policy
|
|
394
|
+
spec:
|
|
395
|
+
podSelector:
|
|
396
|
+
matchLabels:
|
|
397
|
+
app: myapp
|
|
398
|
+
policyTypes:
|
|
399
|
+
- Ingress
|
|
400
|
+
- Egress
|
|
401
|
+
ingress:
|
|
402
|
+
- from:
|
|
403
|
+
- podSelector:
|
|
404
|
+
matchLabels:
|
|
405
|
+
app: frontend
|
|
406
|
+
ports:
|
|
407
|
+
- protocol: TCP
|
|
408
|
+
port: 8080
|
|
409
|
+
egress:
|
|
410
|
+
- to:
|
|
411
|
+
- podSelector:
|
|
412
|
+
matchLabels:
|
|
413
|
+
app: database
|
|
414
|
+
ports:
|
|
415
|
+
- protocol: TCP
|
|
416
|
+
port: 5432
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
## Contents
|
|
421
|
+
|
|
422
|
+
- [Resource Quotas](references/details.md)
|
|
423
|
+
- [Rolling Updates](references/details.md)
|
|
424
|
+
- [Common Issues](references/details.md)
|
|
425
|
+
- [Best Practices](references/details.md)
|
|
426
|
+
- [Related Skills](references/details.md)
|
|
427
|
+
|
|
428
|
+
## When to Use This Skill
|
|
429
|
+
|
|
430
|
+
Use this skill when:
|
|
431
|
+
- Deploying applications to Kubernetes
|
|
432
|
+
- Managing pods, deployments, and services
|
|
433
|
+
- Configuring resource limits and scaling
|
|
434
|
+
- Troubleshooting Kubernetes workloads
|
|
435
|
+
- Setting up networking and ingress
|
|
436
|
+
|
|
437
|
+
## Limitations
|
|
438
|
+
|
|
439
|
+
- Guidance executes against real environments: confirm target, blast radius, and rollback plan before applying anything.
|
|
440
|
+
- Never deploy to production without explicit approval. Docs-only import: upstream scripts and templates not bundled.
|
|
441
|
+
|
|
442
|
+
### Example
|
|
443
|
+
|
|
444
|
+
```bash
|
|
445
|
+
git status && git diff --stat
|
|
446
|
+
kubectl diff -f manifest.yaml
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
> Adapted from [BagelHole/DevOps-Security-Agent-Skills](https://github.com/BagelHole/DevOps-Security-Agent-Skills) (MIT); frontmatter, When to Use/Limitations, and safety boundaries added for upstream compliance. Docs-only import: helper scripts and templates not bundled.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Details (moved from SKILL.md)
|
|
2
|
+
|
|
3
|
+
> Extended reference content for `kubernetes-ops`, kept under `references/` so the entrypoint stays within the audit budget.
|
|
4
|
+
|
|
5
|
+
## Resource Quotas
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
apiVersion: v1
|
|
9
|
+
kind: ResourceQuota
|
|
10
|
+
metadata:
|
|
11
|
+
name: myapp-quota
|
|
12
|
+
namespace: myapp
|
|
13
|
+
spec:
|
|
14
|
+
hard:
|
|
15
|
+
requests.cpu: "10"
|
|
16
|
+
requests.memory: 20Gi
|
|
17
|
+
limits.cpu: "20"
|
|
18
|
+
limits.memory: 40Gi
|
|
19
|
+
pods: "20"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Rolling Updates
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
spec:
|
|
27
|
+
strategy:
|
|
28
|
+
type: RollingUpdate
|
|
29
|
+
rollingUpdate:
|
|
30
|
+
maxSurge: 1
|
|
31
|
+
maxUnavailable: 0
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Update image
|
|
36
|
+
kubectl set image deployment/myapp myapp=myapp:2.0.0
|
|
37
|
+
|
|
38
|
+
# Check rollout status
|
|
39
|
+
kubectl rollout status deployment/myapp
|
|
40
|
+
|
|
41
|
+
# View history
|
|
42
|
+
kubectl rollout history deployment/myapp
|
|
43
|
+
|
|
44
|
+
# Rollback
|
|
45
|
+
kubectl rollout undo deployment/myapp
|
|
46
|
+
kubectl rollout undo deployment/myapp --to-revision=2
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Common Issues
|
|
51
|
+
|
|
52
|
+
### Issue: Pod Stuck in Pending
|
|
53
|
+
**Problem**: Pod won't start
|
|
54
|
+
**Solution**: Check resource availability, node selector, PVC binding
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
kubectl describe pod myapp-xxx
|
|
58
|
+
kubectl get events
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Issue: CrashLoopBackOff
|
|
62
|
+
**Problem**: Container keeps restarting
|
|
63
|
+
**Solution**: Check logs, verify entrypoint, check probes
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
kubectl logs myapp-xxx --previous
|
|
67
|
+
kubectl describe pod myapp-xxx
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Issue: Service Not Accessible
|
|
71
|
+
**Problem**: Cannot connect to service
|
|
72
|
+
**Solution**: Check selector labels, verify endpoints exist
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
kubectl get endpoints myapp
|
|
76
|
+
kubectl describe svc myapp
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Issue: Image Pull Error
|
|
80
|
+
**Problem**: ImagePullBackOff
|
|
81
|
+
**Solution**: Check image name, verify registry credentials
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
kubectl create secret docker-registry regcred \
|
|
85
|
+
--docker-server=registry.example.com \
|
|
86
|
+
--docker-username=user \
|
|
87
|
+
--docker-password=pass
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## Best Practices
|
|
92
|
+
|
|
93
|
+
- Always set resource requests and limits
|
|
94
|
+
- Implement liveness and readiness probes
|
|
95
|
+
- Use namespaces for isolation
|
|
96
|
+
- Apply network policies for security
|
|
97
|
+
- Use ConfigMaps and Secrets for configuration
|
|
98
|
+
- Implement pod disruption budgets for availability
|
|
99
|
+
- Use labels consistently for organization
|
|
100
|
+
- Enable RBAC for access control
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## Related Skills
|
|
104
|
+
|
|
105
|
+
- helm-charts (`helm-charts`) - Package management
|
|
106
|
+
- argocd-gitops (`argocd-gitops`) - GitOps deployments
|
|
107
|
+
- kubernetes-hardening (`kubernetes-hardening`) - Security
|
|
108
|
+
|