Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readiness probe: do not log tail errors #2366

Merged
merged 1 commit into from
Jan 8, 2020

Conversation

barkbay
Copy link
Contributor

@barkbay barkbay commented Jan 8, 2020

In some cases it is not possible for the readiness script to log into stderr of PID 1.
It is the case for example if the container is started with the root user: uid of pid 1 is changed to 1000 by the startup script, hence the readiness script, which is running with the UID 0, is not able to write into /proc/1/fd/2

This is harmless but it generates the following message in the events:

  Warning  Unhealthy               36s                    kubelet, aks-nodepool1-41410888-1  Readiness probe failed: {"timestamp": "2020-01-07T14:55:14+0000", "message": "readiness probe failed", "curl_rc": "7"}
tee: /proc/1/fd/2: Permission denied

Since the log redirection is done as a best effort this PR skips any error message from tail, this prevents the error to appear in the events of the Pod.

Note that if the security context is correctly set (i.e. container is not running as root) this issue does not happen.

credits goes to @david-kow

@barkbay barkbay merged commit 8caca1c into elastic:master Jan 8, 2020
barkbay added a commit to barkbay/cloud-on-k8s that referenced this pull request Jan 8, 2020
@barkbay barkbay added the >enhancement Enhancement of existing functionality label Jan 8, 2020
@anyasabo anyasabo added the v1.0.0 label Jan 8, 2020
mjmbischoff pushed a commit to mjmbischoff/cloud-on-k8s that referenced this pull request Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality v1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants