Kubernetes Quick Reference
Basics
kubectl
is the client app that communicates with the master nodes.
Configuration
Command | Description |
---|---|
kubectl config ... | Get/Set configuration |
kubectl config current-context | Get current context. you are running against. A context element in a kubeconfig file is used to group access parameters under a convenient name. Each context has three parameters: cluster, namespace, and user. |
kubectl config get-contexts | Get a list of available contexts |
Pods
Resource Structure
1 2 3 4 5 6 |
apiVersion: [version] kind: [resource] metadata: [fields...] spec: [fields...] |
Key | Description |
---|---|
apiVersion | Kubernetes API version. Review each resource documentation for the API version string. |
kind | Type of Resource. See kubectl api-resources for available resources |
metadata | Information about the pod. See kubectl explain pods.metadata for more information. |
spec | Description of the pods contents. See kubectl explain pods.sepc for more information. |
You can list the pods current structure with kubectl get pod [pod-name] -o yaml
. The running structure has a lot more items in it.