Tag Archives: Daily FAQ of operation and maintenance

Error from server (BadRequest): a container name must be specified for pod

report errors

Previously, I used kubectl logs -f <POD-name> -n <nameSpace> to view the logs of a pod. One day when I used this command to check the status of a pod that was runnning, I got an error.

Error from server (BadRequest): a container name must be specified for pod xxx ,choose one of:[xxx  xxx]


Causes and treatment of error reporting

Reason: originally, a pod used a container. When you use the command to view the pod log, the log of the pod’s container will be output…
but one day, the architect adjusted the structure of the pod and enabled multiple containers in a pod. From then on, you need to specify which container to view the pod when viewing the log. You can use the command – C < container_ name> Specify that the name of the container that can be viewed is listed in the choose one of error message

 kubectl logs -f  <POD-name> -n <nameSpace> -c  <container_name> 


write error in swap file problem solving

An error



write error in swap file
write error in swap file



The solution


This error is simply an alert, not the cause of the problem, and is usually due to the current open file in the block, disk space used up


Log in using the sappers and find that a test cloud host cannot log in, use the administrator rights to enter the cloud server at the accessed end to see if it is caused by problems in the configuration of TCP_wrapper, open the file and find a write error in swap file, and the rules in the configuration file are correct. Next, I look at the disk space and see that the disk space is full and there is no public key account pushed by JumpServer under home.
Reason: The cloud host disk space is small, the tester did not clean the log in time, resulting in disk full


< 1> View disk
df-th



< 2> Clean disk space



< 3> Jumpserver re-pushes the account and public key for this asset



It’s too watery… But there’s really nothing to say.