Skip to content

glog hates reliability, tries to write to read-only rootfs #427

Closed

Description

@leo-baltus

I have noticed that the controller and the speaker seem to exit after some time, mostly after 8min intervals. kubectl logs does not give any clues. With strace however:

11467 write(5, "log: exiting because of error: log: cannot create log: open /tmp/controller.controller-7f47947cf9-qpmqm.unknownuser.log.WARNING.20190422-084350.1: read-only file system\n", 169 <unfinished ...>

Changing deploy to readOnlyRootFilesystem: false the exiting has stopped and I am now able to entering the container to view the logs:

cat controller.controller-5d56fc6ddd-ld7tz.unknownuser.log.WARNING.201904
Log file created at: 2019/04/22 10:46:58
Running on machine: controller-5d56fc6ddd-ld7tz
Binary: Built with gc go1.11.5 for linux/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
W0422 10:46:58.861347       1 reflector.go:270] pkg/mod/k8s.io/client-go@v10.0.0+incompatible/tools/cache/reflector.go:95: watch of *v1.ConfigMap ended with: too old resource version: 21070598 (21071202)

Wich seems very similar to e.g. traefik/traefik#1785. In short glog (part op client-go) seems to prefer to log to files rather than stderr.

I am unning image: metallb/controller:master on a kubernetes-v1.12.3 single-host cluster on-prem using flannel. No ipvs/iptables/kube-proxy tweaking going on.

I could create a PR if you like.

Activity

  1. riaan53 commented on Apr 22, 2019

    @riaan53

    Noticed this as well on master, it does not happen on v0.7.3.

  2. leo-baltus commented on Apr 23, 2019

    @leo-baltus
    Author
  3. danderson commented on Apr 23, 2019

    @danderson
    Contributor

    Bleh, glog kicks me in the shins again.

    Yes, we should move off it. If k8s itself has stopped using it, that's the main blocker for that removed I'll have to see if klog can be interfaced with to pull data out of it and into MetalLB's own logs.

    Thanks for the report!

  4. voron commented on Apr 24, 2019

    @voron
    Contributor

    I hit the same problem w/ master builds, both controller and speaker

  5. dano0b commented on Jun 3, 2019

    @dano0b

    Would be awesome is that could be addressed. After 1-2 weeks the controller/speaker are just not working anymore and services are not accessible anymore. (requires manual deletion of the pods)

  6. Elegant996 commented on Jun 3, 2019

    @Elegant996

    @dano0b Switch the tag you're using from master to update-versions. It is best to avoid the latest tags such as master when pulling images for critical services.

  7. dano0b commented on Jun 4, 2019

    @dano0b

    I'm using kubernetes 1.14 and need the latest version because of it. At the moment my k8s cluster provisioning uses https://github.com/danderson/metallb/blob/master/manifests/metallb.yaml (with some customization) to deploy metallb. For me it is waiting for 0.7.4 with hopefully a fix for this issue.

  8. Elegant996 commented on Jun 4, 2019

    @Elegant996

    @dano0b I'm also running Kubernetes 1.14 and am having no issues with the solution I listed. Did you try using the above suggestion? What errors were you presented with?

    Just because there's a commit that mentions Kubernetes 1.14 does not make it mandatory.

  9. dano0b commented on Jun 4, 2019

    @dano0b

    Thanks for your suggestion but I don't want to customize the manifest more to support custom docker image tags. I think it would be just awesome to have a non-crashing version including the latest changes.
    (can't remember what didn't work for me but I had issues using 0.7.3)

  10. aleks-mariusz commented on Jul 8, 2019

    @aleks-mariusz

    my metallb components have stayed up more than ten minutes now with the master branch (using this until there's an official update).. it seems i was indeed hit by this issue (thanks @trevex ), so i added the following to my helm-based deployment script to make the patches automatically:

    kubectl -n $NAMESPACE patch deployment $(kubectl -n $NAMESPACE get deployment -l app=metallb,component=controller -o jsonpath='{.items[0].metadata.name}') -p '{"spec": {"template": {"spec": {"containers": [{"name": "controller", "securityContext": {"readOnlyRootFilesystem": false}}]}}}}'
    kubectl -n $NAMESPACE patch daemonset $(kubectl -n $NAMESPACE get daemonset -l app=metallb,component=speaker -o jsonpath='{.items[0].metadata.name}') -p '{"spec": {"template": {"spec": {"containers": [{"name": "speaker", "securityContext": {"readOnlyRootFilesystem": false}}]}}}}'
    

    This will patch both the deployment and the daemonsets for metallb to set the readOnlyRootFilesystem securityContext value to false

  11. changed the title [-]spurious restart[/-] [+]glog hates reliability, tries to write to read-only rootfs[/+] on Jul 8, 2019
  12. danderson commented on Jul 9, 2019

    @danderson
    Contributor

    Removed glog entirely in d42e599, replaced with klog which supports non-hacky log redirection, so this should no longer be a problem as of the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions