Backport of driver/docker: Don't pull InfraImage if it exists into release/1.3.x #13636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #13265 to be assessed for backporting due to the inclusion of the label backport/1.3.x.
The below text is copied from the body of the original PR.
This PR tweaks the behavior of Nomad's Docker driver during network setup.
When Nomad sets up a new Docker network, it establishes the network namespace by running a "no-op" container, internally called
InfraImage
. By default the container's image isgcr.io/google_containers/pause-amd64:3.1
(whereamd64
is the GOARCH).Every time a network is set up, that container image is pulled from the Google Container Registry (or alternate image, if configured). In a cluster with a high rate of Nomad job creation, the Docker pull is seen to intermittently fail (about 0.4%), perhaps due to rate limiting or normal transient network problems.
Because this image is versioned (tagged
3.1
, currently), it is not necessary to run a Docker pull on every use. This PR proposes a refinement to the Docker driver'sCreateNetwork
function to first check if the image is present locally before pulling it. The expectation is to improve resiliency of Nomad job launches, and to remove a bit of excess load from GCR (or other configured registry).Fixes #11014
Fixes #11380
Fixes #10318