0% found this document useful (0 votes)
20 views

Kubernetes CheatSheet

Uploaded by

Miro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
20 views

Kubernetes CheatSheet

Uploaded by

Miro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 9
KUBERNETES oe Key Concepts Now let’s discuss the key points of this architecture. Pod: These are the group of containers. Labels: These are used to identify the pods. Kubelet: They are container agents, responsible for maintaining the set of pods. Proxy: They are the Load balancer for pods, helping in distributing tasks across the pods. ETCD: A Metadata service. Cadvisor: For resource usage and performance stats. Replication controller: It manages pod replication. Scheduler: Used for pod scheduling in worker nodes. API server: Kubernetes API server. Now let’s understand the role Master and Node play in the Kubernetes Architecture. KUBERNETES Itis an open source platform for automating deployment and scaling of containers across clusters of hosts providing container centric infrastructure. It is a container orchestrator and can run Linux containers: + Launch container. + Maintain and monitor container site. + Performs container-oriented networking Paton] ‘Openshift API Server Build Controller = Deployment Controller Cu container) Container Tool ae Registry E Engine Kubernetes API server Kube Controller Scheduller Replication Controller Master(s) NODE(s) Manage Bui Deploy & Operate Puncontainers and registries It is responsible for maintaining the desired state for the cluster you are working on. + “Master” indicates a set of processes that are used to manage the cluster. Contains info, API, scheduler, replication controllers, and master. A a ao Nodes/Minions Also called as a minion. It contains the services necessary to run the pods that are managed by the master. + Some services include: container runtime, Kubelet, kube-proxy. Contains: Kubelet, cAdvisor, services, pods and containers. Pods and Container Introspection COMMANDS Kubectl get pods Kubectl describe pod Kubectl get re Kubectl get re — namespace="namespace” FUNCTION Lists all current pods Describes the pod names List all replication controllers ists replication controllers in namespace Kubectl describe re ‘Shows the replication controller name Kubectl get eve Lists the services Kubectl describe sve Shows the service name Kubect! delete podcname> Deletes the pod Kubect! get nodes -w Watch nodes continuously all clusterroles crdecustom em=conf gmaps | controllerrevisions | resource definition csr= certificate Cronjobs cs=component status signing requests Deploy=deployments | ds= daemon sets___| epzend points eve events hhpa= autoscaling _| ing= ingress oo Netpol- network jobs limits=limit ranges policies No=nodes ns= namespaces _| pdb= pod po= pods Pod preset Pod templates Psp=pod security | Pv= persistent pce persistent policies volumes volume claims uota= resource _| re= replication a PI Role bindings quotas controllers roles 13= replica sets sc= storage classes _| secrets sts= stateful sets Debugging FUNCTION COMMAND Execute command on service by selecting container. Get logs from service for a container Kubect! exec[- c< $container>] Kubectl logs -fcname>>-c< Scontainer>] Watch the kubelet logs Watch -n 2 cat/var/log/kublet.log Show metrics for node ‘Show metrics for pods Kubect! top node Kubectl top pod Other quick commands Launch a pod with a name an image : Kubectl run — image= Create a service in : Kubectl create -f Scale replication counter to count the number of instances : Kubectl scale -replicas= Map external port to internal replication port : Expose rc- -port=--target-port= To stop all pod in : Kubectl drain—~ delete-local-data—force— ignore-daemonset Allow master nodes to run pods : Kubectltaintnodes —all-node- role.kuernetes.io/master- Cluster introspection | runcion | comman |

You might also like