sync

command module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

hagrid-sync

This repo is ripped from skopeo with the following key differences:

  • CLI re-written using Cobra/Viper
  • Completely unique config file: config.yaml
  • Many legacy features removed
  • Many features removed

With the intent of scoping the functionality to only the following:

  • Syncing images defined in Kubernetes manifests to Docker registries
  • Statically compiling (no external clibs)

Given the scope of hagrid-sync, it's primary use case is transporting images across an air gap, where the images may come from existing registries, or defined through Kubernetes manifests.

Syncing

hagrid-sync scopes the syncing capability around the concept of declaritively defined images. Images to sync can be defined via:

  • explicitly defined images in config.yaml under source.images[]
  • images parsed from kubernetes manifests defined in config.yaml under source.manifests[]

The intent of scoping syncing to only the above use cases is to scope hagrid-sync to packaging images obtained from kubernetes manifests for transport.

hagrid-sync provides 2 methods of syncing:

Pull

Pulling is intended to be the "packaging" step of hagrid-sync. It is used to sync images defined through the hagrid-sync config file (explicit images and kubernetes manifests) to a local transient registry. The local transient registry can then be zipped up and transferred over an air gap to later be synchronized using the hagrid-sync push command.

Push

Pushing is intended to be the "unpackaging" step of hagrid-sync. It is used to sync images packaged in a transient registry (from the hagrid-sync pull step) to a generic registry.

Examples

The below walks through several example use cases, and assumes docker as a container runtime.

NOTE: Requires that hagrid-sync is built, you can build hagrid-sync for the current OS you're on with make build in the root directory of this project.

# Start local registry
docker run -p 5000:5000 -v `pwd`/registry:/var/lib/registry registry:latest

# Sync images defined in kubernetes manifests to a local transient registry
bin/hagrid-sync pull

# Sync images defined in kubernetes manifests located in transient registry to remote registry
docker run -p 5001:5000 registry:latest
bin/hagrid-sync push

Documentation

Overview

Copyright © 2020 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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