Create a gist now

Instantly share code, notes, and snippets.

@itaysk /prepull.yaml
Last active May 15, 2018

Embed
What would you like to do?
Kubernetes: Pre-pull images into node
apiVersion: apps/v1beta2
kind: DaemonSet
metadata:
name: prepull
annotations:
source: "https://gist.github.com/itaysk/7bc3e56d69c4d72a549286d98fd557dd"
spec:
selector:
matchLabels:
name: prepull
template:
metadata:
labels:
name: prepull
spec:
initContainers:
- name: prepull
image: docker
command: ["docker", "pull", "hello-world"]
volumeMounts:
- name: docker
mountPath: /var/run
volumes:
- name: docker
hostPath:
path: /var/run
containers:
- name: pause
image: gcr.io/google_containers/pause
@itaysk

This comment has been minimized.

Show comment
Hide comment
@itaysk

itaysk Nov 21, 2017

For Kubernetes versions < 1.8, edit L1 to apiVersion: extensions/v1beta1.
Don't forget to update the image to pull (L19 - "hello-world").

Owner

itaysk commented Nov 21, 2017

For Kubernetes versions < 1.8, edit L1 to apiVersion: extensions/v1beta1.
Don't forget to update the image to pull (L19 - "hello-world").

@quasiben

This comment has been minimized.

Show comment
Hide comment
@quasiben

quasiben Nov 27, 2017

I would also recommend adding:

  updateStrategy:
    type: RollingUpdate

I would also recommend adding:

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