Reference Guide
This section provides quick reference materials for Kubernetes cluster operations, including commonly used commands, helpful tools, and best practices for everyday tasks.
Overview
Section titled “Overview”The reference guides in this section are designed to help cluster operators and developers quickly find information they need for common tasks without needing to search through lengthy documentation.
Quick Navigation
Section titled “Quick Navigation”Commands Reference
Section titled “Commands Reference”The Commands Reference provides:
- Frequently used kubectl commands organized by category
- Common command patterns with explanations
- One-liners for complex operations
- Command flags and options reference
Visit the Commands Reference for detailed command examples.
Tools Reference
Section titled “Tools Reference”The Tools Reference provides:
- Essential tools for cluster management
- Installation and setup instructions
- Common use cases for each tool
- Integration with existing workflows
Visit the Tools Reference to learn about useful tools for Kubernetes operations.
Common Quick Reference
Section titled “Common Quick Reference”Kubernetes API Resources
Section titled “Kubernetes API Resources”# List all API resourceskubectl api-resources
# Get details about a specific resource typekubectl explain <resource>
# Examples:kubectl explain podkubectl explain deployment.spec.strategyContext Management
Section titled “Context Management”# List available contextskubectl config get-contexts
# Switch contextkubectl config use-context <context-name>
# Set namespace for current contextkubectl config set-context --current --namespace=<namespace>Getting Help
Section titled “Getting Help”# Get kubectl helpkubectl --help
# Get help for specific commandskubectl <command> --help
# Kubectl cheat sheetkubectl --help | grep cheatBest Practices Quick Reference
Section titled “Best Practices Quick Reference”Command Line Efficiency
Section titled “Command Line Efficiency”- Use shortcuts:
kubectl get poinstead ofkubectl get pods - Set default namespace:
kubectl config set-context --current --namespace=<namespace> - Use kubectl aliases: Create aliases for common commands
- Use kubectl plugins: Install useful plugins with krew
Output Formatting
Section titled “Output Formatting”# Get output in different formatskubectl get pods -o widekubectl get pods -o yamlkubectl get pods -o jsonkubectl get pods -o jsonpath='{.items[*].metadata.name}'kubectl get pods -o custom-columns=NAME:.metadata.name,STATUS:.status.phase
# Sort outputkubectl get pods --sort-by=.metadata.creationTimestamp