Kubernetes Resources Links & Useful Commands
Quote from moshe on 27/10/2020, 7:53 amKubernetes Cheatsheet
Here you can find a detailed list of Kubernetes management commands
Kubespray
Composition of Ansible playbooks, inventory, provisioning tools, and domain knowledge for generic OS/Kubernetes clusters configuration management tasks. Kubespray provides: a highly available cluster. composable attributes. support for most popular Linux distributions.https://github.com/kubernetes-sigs/kubespray
Kubetail
Bash script that enables you to aggregate (tail/follow) logs from multiple pods into one stream. This is the same as running “kubectl logs -f ” but for multiple pods.
Kubernetes Cheatsheet
Here you can find a detailed list of Kubernetes management commands
Kubespray
https://github.com/kubernetes-sigs/kubespray
Kubetail
Bash script that enables you to aggregate (tail/follow) logs from multiple pods into one stream. This is the same as running “kubectl logs -f ” but for multiple pods.
Quote from moshe on 25/07/2022, 7:03 pmUseful Kubernetes Commands
List All Nodes, Namespace, Containers and networking
kubectl get po –all-namespaces -o=jsonpath=”{range .items[*]}{.spec.nodeName}{‘\t’}{.spec.hostNetwork}{‘\t’}{.metadata.namespace}{‘\t’}{.metadata.name}{‘\t’}{.spec.hostNetwork}{‘\t’}{.spec.containers..containerPort}{‘\n’}{end}”
List Containers in Pending state
kubectl get po –all-namespaces -o wide | grep Pending
List Nodes and Ports
kubectl get po –all-namespaces -o=jsonpath=”{range .items[*]}{.spec.nodeName}{‘\t’}{.spec.hostNetwork}{‘\t’}{.spec.hostNetwork}{‘\t’}{.spec.containers..containerPort}{‘\n’}{end}”
List Kubernetes Cluster networking setup
kubectl –namespace kube-system get configmap kubeadm-config -o yaml
Generate Join token for additional workers / control-plane in the cluster
kubeadm token create –print-join-command
Schedule Pods on the control plane nodes
kubectl taint nodes –all node-role.kubernetes.io/control-plane- node-role.kubernetes.io/master-
Check All system Events
kubectl get events
Useful Kubernetes Commands
List All Nodes, Namespace, Containers and networking
kubectl get po –all-namespaces -o=jsonpath=”{range .items[*]}{.spec.nodeName}{‘\t’}{.spec.hostNetwork}{‘\t’}{.metadata.namespace}{‘\t’}{.metadata.name}{‘\t’}{.spec.hostNetwork}{‘\t’}{.spec.containers..containerPort}{‘\n’}{end}”
List Containers in Pending state
kubectl get po –all-namespaces -o wide | grep Pending
List Nodes and Ports
kubectl get po –all-namespaces -o=jsonpath=”{range .items[*]}{.spec.nodeName}{‘\t’}{.spec.hostNetwork}{‘\t’}{.spec.hostNetwork}{‘\t’}{.spec.containers..containerPort}{‘\n’}{end}”
List Kubernetes Cluster networking setup
kubectl –namespace kube-system get configmap kubeadm-config -o yaml
Generate Join token for additional workers / control-plane in the cluster
kubeadm token create –print-join-command
Schedule Pods on the control plane nodes
kubectl taint nodes –all node-role.kubernetes.io/control-plane- node-role.kubernetes.io/master-
Check All system Events
kubectl get events
Uploaded files: