image-cache-daemon

command module
v0.0.0-...-2a3794e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 3 Imported by: 0

README

image-cache-daemon

CI

Image Cache Daemon is a service to pre-pull / cache images on Kubernetes before they're needed

Synopsis

When it's desirable to run a container as fast as possible (such as when using Argo Workflows), image pull time can be a significant contributor to slow pod start times. The image cache daemon is a service that's intended to help mitigate that by discovering images to pull from a variety of sources, then pulling those images on each node before they're actually needed.

Installation

kubectl apply -f https://raw.githubusercontent.com/dcherman/image-cache-daemon/master/manifests/install.yaml -n image-cache-daemon
image-cache-daemon [flags]

Options

      --configmap-selector string               The selector to use when monitoring for ConfigMap sources (default "app.kubernetes.io/part-of=image-cache-daemon")
  -h, --help                                    help for image-cache-daemon
      --image stringArray                       Images that should be pre-fetched
      --node-name string                        The node name to pull to
      --pod-name string                         The pod name
      --pod-namespace string                    The namespace this pod is running in
      --pod-uid string                          The owning pod UID
      --resync-period duration                  How often the daemon should re-pull images from all of the sources.  Set to 0 to disable. (default 15m0s)
      --warden-image string                     The image that copies a binary to pulled containers to replace the entrypoint (default "exiges/image-cache-warden:latest")
      --watch-argo-cluster-workflow-templates   Whether or not to watch cluster workflow templates (default true)
      --watch-argo-cron-workflows               Whether or not to watch cron workflows (default true)
      --watch-argo-workflow-templates           Whether or not to watch workflow templates (default true)
      --watch-configmaps                        Whether or not to watch ConfigMaps for images to pull.  Must match the --config-map-selector (default true)

Sources

Static

If you have a known set of images that you want to pull, you can do so via providing the --image argument to the cache daemon. This argument may be provided multiple times.

./image-cache-daemon --image=alpine --image=debian

Argo Workflow Templates

Watch the cluster for Argo Workflow templates and cache images found in any of those templates. Enabled by default, can be controlled by passing --watch-argo-workflow-templates

Argo Workflow Cluster Workflow Templates

Watch the cluster for Argo Workflow cluster workflow templates and cache images found in any of those templates. Enabled by default, can be controlled by passing --watch-argo-cluster-workflow-templates

Argo Workflow CronJob Templates

Watch the cluster for Argo Workflow cron templates and cache images found in any of those templates. Enabled by default, can be controlled by passing --watch-argo-cron-workflows

ConfigMap

The ConfigMap source is useful when you want to separate the list of images that you're pulling from the installation of the cache daemon. It's also useful if you have a dynamic list of images to pull that aren't part of one of the other sources.

By default, all ConfigMaps that match the label selector "app.kubernetes.io/part-of=image-cache-daemon" will be considered as a source for the cache daemon in any namespace that it has privileges to read. If you would like to restrict the set of ConfigMaps that it reads, you can so do by changing the selector (--configmap-selector), or restricting the namespaces that the cache daemon can read via RBAC. Enabled by default, can be controlled by --watch-configmaps

Example Usage:

apiVersion: v1
kind: ConfigMap
metadata:
  name: my-image-configmap
  labels:
    app.kubernetes.io/part-of: image-cache-daemon
data:
  images: |
    ["alpine", "debian"]

Documentation

Overview

Copyright © 2021 Daniel Herman <daniel.c.herman@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL