home / skills / pluginagentmarketplace / custom-plugin-devops / containers

containers skill

/skills/containers

This skill helps you automate Docker and Kubernetes deployments, optimize configurations, and manage production workflows with CI/CD integration.

npx playbooks add skill pluginagentmarketplace/custom-plugin-devops --skill containers

Review the files below or copy the command above to add this skill to your agents.

Files (7)
SKILL.md
2.8 KB
---
name: containers-skill
description: Docker and Kubernetes - containerization, orchestration, and production deployment.
sasmp_version: "1.3.0"
bonded_agent: 03-containers-orchestration
bond_type: PRIMARY_BOND

parameters:
  - name: platform
    type: string
    required: false
    enum: ["docker", "kubernetes", "both"]
    default: "both"
  - name: operation
    type: string
    required: true
    enum: ["build", "deploy", "debug", "optimize", "secure"]

retry_config:
  strategy: exponential_backoff
  initial_delay_ms: 1000
  max_retries: 3

observability:
  logging: structured
  metrics: enabled
---

# Containers & Orchestration Skill

## Overview
Master Docker and Kubernetes for production deployments.

## Parameters
| Name | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| platform | string | No | both | docker/kubernetes |
| operation | string | Yes | - | Operation type |

## Core Topics

### MANDATORY
- Docker fundamentals (images, containers, volumes)
- Dockerfile best practices (multi-stage, security)
- Docker Compose
- Kubernetes architecture
- Deployments, Services, Ingress
- Health checks

### OPTIONAL
- Helm charts
- ConfigMaps and Secrets
- Persistent storage
- Network policies

### ADVANCED
- Custom operators
- Service mesh
- Multi-cluster strategies

## Quick Reference

```bash
# Docker
docker build -t app:v1 .
docker run -d -p 8080:80 --name app app:v1
docker logs -f container
docker exec -it container sh
docker system prune -af

# Docker Compose
docker compose up -d
docker compose logs -f
docker compose down -v

# Kubernetes
kubectl get pods -A
kubectl describe pod pod-name
kubectl logs -f pod-name
kubectl exec -it pod-name -- sh
kubectl apply -f manifest.yaml
kubectl rollout status deployment/app
kubectl rollout undo deployment/app

# Debugging
kubectl get events --sort-by='.lastTimestamp'
kubectl top pods
kubectl run debug --rm -it --image=busybox -- sh

# Helm
helm install release chart
helm upgrade release chart
helm rollback release 1
```

## Troubleshooting

### Common Failures
| Symptom | Root Cause | Solution |
|---------|------------|----------|
| ImagePullBackOff | Image not found | Verify name, check creds |
| CrashLoopBackOff | Container crashing | Check logs, verify CMD |
| Pending | Cannot schedule | Check resources, selectors |
| OOMKilled | Out of memory | Increase limits |

### Debug Checklist
1. Pod status: `kubectl get pods -o wide`
2. Events: `kubectl describe pod`
3. Logs: `kubectl logs pod --previous`
4. Resources: `kubectl top pods`

### Recovery Procedures

#### CrashLoopBackOff
1. Get logs: `kubectl logs pod --previous`
2. Check events: `kubectl describe pod`
3. Test locally: `docker run -it image sh`

## Resources
- [Docker Docs](https://docs.docker.com)
- [Kubernetes Docs](https://kubernetes.io/docs)

Overview

This skill covers Docker and Kubernetes fundamentals for building, deploying, and operating containerized applications in production. It focuses on practical commands, troubleshooting steps, and deployment patterns to streamline CI/CD and runtime operations. The goal is to enable reliable, secure container workflows from development to multi-cluster production.

How this skill works

The skill inspects container lifecycle and orchestration tasks: image build and run, Compose workflows, Kubernetes manifests, rollouts, and runtime debugging. It provides concise command references, root-cause checks for common failures, and step-by-step recovery actions for issues like CrashLoopBackOff and ImagePullBackOff. Optional and advanced topics cover Helm, storage, and multi-cluster strategies for production readiness.

When to use it

  • Setting up CI/CD pipelines that build, test, and push container images.
  • Deploying applications to Kubernetes clusters or testing locally with Docker Compose.
  • Troubleshooting pod failures, image pull errors, or resource-related scheduling issues.
  • Implementing best practices for Dockerfiles, security, and multi-stage builds.
  • Upgrading or rolling back deployments and validating rollout status.

Best practices

  • Use multi-stage Dockerfiles to minimize image size and separate build/runtime concerns.
  • Define health checks and resource requests/limits for predictable scheduling and autoscaling.
  • Store sensitive data in Kubernetes Secrets and configuration in ConfigMaps, not baked into images.
  • Automate rollouts via CI/CD and validate with rollout status and canary/blue-green strategies.
  • Collect logs and metrics (kubectl logs, kubectl top) and centralize them for observability.

Example use cases

  • Build and push a production image, then deploy via kubectl apply and monitor rollout status.
  • Run local development with docker compose up and replicate production probes and env vars.
  • Recover a CrashLoopBackOff by retrieving previous logs, describing events, and testing the image locally.
  • Use Helm to templatize deployments and manage upgrades or rollbacks across environments.
  • Diagnose scheduling failures by checking node capacity, pod selectors, and resource requests.

FAQ

What command finds why a pod is failing?

Start with kubectl describe pod and kubectl logs --previous, then check events with kubectl get events --sort-by='.lastTimestamp'.

How do I reduce image size?

Use multi-stage builds, pick minimal base images, and remove build artifacts before final stage.