Skip to main content

kubectl

The Kubernetes command-line tool allows you to run commands against Kubernetes clusters.

Prerequisites

  • p6m CLI - For SSO and cluster configuration

Installation

Official installation guide: kubernetes.io/docs/tasks/tools

# Using winget
winget install Kubernetes.kubectl

# Using Chocolatey
choco install kubernetes-cli

Verify Installation

kubectl version --client

Quick Reference

For day-to-day usage, see the official kubectl Cheat Sheet.

Essential Commands

# View cluster info
kubectl cluster-info

# List resources
kubectl get pods
kubectl get pods -A # all namespaces

# Inspect resources
kubectl describe pod <pod-name>
kubectl logs <pod-name>

# Interactive access
kubectl exec -it <pod-name> -- /bin/bash