fluentd daemon set container for papertrail failing to start in kubernetes cluster

12/29/2019

Am trying to setup fluentd in kubernetes cluster to aggregate logs in papertrail, as per the documentation provided here.
The configuration file is fluentd-daemonset-papertrail.yaml
It basically creates a daemon set for fluentd container and a config map for fluentd configuration.

When I apply the configuration, the pod is assigned to a node and the container is created. However, its either not completing the initialization or the pod gets killed immediately after it is started.

As the pods are getting killed, am loosing the logs too. Couldn't investigate the cause of the issue.

Looking through the events for kube-system namespace has below errors,

Error: failed to start container "fluentd": Error response from daemon: OCI runtime create failed: container_linux.go:338: creating new parent process caused "container_linux.go:1897: running lstat on namespace path \"/proc/75026/ns/ipc\" caused \"lstat /proc/75026/ns/ipc: no such file or directory\"": unknown

Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "9559643bf77e29d270c23bddbb17a9480ff126b0b6be10ba480b558a0733161c" network for pod "fluentd-papertrail-b9t5b": NetworkPlugin kubenet failed to set up pod "fluentd-papertrail-b9t5b_kube-system" network: Error adding container to network: failed to open netns "/proc/111610/ns/net": failed to Statfs "/proc/111610/ns/net": no such file or directory

Am not sure whats causing these errors. Appreciate any help to understand and troubleshoot these errors.

Also, is it possible to look at logs/events that could tell us why a pod is given a terminate signal?

-- Naresh Babu
fluentd
kubernetes
kubernetes-pod
papertrail-app

2 Answers

12/31/2019

Please ensure that /etc/cni/net.d and its /opt/cni/bin friend both exist and are correctly populated with the CNI configuration files and binaries on all Nodes.

Take a look: sandbox.

-- MaggieO
Source: StackOverflow

1/5/2020

With help from papertrail support team, I was able to resolve the issue by removing below entry from manifest file.

kubernetes.io/cluster-service: "true"

Above annotation seems to have been deprecated.
Relevant github issues:

https://github.com/fluent/fluentd-kubernetes-daemonset/issues/296
https://github.com/kubernetes/kubernetes/issues/72757

-- Naresh Babu
Source: StackOverflow