Skip to content

Commit

Permalink
Merge pull request #270 from FabianKramm/dev
Browse files Browse the repository at this point in the history
connect flags & docs update
  • Loading branch information
FabianKramm authored Jan 5, 2022
2 parents 5f97aef + 8b4cdf3 commit 3bfeb5e
Show file tree
Hide file tree
Showing 31 changed files with 940 additions and 486 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Learn more in the [documentation](https://vcluster.com/docs/what-are-virtual-clu
### Features

- **Certified Kubernetes Distribution** - vcluster itself is a [certified Kubernetes distribution](https://www.cncf.io/certification/software-conformance/) and is 100% Kubernetes API conform. Everything that works in a regular Kubernetes cluster works in vcluster
- **Lightweight & Low-Overhead** - Based on k3s, bundled in a single pod and with super-low resource consumption
- **Lightweight & Low-Overhead** - Based on k3s, bundled in a single pod and with super-low resource consumption. Other distributions such as k0s or vanilla k8s are also supported
- **No Performance Degradation** - Pods are scheduled in the underlying host cluster, so they get no performance hit at all while running
- **Reduced Overhead On Host Cluster** - Split up large multi-tenant clusters into smaller vcluster to reduce complexity and increase scalability. Since most vcluster api requests and objects will not reach the host cluster at all, vcluster can greatly decrease pressure on the underlying Kubernetes cluster
- **Easy Provisioning** - Create via vcluster CLI, helm, kubectl, Argo or any of your favorite tools (it is basically just a StatefulSet)
Expand Down
58 changes: 58 additions & 0 deletions assets/download-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
list="vcluster-images.txt"
images="vcluster-images.tar.gz"

usage () {
echo "USAGE: $0 [--image-list vcluster-images.txt] [--images vcluster-images.tar.gz]"
echo " [-l|--image-list path] text file with list of images; one image per line."
echo " [-i|--images path] tar.gz generated by docker save."
echo " [-h|--help] Usage message"
}

POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-i|--images)
images="$2"
shift # past argument
shift # past value
;;
-l|--image-list)
list="$2"
shift # past argument
shift # past value
;;
-h|--help)
help="true"
shift
;;
*)
usage
exit 1
;;
esac
done

if [[ $help ]]; then
usage
exit 0
fi

pulled=""
while IFS= read -r i; do
[ -z "${i}" ] && continue
if docker pull "${i}" > /dev/null 2>&1; then
echo "Image pull success: ${i}"
pulled="${pulled} ${i}"
else
if docker inspect "${i}" > /dev/null 2>&1; then
pulled="${pulled} ${i}"
else
echo "Image pull failed: ${i}"
fi
fi
done < "${list}"

echo "Creating ${images} with $(echo ${pulled} | wc -w | tr -d '[:space:]') images"
docker save $(echo ${pulled}) | gzip --stdout > ${images}
84 changes: 84 additions & 0 deletions assets/push-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash
images="vcluster-images.tar.gz"
list="vcluster-images.txt"
usage () {
echo "USAGE: $0 [--images vcluster-images.tar.gz] --registry my.registry.com:5000"
echo " [-l|--image-list path] text file with list of images; one image per line."
echo " [-i|--images path] tar.gz generated by docker save."
echo " [-r|--registry registry:port] target private registry:port."
echo " [-h|--help] Usage message"
}

push_manifest () {
export DOCKER_CLI_EXPERIMENTAL=enabled
manifest_list=()
for i in "${arch_list[@]}"
do
manifest_list+=("$1-${i}")
done

echo "Preparing manifest $1, list[${arch_list[@]}]"
docker manifest create "$1" "${manifest_list[@]}" --amend
docker manifest push "$1" --purge
}

while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-r|--registry)
reg="$2"
shift # past argument
shift # past value
;;
-l|--image-list)
list="$2"
shift # past argument
shift # past value
;;
-i|--images)
images="$2"
shift # past argument
shift # past value
;;
-h|--help)
help="true"
shift
;;
*)
usage
exit 1
;;
esac
done
if [[ -z $reg ]]; then
usage
exit 1
fi
if [[ $help ]]; then
usage
exit 0
fi

docker load --input ${images}

linux_images=()
while IFS= read -r i; do
[ -z "${i}" ] && continue
linux_images+=("${i}");
done < "${list}"

arch_list+=("linux-amd64")
for i in "${linux_images[@]}"; do
[ -z "${i}" ] && continue
case $i in
*/*)
image_name="${reg}/${i}"
;;
*)
image_name="${reg}/loftsh/${i}"
;;
esac

docker tag "${i}" "${image_name}"
docker push "${image_name}"
done
Loading

0 comments on commit 3bfeb5e

Please sign in to comment.