k8s
k8s
Purpose
This skill enables the AI to orchestrate and manage containerized applications using Kubernetes, focusing on scaling, deployment, and maintenance of pods, services, and deployments in a cluster.
When to Use
Use this skill for deploying multi-container apps, scaling workloads dynamically, managing resources in production environments, or troubleshooting cluster issues. Apply it when handling container orchestration beyond basic Docker, such as in CI/CD pipelines or microservices architectures.
Key Capabilities
- Deploy and manage pods using YAML manifests or imperative commands.
- Scale applications with deployments and replicasets, e.g., autoscaling based on CPU metrics.
- Expose services via ClusterIP, NodePort, or LoadBalancer types.
- Handle storage with PersistentVolumes and PersistentVolumeClaims.
- Monitor and debug resources using built-in tools like kubectl logs and events.
- Integrate with networking plugins for service discovery and load balancing.
- Manage secrets and config maps for secure configuration.
Usage Patterns
Always authenticate with a valid kubeconfig file, set via the $KUBECONFIG environment variable. For declarative setups, write YAML files and apply them; for imperative tasks, use kubectl directly. Pattern: Load context with kubectl config use-context my-context, then perform actions. Include error checks in scripts, e.g., verify command exit codes.