mirror of
https://github.com/wahyd4/cert-manager.git
synced 2026-08-09 05:06:38 +10:00
Use 'kind load docker-image' command for faster image loads
Signed-off-by: James Munnelly <james@munnelly.eu>
This commit is contained in:
@@ -136,7 +136,7 @@ container_pull(
|
||||
## Install 'kind', for creating kubernetes-in-docker clusters
|
||||
go_repository(
|
||||
name = "io_kubernetes_sigs_kind",
|
||||
commit = "9307ec01e70ffd56d3a5bc16fb977d4f557a615f",
|
||||
commit = "161151a26faf0dbe962ac9f323cc0cdebac79ba8",
|
||||
importpath = "sigs.k8s.io/kind",
|
||||
)
|
||||
|
||||
@@ -191,14 +191,14 @@ container_pull(
|
||||
name = "kind-1.12",
|
||||
registry = "index.docker.io",
|
||||
repository = "kindest/node",
|
||||
tag = "v1.12.3",
|
||||
tag = "v1.12.5",
|
||||
)
|
||||
|
||||
container_pull(
|
||||
name = "kind-1.13",
|
||||
registry = "index.docker.io",
|
||||
repository = "kindest/node",
|
||||
tag = "v1.13.2",
|
||||
tag = "v1.13.4",
|
||||
)
|
||||
|
||||
## Fetch kubectl for use during e2e tests
|
||||
|
||||
+10
-15
@@ -31,13 +31,11 @@ build_images() {
|
||||
DOCKER_REPO="${DOCKER_REPO}" \
|
||||
DOCKER_TAG="${DOCKER_TAG}" \
|
||||
# Build images used during e2e tests
|
||||
bazel run //test/e2e:images
|
||||
bazel run --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //test/e2e:images
|
||||
|
||||
local TMP_DIR=$(mktemp -d)
|
||||
local BUNDLE_FILE="${TMP_DIR}"/cmbundle.tar.gz
|
||||
echo "All images built"
|
||||
|
||||
# Create an archive of docker images
|
||||
docker save \
|
||||
for IMG in \
|
||||
"${DOCKER_REPO}"/cert-manager-controller:"${DOCKER_TAG}" \
|
||||
"${DOCKER_REPO}"/cert-manager-cainjector:"${DOCKER_TAG}" \
|
||||
"${DOCKER_REPO}"/cert-manager-acmesolver:"${DOCKER_TAG}" \
|
||||
@@ -47,16 +45,13 @@ build_images() {
|
||||
"k8s.gcr.io/defaultbackend:bazel" \
|
||||
"vault:bazel" \
|
||||
"gcr.io/kubernetes-helm/tiller:bazel" \
|
||||
-o "${BUNDLE_FILE}"
|
||||
|
||||
# Copy docker archive into the kind container
|
||||
docker cp "${BUNDLE_FILE}" "${KIND_CONTAINER_NAME}":/cmbundle.tar.gz
|
||||
|
||||
# Import file into kind docker daemon
|
||||
docker exec "${KIND_CONTAINER_NAME}" docker load -i /cmbundle.tar.gz
|
||||
|
||||
# Cleanup
|
||||
rm -Rf "${TMP_DIR}"
|
||||
; do
|
||||
echo "Loading image ${IMG} into kind container"
|
||||
"${KIND}" load docker-image --name "${KIND_CLUSTER_NAME}" "${IMG}" &
|
||||
done
|
||||
echo "Waiting for all images to be loaded..."
|
||||
wait
|
||||
echo "All images loaded!"
|
||||
}
|
||||
|
||||
build_images
|
||||
|
||||
+2
@@ -12,5 +12,7 @@ nodes:
|
||||
# config generated by kind
|
||||
apiVersion: kubeadm.k8s.io/v1alpha3
|
||||
kind: ClusterConfiguration
|
||||
metadata:
|
||||
name: config
|
||||
networking:
|
||||
serviceSubnet: 10.0.0.0/16
|
||||
|
||||
+2
@@ -12,5 +12,7 @@ nodes:
|
||||
# config generated by kind
|
||||
apiVersion: kubeadm.k8s.io/v1beta1
|
||||
kind: ClusterConfiguration
|
||||
metadata:
|
||||
name: config
|
||||
networking:
|
||||
serviceSubnet: 10.0.0.0/16
|
||||
|
||||
Reference in New Issue
Block a user