Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to VMware Harbor registry for Antrea Docker images #1617

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ jobs:
- uses: actions/checkout@v2
- run: make
- name: Save Antrea image to tarball
run: docker save -o antrea-ubuntu.tar antrea/antrea-ubuntu:latest
run: docker save -o antrea-ubuntu.tar projects.registry.vmware.com/antrea/antrea-ubuntu:latest
- name: Upload Antrea image for subsequent jobs
uses: actions/upload-artifact@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kind_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v2
- run: make
- name: Save Antrea image to tarball
run: docker save -o antrea-ubuntu.tar antrea/antrea-ubuntu:latest
run: docker save -o antrea-ubuntu.tar projects.registry.vmware.com/antrea/antrea-ubuntu:latest
- name: Upload Antrea image for subsequent jobs
uses: actions/upload-artifact@v2
with:
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ ubuntu:
@echo "===> Building antrea/antrea-ubuntu Docker image <==="
docker build --pull -t antrea/antrea-ubuntu:$(DOCKER_IMG_VERSION) -f build/images/Dockerfile.ubuntu .
docker tag antrea/antrea-ubuntu:$(DOCKER_IMG_VERSION) antrea/antrea-ubuntu
docker tag antrea/antrea-ubuntu:$(DOCKER_IMG_VERSION) projects.registry.vmware.com/antrea/antrea-ubuntu

# Build bins in a golang container, and build the antrea-ubuntu Docker image.
.PHONY: build-ubuntu
Expand All @@ -263,6 +264,7 @@ else
docker build --pull -t antrea/antrea-ubuntu:$(DOCKER_IMG_VERSION) -f build/images/Dockerfile.build.ubuntu .
endif
docker tag antrea/antrea-ubuntu:$(DOCKER_IMG_VERSION) antrea/antrea-ubuntu
docker tag antrea/antrea-ubuntu:$(DOCKER_IMG_VERSION) projects.registry.vmware.com/antrea/antrea-ubuntu

.PHONY: build-windows
build-windows:
Expand All @@ -273,6 +275,7 @@ else
docker build --pull -t antrea/antrea-windows:$(DOCKER_IMG_VERSION) -f build/images/Dockerfile.build.windows .
endif
docker tag antrea/antrea-windows:$(DOCKER_IMG_VERSION) antrea/antrea-windows
docker tag antrea/antrea-windows:$(DOCKER_IMG_VERSION) projects.registry.vmware.com/antrea/antrea-windows

.PHONY: build-ubuntu-coverage
build-ubuntu-coverage:
Expand All @@ -283,6 +286,7 @@ else
docker build --pull -t antrea/antrea-ubuntu-coverage:$(DOCKER_IMG_VERSION) -f build/images/Dockerfile.build.coverage .
endif
docker tag antrea/antrea-ubuntu-coverage:$(DOCKER_IMG_VERSION) antrea/antrea-ubuntu-coverage
docker tag antrea/antrea-ubuntu-coverage:$(DOCKER_IMG_VERSION) projects.registry.vmware.com/antrea/antrea-ubuntu-coverage

.PHONY: manifest
manifest:
Expand All @@ -305,6 +309,7 @@ octant-antrea-ubuntu:
@echo "===> Building antrea/octant-antrea-ubuntu Docker image <==="
docker build --pull -t antrea/octant-antrea-ubuntu:$(DOCKER_IMG_VERSION) -f build/images/Dockerfile.octant.ubuntu .
docker tag antrea/octant-antrea-ubuntu:$(DOCKER_IMG_VERSION) antrea/octant-antrea-ubuntu
docker tag antrea/octant-antrea-ubuntu:$(DOCKER_IMG_VERSION) projects.registry.vmware.com/antrea/octant-antrea-ubuntu

