Welcome to the Linux Foundation Forum!
Lab 4.2. Could not get pod logs - "Error from server (NotFound)"

I'm trying to complete "Lab 4.2. Working with CPU and Memory Constraints" and faced following troubles.
I've deployed "hog" successfully:
$ kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE default hog-775c7c858f-c2nmk 1/1 Running 0 10s kube-system calico-kube-controllers-69496d8b75-knwzg 1/1 Running 1 3d14h kube-system calico-node-cnj4n 1/1 Running 1 3d14h kube-system calico-node-cw5wb 1/1 Running 1 3d14h kube-system coredns-f9fd979d6-w77l2 1/1 Running 1 3d14h kube-system coredns-f9fd979d6-wzmmq 1/1 Running 1 3d14h kube-system etcd-k8smaster 1/1 Running 1 3d14h kube-system kube-apiserver-k8smaster 1/1 Running 1 3d14h kube-system kube-controller-manager-k8smaster 1/1 Running 1 3d14h kube-system kube-proxy-srth7 1/1 Running 1 3d14h kube-system kube-proxy-xwnhc 1/1 Running 1 3d14h kube-system kube-scheduler-k8smaster 1/1 Running 1 3d14h
But could not get logs for it:
$ kubectl --namespace default logs hog-775c7c858f-c2nmk Error from server (NotFound): the server could not find the requested resource ( pods/log hog-775c7c858f-c2nmk)
Could anybody help?
0
Comments
Hi @Gim6626,
Can you try running
kubectl logs hog-775c7c858f-c2nmk
instead? To provide thedefault
namespace name is not necessary forkubectl
commands. If desired, however, you may try to add the namespace after thelogs
command, as suchkubectl logs hog-775c7c858f-c2nmk --namespace default
.Regards,
-Chris
Hi! @chrispokorni,
I've tried what you've asked. Same result:
Hi @Gim6626,
After creating the hog deployment, can you run a
kubectl describe pod hog-<TAB>
? Can you provide its output?Also, what are the specs of your nodes (CPU and MEM)? What are the specified values of the MEM
requests
andlimits
for the hog application?Regards,
-Chris
@chrispokorni, thank you for trying to help me. I really appreciate it.
Here is requested
describe
output (withrequests
andlimits
info both there):I'm operating on two VirtualBox nodes (master and worker), each with
MemTotal: 4039204 kB
according to/proc/meminfo
Noticed that limits may be too high, recreated hog with
Limits/memory = 1Gi
andRequests/memory=500Mi
- same thing:Funny fact actually. Pod exists in list, it autocompletes, but "NotFound".
Hi @Gim6626,
The failed volume mount from the warning message may be the result of the server-2's
kubelet
not being able to resolve a required dependency.With MEM at a bare minimum, how much CPU is assigned to each VM?
Have you noticed any changes after your VM/nodes are rebooted?
Regards,
-Chris
I've got 6-core 12-thread MacBook Pro as host and for each node (master, worker) I've assigned 2 CPU.
After reboot/new container start - nothing interesting.
Now I'm at lab 8.1 and have created pod
shell-demo
, it exists at the list:but:
Looks like related thing.
Got it after more googling. There was networking error.
Here is how I've found that something is wrong:
First IP is OK, it is internal IP, and second is NAT IP (same for both machines).
So I've manually set internal IPs (192.168.56.104 for master and 192.168.56.105 for worker) in
/etc/kubernetes/kubelet.conf
(usingKUBELET_EXTRA_ARGS=--node-ip=192.168.56.104
) and restarted kubeletsystemctl restart kubelet.service
.Hi @Gim6626,
When there are more than one network interfaces on a node, Kubernetes tends to misbehave. A single bridged adapter for each node should provide you with all the required networking - node-to-node, node-to-internet, and node-to-host/host-to-node connectivity.
Regards,
-Chris