- firewalld
- selinux
- rpm packages list
- iptables & iptable nat rules
- system level settings - sysctl -a output
- Operating system release and kernel versions
- List of all the services on the operating system
- All the repositories that are enabled and disabled
- Swap settings
- Loaded modules (modprobe settings)
- Sudo users
Main Menu
- Home
- Kubernetes
- Containerization Stack (DevOps)
- Oracle Cloud Native Environment (OCNE)
- Linux
- Linux "FIND" Command related Articles
- Linux "YUM" Command related Articles
- Linux "PS" Command related Articles
- "AWK" Command related Articles
- Linux "RPM" Command related Articles
- "PING" Command related Articles
- "NTP" related Articles
- Linux Network related Articles and Commands
- Linux Security related Articles
- Linux Troubleshooting Articles
- Linux FILESYSTEM related Articles
- Linux INFINIBAND Network related Articles
- Linux "MOUNT" Command related Articles
- Linux Shell Script Articles
- "BIOS" related Linux Articles
- "NFS" related Articles
- "GREP" Commands related Articles
- Linux "CPU" & "Memory" related Articles
- "SED" Command related Articles
- "SYSTEMCTL" Commands related Articles
- Logical Volumes related Articles
- "TCPDUMPS" related Articles
- GitHub Repositories (tarbots)
- About tarbots
Search
KUBERNETES: Operating System Commands To Validate Kubernetes Related OS Settings For Comparing and Troubleshooting Issues
KUBERNETES: KUBECTL Command To Check Health Status and Liveliness Probe (livez check) Of Kubernetes Components
KUBERNETES: KUBECTL Command To Check UnHealthy Status Pods
KUBERNETES: KUBECTL Command To Check Kubernetes Components Status
KUBERNETES: Kubectl Command To View All Pods And List Containers & Images Part Of the All Pods (How To)
KUBERNETES - How To Verify DNS Resolution Is Working and CoreDNS Pods Are Healthy In Kubernetes?
To verify / validate / check DNS resolution is working and coredns pods are healthy in Kubernetes, we can deploy dnsutils pods and run nslookup tests. More information on deploying dnsutils pod and running nslookup tests can be found in below kubernetes.io documentation.
https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/
KUBERNETES: Kubectl Command To Tail CoreDNS Pod Service Logs (Kube-Dns)
KUBERNETES: How To Quickly Test App Pod Without A Service & Not Exposed Externally Whether It is Accessible And Working?
- Identify the port on which app is listening/running in the pod.
- One of the control nodes, use kubectl port-forward command to forward requests coming into IP address/Port on the control node to app pod and port on which app is listening on the pod.
- Access the application via curl, wget or from browser using the IP address and port of the control node on which kubectl port-forward command is being executed.
KUBERNETES: Kubectl Port-Forward Command To Test Request Forwarding To Pods To Debug Network Issues
KUBERNETES: Kubectl Command To Create Temporary Pod and Connect For Testing
Below is the command to create busybox temporary pod.
If you don't see a command prompt, try pressing enter.
/ #
/ # exit
KUBERNETES: Kubectl Commands To Check CoreDNS (kube-dns) Pods, Services & Logs
Below are commands to check coredns (kube-dns) pods, services and logs.
For listing kube-dns coredns pods, below command can be used.
# kubectl get pods --namespace=kube-system -l k8s-app=kube-dns
For listing the kube-dns service, below command cna be used.
# kubectl get svc --namespace=kube-system
For checking the logs of kube-dns pods below command can be used.
# kubectl logs --namespace=kube-system -l k8s-app=kube-dns
KUBERNETES: Kubectl Commands To Check CoreDNS (kube-dns) DNS Service Logs
KUBERNETES: Kubectl Commands To Check CoreDNS (kube-dns) DNS Service Logs
Below commands can be used.
kubectl logs --namespace=kube-system -l k8s-app=kube-dns
For continuously failing the log below command can be used.
kubectl logs --follow -n kube-system --selector 'k8s-app=kube-dns'
KUBERNETES: Kubectl Command To Check Events On A Pod
KUBERNETES: How To Enable core_pattern On the Linux Host To Generate Coredump File For Pods/Containers Crash Issue
KUBERNETES: How To Enable core_pattern On the Linux Host To Generate Coredump File For Pods/Containers Crash Issue
A core_pattern defines the name and path for the core dump file if there is a crash of pods or containers due to segfault or system calls. Coredump file contains an image of the process’s memory at the time of termination.
Below are steps for enabling core_pattern on the Linux hosts to generate coredump if the pod or container crashes.
1) Make a note of the default core pattern setting using below command.
cat /proc/sys/kernel/core_pattern
Default value will be core.
2) Change the core pattern as follows:
sysctl -w "kernel.core_pattern=|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h"
3) Verify that the core handler changed to systemd core handler by runnign below command.
cat /proc/sys/kernel/core_pattern
You should see output as follows:
|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h
How to Check and collect the coredump in case of pods/containers crash
1) If the pods are in crashloopbackoff state or error state due to segfault or system calls from OS, check and identify pods corefile PID using below command.
coredumpctl list
Below is sample output of above command which shows testpod under EXE column. The pid for the pod is 1459 in this case
# coredumpctl list
TIMEPID UID GID SIG PRESENT EXE
Tue 2024-01-09 20:51:56 GMT1459 0 0 3 * /usr/local/bin/testpod
2) Once the PID is identified dump the core to a file using below command. In below command replace 1459 PID with the identified coredns pid.
coredumpctl dump 1459 > /tmp/coredump.out
/tmp/coredump.out will be your coredump file.
In case you want to revert back the core_pattern to default value which was there before, for e.g. to set it back to default core, run below command.
sysctl -w "kernel.core_pattern=core"
KUBERNETES: How to Capture TCPDumps To Check Where CoreDNS Is Communicating To External DNS?
KUBERNETES: How to Capture TCPDumps To Check Where CoreDNS Is Communicating To External DNS?