Image warm for Kubernetes
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
Vladimir Smagin 1cbba7c9f3 no, fuck it 1 день назад
build import 1 неделю назад
cmd/manager import 1 неделю назад
deploy add to dockerhub registry 1 неделю назад
pkg import 1 неделю назад
vendor import 1 неделю назад
version import 1 неделю назад
.gitignore import 1 неделю назад
Dockerfile import 1 неделю назад
Jenkinsfile no, fuck it 1 день назад
README.md add to dockerhub registry 1 неделю назад
VERSION add version 1 неделю назад
go.mod import 1 неделю назад
go.sum import 1 неделю назад
tools.go import 1 неделю назад

README.md

Warm Image operator for Kubernetes

For example, you have huge image with your software and running POD on node. When POD moving to another node your image downloads to new node minute or two. This operator forces nodes to download image before rescheduling, so POD starts faster.

How it works

It runs /bin/sh with infinite loop on specified image as DaemonSet with additional options like NodeSelector, Affinity or resource limits. You can specify custom command if your image not contains /bin/sh interpreter or you want to run own script.

Deploy operator

Cluster scoped installation:

kubectl create ns warmimage
kubectl -f deploy/crds/blindage.org_warmimages_crd.yaml
kubectl -n warmimage -f deploy/role.yaml
kubectl -n warmimage -f deploy/role_binding.yaml
kubectl -n warmimage -f deploy/service_account.yaml
kubectl -n warmimage -f deploy/operator.yaml

Now create your first warmer

kubectl -n warmimage -f deploy/example/mongo4.yaml

Settings

Required:

  • Set image URL
    image: string

  • Set image tag
    version: string

Additional options:

  • Set custom command
    customCommand: strings list
    Default:
    - “/bin/sh”
    - “-c”
    - “while true; do sleep 86400; done”

  • Add custom labels
    labels: map

  • Affinity, node selection and tolerations
    nodeSelector: default empty
    affinity: default empty
    tolerations: default empty

  • Resource limiting
    podRequests: default empty
    podLimits: default empty

Your first warmer

Create yaml file and place it:

apiVersion: blindage.org/v1alpha1
kind: WarmImage
metadata:
  name: mongo4
spec:
  image: mongo
  version: "4"
  nodeSelector:
    node-role.kubernetes.io/master: ""

Now you warmed mongo:4 on all master nodes.


Copyright by Vladimir Smagin (21h) 2020
http://blindage.org email: 21h@blindage.org
Project page: https://git.blindage.org/21h/warm-image-operator