Create Debugging / Investigation Pod for Cluster problems
Quote from moshe on 06/09/2022, 8:18 amProblem
User wants to debug the kubernetes environment to check issues such as timeouts, dns errors etc
#Pull and Install a latest ubuntu pod
cat <<EOF | kubectl apply -f –
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
namespace: cert-manager
labels:
app: ubuntu
spec:
containers:
– image: ubuntu
command:
– “sleep”
– “604800”
imagePullPolicy: IfNotPresent
name: ubuntu
restartPolicy: AlwaysNote: Change your namespace according to your needs ( no namespace = default )
Login to your pod
kubectl exec -it ubuntu -n cert-manager /bin/bash
Update System and install utils
apt install iputils-ping traceroute dnsutils tcpdump nmap curl wget jq python3.10 strace ssh telnet
Check Issues with resources in your cluster
Example:
kubectl exec -it ubuntu -n cert-manager /bin/bash
nslookup cert-manager-webhook
Problem
User wants to debug the kubernetes environment to check issues such as timeouts, dns errors etc
#Pull and Install a latest ubuntu pod
cat <<EOF | kubectl apply -f –
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
namespace: cert-manager
labels:
app: ubuntu
spec:
containers:
– image: ubuntu
command:
– “sleep”
– “604800”
imagePullPolicy: IfNotPresent
name: ubuntu
restartPolicy: Always
Note: Change your namespace according to your needs ( no namespace = default )
Login to your pod
kubectl exec -it ubuntu -n cert-manager /bin/bash
Update System and install utils
apt install iputils-ping traceroute dnsutils tcpdump nmap curl wget jq python3.10 strace ssh telnet
Check Issues with resources in your cluster
Example:
kubectl exec -it ubuntu -n cert-manager /bin/bash
nslookup cert-manager-webhook
Uploaded files: