Cheatography
https://cheatography.com
Kubernetes kubectl reference
Viewing / Accessing resources
kubectl get --all-namespaces {resource_type}
|
Get resource from all namespaces |
kubectl describe {resource_type}
|
Describes the given resources |
kubectl rolling-update {pod_name}
|
Performs a rolling update for a given pod |
kubectl scale --replicas=3 {resource_type}/{resource_name}
|
Scale given resource |
|
Proxy the api server API to your local machine on port 8001 |
kubectl port-forward {pod_name} {local_port}:{remote_port}
|
Forward the pod port to your local port |
Creating /editing objects
kubectl apply -f ./my-manifest.yaml
|
Apply a configuration to a resource by filename or stdin. Also overrides the existing configuration. |
kubectl create -f ./my-manifest.yaml
|
Create resource(s) |
|
Create resource(s) in all manifest files in dir |
|
Create from url |
kubectl run nginx --image=nginx
|
Start a single instance of nginx |
kubectl replace --force -f ./pod.json
|
Force replace, delete and then re-create the resource. Will cause a service outage. |
kubectl edit svc/docker-registry
|
Edit the service named docker-registry |
|
|
Resource types
|
ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable. |
|
A DaemonSet ensures that all (or some) Nodes run a copy of a Pod. |
|
A Deployment controller provides declarative updates for Pods and ReplicaSets. |
|
An Ingress is a collection of rules that allow inbound connections to reach the cluster services. |
|
A job creates one or more pods and ensures that a specified number of them successfully terminate. |
|
Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. |
|
Nodes are the physical cluster nodes. |
persistentvolumeclaims
|
A PersistentVolumeClaim (PVC) is a request for storage by a user. |
|
A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator. |
|
A Pod is the basic building block of Kubernetes–the smallest and simplest unit in the Kubernetes object model that you create or deploy. |
|
A ReplicaSet ensures that a specified number of pod replicas are running at any one time. |
|
A Cron Job manages time based Jobs. |
|
Objects of type secret are intended to hold sensitive information. |
|
A Kubernetes Service is an abstraction which defines a logical set of Pods and a policy by which to access them. |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets