Page MenuHomePhabricator

Envoy running in gVisor does not detect certificate changes
Open, MediumPublic

Description

The shellbox-timeline certificate has been refreshed by cert-manager but envoy does not pick it up and serves the old cert, expiring in 5 days. A newly stated pod loads the refreshed cert correctly.

We might need to set dev.gvisor.spec.mount.tls-certs-volume.share: "container" for all pods running under gVisor.

Event Timeline

JMeybohm triaged this task as Medium priority.

Change #1345535 had a related patch set uploaded (by Giuseppe Lavagetto; author: Giuseppe Lavagetto):

[operations/deployment-charts@master] shellbox: allow inotify probes to be set for tls certs

https://gerrit.wikimedia.org/r/1345535

Tried the mount options in staging with no luck unfortunately. Might be related/similar to https://github.com/google/gvisor/issues/8089

Change #1345556 had a related patch set uploaded (by Giuseppe Lavagetto; author: Giuseppe Lavagetto):

[operations/deployment-charts@master] shellbox: enable polling under gVisor for TLS certificate changes

https://gerrit.wikimedia.org/r/1345556

Dev envoy has a poll_interval option for sds_config which sounds like it might do the right thing (or it just reloads the sds config itself): https://www.envoyproxy.io/docs/envoy/latest/configuration/security/secret#example-three-certificate-rotation-for-xds-grpc-connection

I did roll-restart shellbox-timeline in codfw and eqiad for it to pick up the new certs (valid until 2026-10-22)

Change #1345600 had a related patch set uploaded (by Giuseppe Lavagetto; author: Giuseppe Lavagetto):

[operations/puppet@production] kubernetes::deployment_server: setup daily timer to reload certificates

https://gerrit.wikimedia.org/r/1345600

To provide a bit more of context on the direction we're taking:

  • The problem is that inotify events for configmaps are host inotify events; and the gvisor sandbox never subscribes to them, per this issue, even if the gvisor documentation seems to imply otherwise
  • The correct solution will be using the poll_interval that @JMeybohm mentioned earlier, once it lands in GA envoy
  • In the meantime, we need to restart shellbox when a certificate change happens.

There are cloud-native-kubernetes-approved ways of doing so, like stakater/reloader, but given I am old fashioned and I prefer my temporary, incorrect solutions to look the part, I have prepared a relatively crude bash script (that arguably should've been python) to roll restart deployments when a cert change happens, via a systemd timer.

The solution is both simple enough that failure modes will be obvious, and gross enough we will be compelled to go with the correct one as soon as it shows up.

Change #1345535 abandoned by Giuseppe Lavagetto:

[operations/deployment-charts@master] shellbox: allow inotify probes to be set for tls certs

Reason:

Sadly doesn't work

https://gerrit.wikimedia.org/r/1345535

Change #1345556 abandoned by Giuseppe Lavagetto:

[operations/deployment-charts@master] shellbox: enable polling under gVisor for TLS certificate changes

Reason:

Only available in dev envoy versions.

https://gerrit.wikimedia.org/r/1345556

Change #1345600 merged by Giuseppe Lavagetto:

[operations/puppet@production] kubernetes::deployment_server: setup daily timer to reload certificates

https://gerrit.wikimedia.org/r/1345600

Change #1347668 had a related patch set uploaded (by Giuseppe Lavagetto; author: Giuseppe Lavagetto):

[operations/puppet@production] kubernetes::deployment_server: setup daily timer to reload certificates

https://gerrit.wikimedia.org/r/1347668

Change #1347668 merged by Giuseppe Lavagetto:

[operations/puppet@production] kubernetes::deployment_server: setup daily timer to reload certificates

https://gerrit.wikimedia.org/r/1347668

Joe removed Joe as the assignee of this task.Oct 2 2026, 7:33 AM

I have deployed my bash spaghetti dish, it does its job as expected AFAICT. I won't close this task as resolved because we want to switch to envoy's poll_interval once that's available.

Change #1351927 had a related patch set uploaded (by Elukey; author: Elukey):

[operations/puppet@production] profile::k8s::deployment_server: fix kube-reload-certs.sh

https://gerrit.wikimedia.org/r/1351927

Change #1351927 merged by Elukey:

[operations/puppet@production] profile::k8s::deployment_server: fix kube-reload-certs.sh

https://gerrit.wikimedia.org/r/1351927

Change #1351965 had a related patch set uploaded (by Elukey; author: Elukey):

[operations/puppet@production] kube-reload-certs: allow different labels then "release"

https://gerrit.wikimedia.org/r/1351965

Change #1351965 merged by Elukey:

[operations/puppet@production] kube-reload-certs: allow different labels then "release"

https://gerrit.wikimedia.org/r/1351965

  • The correct solution will be using the poll_interval that @JMeybohm mentioned earlier, once it lands in GA envoy

This has been released in v1.14.0 now.

  • The correct solution will be using the poll_interval that @JMeybohm mentioned earlier, once it lands in GA envoy

This has been released in v1.14.0 now.

You mean 1.40 :) Yes we should consider upgrading at least the shellbox pods to this version soon-ish.

  • The correct solution will be using the poll_interval that @JMeybohm mentioned earlier, once it lands in GA envoy

This has been released in v1.14.0 now.

You mean 1.40 :) Yes we should consider upgrading at least the shellbox pods to this version soon-ish.

Oopsie :) At least the link was correct.