Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

imagePullPolicy to pull latest image OR use existing image if repository unavailable #111822

Copy link
Copy link
Open
@Alibirb

Description

@Alibirb
Issue body actions

What would you like to be added?

Add another option for a container's imagePullPolicy, which attempts to pull the image, and falls back to using a local cached copy if the image could not be pulled.

Why is this needed?

In development, images are frequently updated, so it's essential to grab the latest version of the image to test against.

In production, single points of failure should be minimized, so if the image is available through the repository OR cached locally, then the container should be able to start up (i.e. neither the repo nor the local cache is a single point of failure).

Currently, imagePullPolicy only offers three options:

  • Always: Only tries to pull the image; ignores cache and fails if repository is unavailable
  • IfNotPresent: First tries to use a cached image; falls back to pulling the image
  • Never: Only tries to use cached image; ignores repository

From these options, Always is the only one that grabs the latest changes, so it's the only suitable option for development, but it turns the repository into a single point of failure, so it's not suitable for production unless you're okay with everything breaking if the repository goes offline.

In addition, using the latest tag (or any other tag that changes, like a v1 tag that gives the latest 1.x.y version) only works if the imagePullPolicy is Always, or the image cache on each node is cleared whenever the tag is updated, so if those tags are used in production, and you don't want the repository to be a single point of failure, then there is NO suitable option for production at all.

A fourth option, which first tries to pull the image, and falls back to using a cached copy (the inverse of IfNotPresent), would be well-suited to both development and production, and would fit in very nicely in between Always and IfNotPresent.

Honestly, I think this would be the only imagePullPolicy I would ever use for ANYTHING I do (work and personal projects) if it were available, and I don't understand why it's missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.sig/nodeCategorizes an issue or PR as relevant to SIG Node.Categorizes an issue or PR as relevant to SIG Node.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.