Score:0

Setting up logging of control-plane pods to a specific files

jp flag

Log files for the control-plane pods don't exist in the /var/log directory. I tried to enable kube-apiserver logging to a specific file in Kubernetes (v1.20.2). I added the following keys to the kube-apiserver manifest:

spec:
  containers:
  - command:
    - kube-apiserver
...
    - --log-dir=/var/log
    - --log-file=/var/log/kube-apiserver.log
    - --logtostderr=false

But it didn't work, I still can't see the /var/log/kube-apiserver.log file. Also I tried to add these same keys for kube-scheduler and kube-apiserver manifests but this doesn't work. Can I enable write logs to special files in the /var/log or any other directory?

in flag
Hi mapushkin welcome to S.F. You elided the rest of your PodSpec, that would have specified the `volumes:` and `volumeMounts:` that could enable someone to help you work through your problem. Please [edit your question](https://serverfault.com/posts/1079458/edit) and include the whole `spec:` at least. Good luck!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.