keel-pkg

module
v0.0.0-...-b04963e Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT

README

keel-pkg

keel tools for syncing images from k8s.gcr.io and packing kubernetes.tar.gz.

Actions sync workflow Actions pack workflow

Usage

$ ./packer -h
Pack kubernetes.tar.gz

Usage:
  packer [options]

Flags:
  -u, --username string            The username of the registry to be pushed
  -p, --password string            The password of the registry to be pushed
      --command-timeout duration   Set timeout for the command execution
      --version-config string      The location of versions config file (default "versions.json")
  -o, --image-output string        The location of images output (default "/var/run/keel/pack/images")
  -h, --help                       help for packer
  -v, --version                    version for packer



$ ./synctl sync -h
Sync images

Usage:
  synctl sync [options]

Flags:
  -u, --username string            The username of the registry to be pushed
  -p, --password string            The password of the registry to be pushed
      --push-to string             The registry to be pushed (default "registry.cn-hangzhou.aliyuncs.com")
      --push-ns string             The namespace of the registry to be pushed (default "keel")
      --db string                  The location of boltdb file (default "sync.bolt.db")
      --query-limit int            Set http query limit (default 10)
      --limit int                  Set sync limit (default 5)
      --command-timeout duration   Set timeout for the command execution
      --push-timeout duration      Set timeout for pushing a image (default 15m0s)
      --retry int                  Retry count. (default 5)
      --retry-interval duration    Retry interval (default 5s)
      --addition-ns strings        Additional namespaces to sync
      --image-set string           The location of image-set file (default "image_set.json")
  -h, --help                       help for sync

Example

sync images:

$ ./synctl sync \
--db ${HOME}/sync.bolt.db \
-u ${ REGISTRY_USER } \
-p ${ REGISTRY_PASS } \
--push-ns=${ REGISTRY_NAMESPACE }  \
--command-timeout ${TIMEOUT:=2h}  \
--limit ${LIMIT:=8}

How to build

make              - help
make build        - build synctl and packer
     version        the version of commands, default is 'v1.0.0'. e.g. 'make build version=v1.1.2'
make build-sync   - build synctl
     version        the version of synctl command, default is 'v1.0.0'. e.g. 'make build-sync version=v1.1.2'
make build-pack   - build packer
     version        the version of packer command, default is 'v1.0.0'. e.g. 'make build-pack version=v1.1.2'
make clean        - remove binary file and prune image

versions.json version of components for packing:

{
  "arch": "amd64",
  "images": [
    {"name":  "etcd", "tag": "3.4.7"},
    {"name":  "flannel", "tag": "0.5.5"},
    {"name":  "kube-proxy", "tag": "v1.22.2"},
    {"name":  "kube-apiserver", "tag": "v1.22.2"},
    {"name":  "kube-controller-manager", "tag": "v1.22.2"},
    {"name":  "kube-scheduler", "tag": "v1.22.2"},
    {"name":  "coredns", "tag": "1.7.0"},
    {"name":  "metrics-server", "tag": "v0.3.6"}
  ],
  "components": [
    {"name":  "containerd", "tag": "1.5.7"},
    {"name":  "runc", "tag": "1.0.2"},
    {"name":  "crictl", "tag": "1.22.0"},
    {"name":  "kubectl", "tag": "1.22.2"},
    {"name":  "kubelet", "tag": "1.22.2"}
  ]
}

image_set.json image list for syncing:

{
  "names": [
    "etcd",
    "etcd-amd64",
    "etcd-arm",
    "etcd-arm64",
    "etcd-ppc64le",
    "etcd-s390x",
    "coredns",
    "nginx"
  ],
  "prefixes": [
    "kube",
    "k8s",
    "flannel",
    "fluentd",
    "fluent-bit",
    "hyperkube",
    "metrics-server",
    "pause",
    "alpine-iptables",
    "debian-iptables",
    "federation",
    "nginx-ingress"
  ],
  "exclude": [
    "-beta",
    "-alpha"
  ],
  "extras": [
    "quay.io/coreos/flannel",
    "registry-1.docker.io/coredns/coredns",
    "registry-1.docker.io/library/registry"
  ]
}
  • names contains a list of images that need to be synchronized (For k8s.gcr.io).
  • prefixes contains a list of name prefixes of images that need to be synchronized (For k8s.gcr.io).
  • exclude if the image name or tag contains these strings then it will not be synchronized (For k8s.gcr.io).
  • extras extra image list that need to be synchronized.

Priority: names > extras > exclude > prefixes.

pack workflow

pack workflow

  • set beat version, will add a beta suffix to the package name. e.g. kube-1.22.2-amd64-beta.tar.gz.
  • set arch, will set the arch of the package name.
  • set kube version, set kubernetes version of the package name.
  • set bucket, set the storage bucket of qiniu cloud.
  • set repo, if the value is not "dockerhub", will push the package to the qiniu cloud.

Registry

Reference

Jump to

Keyboard shortcuts

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