.PHONY: verify
verify:
Expand Down
8 changes: 4 additions & 4 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: antrea-controller
ports:
Expand Down Expand Up @@ -1509,7 +1509,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1570,7 +1570,7 @@ spec:
- --log_file_max_num=4
command:
- start_ovs
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1604,7 +1604,7 @@ spec:
initContainers:
- command:
- install_cni_chaining
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: install-cni
resources:
Expand Down
8 changes: 4 additions & 4 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: antrea-controller
ports:
Expand Down Expand Up @@ -1511,7 +1511,7 @@ spec:
fieldPath: spec.nodeName
- name: ANTREA_CLOUD_EKS
value: "true"
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1572,7 +1572,7 @@ spec:
- --log_file_max_num=4
command:
- start_ovs
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1606,7 +1606,7 @@ spec:
initContainers:
- command:
- install_cni_chaining
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: install-cni
resources:
Expand Down
8 changes: 4 additions & 4 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: antrea-controller
ports:
Expand Down Expand Up @@ -1509,7 +1509,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1570,7 +1570,7 @@ spec:
- --log_file_max_num=4
command:
- start_ovs
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1604,7 +1604,7 @@ spec:
initContainers:
- command:
- install_cni
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: install-cni
resources:
Expand Down
10 changes: 5 additions & 5 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: antrea-controller
ports:
Expand Down Expand Up @@ -1528,7 +1528,7 @@ spec:
secretKeyRef:
key: psk
name: antrea-ipsec
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1589,7 +1589,7 @@ spec:
- --log_file_max_num=4
command:
- start_ovs
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1621,7 +1621,7 @@ spec:
subPath: openvswitch
- command:
- start_ovs_ipsec
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1653,7 +1653,7 @@ spec:
initContainers:
- command:
- install_cni
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: install-cni
resources:
Expand Down
2 changes: 1 addition & 1 deletion build/yamls/antrea-octant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
value: "true"
- name: KUBECONFIG
value: /kube/admin.conf
image: antrea/octant-antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/octant-antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: antrea-octant
ports:
Expand Down
4 changes: 2 additions & 2 deletions build/yamls/antrea-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea/antrea-windows:latest
image: projects.registry.vmware.com/antrea/antrea-windows:latest
imagePullPolicy: IfNotPresent
name: antrea-agent
volumeMounts:
Expand All @@ -151,7 +151,7 @@ spec:
- /k/antrea/Install-WindowsCNI.ps1
command:
- pwsh
image: antrea/antrea-windows:latest
image: projects.registry.vmware.com/antrea/antrea-windows:latest
imagePullPolicy: IfNotPresent
name: install-cni
volumeMounts:
Expand Down
8 changes: 4 additions & 4 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: antrea-controller
ports:
Expand Down Expand Up @@ -1514,7 +1514,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1575,7 +1575,7 @@ spec:
- --log_file_max_num=4
command:
- start_ovs
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
Expand Down Expand Up @@ -1609,7 +1609,7 @@ spec:
initContainers:
- command:
- install_cni
image: antrea/antrea-ubuntu:latest
image: projects.registry.vmware.com/antrea/antrea-ubuntu:latest
imagePullPolicy: IfNotPresent
name: install-cni
resources:
Expand Down
3 changes: 0 additions & 3 deletions build/yamls/patches/coverage/startAgentCov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ spec:
- name: antrea-agent
command: ["/bin/sh"]
args: ["-c", "sleep 2; antrea-agent-coverage -test.run=TestBincoverRunMain -test.coverprofile=antrea-agent.cov.out -args-file=/agent-arg-file; while true; do sleep 5 & wait $!; done"]
image: antrea/antrea-ubuntu-coverage:latest
- name: antrea-ovs
image: antrea/antrea-ubuntu-coverage:latest
1 change: 0 additions & 1 deletion build/yamls/patches/coverage/startControllerCov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ spec:
- command: ["/bin/sh"]
args: ["-c", "antrea-controller-coverage -test.run=TestBincoverRunMain -test.coverprofile=antrea-controller.cov.out -args-file=/controller-arg-file; while true; do sleep 5 & wait $!; done"]
name: antrea-controller
image: antrea/antrea-ubuntu-coverage:latest
2 changes: 1 addition & 1 deletion ci/jenkins/test-vmc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function deliver_antrea {
if [[ "$COVERAGE" == true ]]; then
docker save -o antrea-ubuntu-coverage.tar antrea/antrea-ubuntu-coverage:${DOCKER_IMG_VERSION}
else
docker save -o antrea-ubuntu.tar antrea/antrea-ubuntu:${DOCKER_IMG_VERSION}
docker save -o antrea-ubuntu.tar projects.registry.vmware.com/antrea/antrea-ubuntu:${DOCKER_IMG_VERSION}
fi

kubectl get nodes -o wide --no-headers=true | awk '$3 == "master" {print $6}' | while read master_ip; do
Expand Down
6 changes: 3 additions & 3 deletions ci/jenkins/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function deliver_antrea_windows {
export_govc_env_var

cp -f build/yamls/*.yml $WORKDIR
docker save -o antrea-ubuntu.tar antrea/antrea-ubuntu:latest
docker save -o antrea-ubuntu.tar projects.registry.vmware.com/antrea/antrea-ubuntu:latest

echo "===== Deliver Antrea to Linux nodes ====="
kubectl get nodes -o wide --no-headers=true | awk '$3 != "master" && $1 !~ /win/ {print $6}' | while read IP; do
Expand Down Expand Up @@ -240,7 +240,7 @@ function deliver_antrea_windows {
elif [ "$TESTCASE" == "windows-conformance" ]; then
if ! (test -f antrea-windows.tar.gz); then
ssh -o StrictHostKeyChecking=no -n Administrator@${IP} "docker pull ${DOCKER_REGISTRY}/antrea/golang:1.15 && docker tag ${DOCKER_REGISTRY}/antrea/golang:1.15 golang:1.15"
ssh -o StrictHostKeyChecking=no -n Administrator@${IP} "rm -rf antrea && git clone ${ghprbAuthorRepoGitUrl} antrea && cd antrea && git checkout $GIT_BRANCH && sed -i \"s|build/images/Dockerfile.build.windows .|build/images/Dockerfile.build.windows . --network host|g\" Makefile && DOCKER_REGISTRY=${DOCKER_REGISTRY} make build-windows && docker save -o antrea-windows.tar antrea/antrea-windows:latest && gzip -f antrea-windows.tar" || true
ssh -o StrictHostKeyChecking=no -n Administrator@${IP} "rm -rf antrea && git clone ${ghprbAuthorRepoGitUrl} antrea && cd antrea && git checkout $GIT_BRANCH && sed -i \"s|build/images/Dockerfile.build.windows .|build/images/Dockerfile.build.windows . --network host|g\" Makefile && DOCKER_REGISTRY=${DOCKER_REGISTRY} make build-windows && docker save -o antrea-windows.tar projects.registry.vmware.com/antrea/antrea-windows:latest && gzip -f antrea-windows.tar" || true
for i in `seq 2`; do
timeout 2m scp -o StrictHostKeyChecking=no -T Administrator@${IP}:antrea/antrea-windows.tar.gz . && break
done
Expand Down Expand Up @@ -297,7 +297,7 @@ function deliver_antrea {
done

cp -f build/yamls/*.yml $WORKDIR
docker save -o antrea-ubuntu.tar antrea/antrea-ubuntu:latest
docker save -o antrea-ubuntu.tar projects.registry.vmware.com/antrea/antrea-ubuntu:latest

kubectl get nodes -o wide --no-headers=true | awk '$3 != "master" {print $6}' | while read IP; do
rsync -avr --progress --inplace -e "ssh -o StrictHostKeyChecking=no" antrea-ubuntu.tar jenkins@[${IP}]:${WORKDIR}/antrea-ubuntu.tar
Expand Down
2 changes: 1 addition & 1 deletion ci/kind/kind-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# and docker bridge network connecting to worker Node.

CLUSTER_NAME=""
ANTREA_IMAGE="antrea/antrea-ubuntu:latest"
ANTREA_IMAGE="projects.registry.vmware.com/antrea/antrea-ubuntu:latest"
IMAGES=$ANTREA_IMAGE
ANTREA_CNI=true
POD_CIDR="10.10.0.0/16"
Expand Down
2 changes: 1 addition & 1 deletion ci/kind/test-e2e-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ if $coverage; then
manifest_args="$manifest_args --coverage"
COMMON_IMAGES_LIST+=("antrea/antrea-ubuntu-coverage:latest")
else
COMMON_IMAGES_LIST+=("antrea/antrea-ubuntu:latest")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have any good way to define the registry URL once in a file and other code just read the URL?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe have an update-image-name-with-registry.sh script to update all images' names in the repo? Then we don't need to add logic in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess specifically for test / CI, we can have something like this:

images.yml

antrea/antrea-ubuntu: projects.registry.vmware.com/antrea/antrea-ubuntu

get_img.sh

function get_img {
    while read -r line; do
        IFS=':' read -ra ADDR <<< "$line"
        name=$(echo ${ADDR[0]} | xargs)
        img=$(echo ${ADDR[1]} | xargs)
        if [[ $name == $1 ]]; then echo $img; fi
    done < "images.yml"
}

[[ $_ != $0 ]] || get_img $1

for example, CI scripts can source get_img.sh and use "$(get_img antrea/antrea-ubuntu)"

I am not sure it's much better though. Maybe we can wait a bit and see how things evolve in the short term? Right now we have to push and pull from different registries which is making things a bit tricky.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Yes we can wait and see.

COMMON_IMAGES_LIST+=("projects.registry.vmware.com/antrea/antrea-ubuntu:latest")
fi
printf -v COMMON_IMAGES "%s " "${COMMON_IMAGES_LIST[@]}"

Expand Down
6 changes: 3 additions & 3 deletions ci/kind/test-upgrade-antrea.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ fi

echo "Running upgrade test for tag $FROM_TAG"

DOCKER_IMAGES=("busybox" "antrea/antrea-ubuntu:$FROM_TAG")
DOCKER_IMAGES=("busybox" "projects.registry.vmware.com/antrea/antrea-ubuntu:$FROM_TAG")

for img in "${DOCKER_IMAGES[@]}"; do
echo "Pulling $img"
docker pull $img > /dev/null
done

DOCKER_IMAGES+=("antrea/antrea-ubuntu:latest")
DOCKER_IMAGES+=("projects.registry.vmware.com/antrea/antrea-ubuntu:latest")

echo "Creating Kind cluster"
IMAGES="${DOCKER_IMAGES[@]}"
Expand All @@ -150,7 +150,7 @@ export KUSTOMIZE=$ROOT_DIR/hack/.bin/kustomize
TMP_ANTREA_DIR=$(mktemp -d)
git clone --branch $FROM_TAG --depth 1 https://github.com/vmware-tanzu/antrea.git $TMP_ANTREA_DIR
pushd $TMP_ANTREA_DIR > /dev/null
export IMG_NAME=antrea/antrea-ubuntu
export IMG_NAME=projects.registry.vmware.com/antrea/antrea-ubuntu
export IMG_TAG=$FROM_TAG
./hack/generate-manifest.sh --mode release --kind | kubectl apply -f -
./hack/generate-manifest.sh --mode release --kind | docker exec -i kind-control-plane dd of=/root/antrea.yml
Expand Down
5 changes: 3 additions & 2 deletions ci/test-conformance-aks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ function deliver_antrea_to_aks() {

antrea_image="antrea-ubuntu"
DOCKER_IMG_VERSION=${CLUSTER}
docker save -o ${antrea_image}.tar antrea/antrea-ubuntu:${DOCKER_IMG_VERSION}
DOCKER_IMG_NAME="projects.registry.vmware.com/antrea/antrea-ubuntu"
docker save -o ${antrea_image}.tar ${DOCKER_IMG_NAME}:${DOCKER_IMG_VERSION}

CLUSTER_RESOURCE_GROUP=$(az aks show --resource-group ${RESOURCE_GROUP} --name ${CLUSTER} --query nodeResourceGroup -o tsv)
SCALE_SET_NAME=$(az vmss list --resource-group ${CLUSTER_RESOURCE_GROUP} --query [0].name -o tsv)
Expand All @@ -225,7 +226,7 @@ function deliver_antrea_to_aks() {

for IP in ${NODE_IPS}; do
scp -o StrictHostKeyChecking=no -i ${SSH_PRIVATE_KEY_PATH} ${antrea_image}.tar azureuser@${IP}:~
ssh -o StrictHostKeyChecking=no -i ${SSH_PRIVATE_KEY_PATH} -n azureuser@${IP} "sudo docker load -i ~/${antrea_image}.tar ; sudo docker tag antrea/antrea-ubuntu:${DOCKER_IMG_VERSION} antrea/antrea-ubuntu:latest"
ssh -o StrictHostKeyChecking=no -i ${SSH_PRIVATE_KEY_PATH} -n azureuser@${IP} "sudo docker load -i ~/${antrea_image}.tar ; sudo docker tag ${DOCKER_IMG_NAME}:${DOCKER_IMG_VERSION} ${DOCKER_IMG_NAME}:latest"
done
rm ${antrea_image}.tar

Expand Down
5 changes: 3 additions & 2 deletions ci/test-conformance-eks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,12 @@ function deliver_antrea_to_eks() {
echo "=== Loading the Antrea image to each Node ==="
antrea_image="antrea-ubuntu"
DOCKER_IMG_VERSION=${CLUSTER}
docker save -o ${antrea_image}.tar antrea/antrea-ubuntu:${DOCKER_IMG_VERSION}
DOCKER_IMG_NAME="projects.registry.vmware.com/antrea/antrea-ubuntu"
docker save -o ${antrea_image}.tar ${DOCKER_IMG_NAME}:${DOCKER_IMG_VERSION}

kubectl get nodes -o wide --no-headers=true | awk '{print $7}' | while read IP; do
scp -o StrictHostKeyChecking=no -i ${SSH_PRIVATE_KEY_PATH} ${antrea_image}.tar ec2-user@${IP}:~
ssh -o StrictHostKeyChecking=no -i ${SSH_PRIVATE_KEY_PATH} -n ec2-user@${IP} "sudo docker load -i ~/${antrea_image}.tar ; sudo docker tag antrea/antrea-ubuntu:${DOCKER_IMG_VERSION} antrea/antrea-ubuntu:latest"
ssh -o StrictHostKeyChecking=no -i ${SSH_PRIVATE_KEY_PATH} -n ec2-user@${IP} "sudo docker load -i ~/${antrea_image}.tar ; sudo docker tag ${DOCKER_IMG_NAME}:${DOCKER_IMG_VERSION} ${DOCKER_IMG_NAME}:latest"
done
rm ${antrea_image}.tar

Expand Down
Loading