Skip to content

Commit

Permalink
Switch to VMware Harbor registry for Antrea Docker images
Browse files Browse the repository at this point in the history
All "user-facing" images (antrea/antrea-ubuntu, antrea/antrea-windows,
antrea/octant-antrea-ubuntu) are now pulled from the VMware Harbor
distribution registry (projects.registry.vmware.com) to avoid Docker
pull rate limiting.

The YAML manifests (top-of-tree and releases) now refer to the new
registry.

This is not a complete transition from Dockerhub to Harbor. Images used
for build purposes (e.g. antrea/openvswitch) are still pulled from
Dockerhub by default. Rate limiting is not as much of an issue for these
(not user-facing, Github workflows are not subject to rate limiting, we
have workarounds for the Jenkins CI jobs). One thing to keep is mind is
that we cannot push to the VMware Harbor registry from outside of the
the VMware corporate network. This is why all images are pushed to
the Dockerhub registry, which is then mirrored by the distribution
Harbor registry.

See #1555
  • Loading branch information
antoninbas committed Dec 8, 2020
1 parent 501bd0b commit 9744fd4
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 55 deletions.
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
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")
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
5 changes: 3 additions & 2 deletions ci/test-conformance-gke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,13 @@ function deliver_antrea_to_gke() {
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}

node_names=$(kubectl get nodes -o wide --no-headers=true | awk '{print $1}')
for node_name in ${node_names}; do
${GCLOUD_PATH} compute scp ${antrea_image}.tar ubuntu@${node_name}:~ --zone ${GKE_ZONE}
${GCLOUD_PATH} compute ssh ubuntu@${node_name} --command="sudo docker load -i ~/${antrea_image}.tar ; sudo docker tag antrea/antrea-ubuntu:${DOCKER_IMG_VERSION} antrea/antrea-ubuntu:latest" --zone ${GKE_ZONE}
${GCLOUD_PATH} compute ssh ubuntu@${node_name} --command="sudo docker load -i ~/${antrea_image}.tar ; sudo docker tag ${DOCKER_IMG_NAME}:${DOCKER_IMG_VERSION} ${DOCKER_IMG_NAME}:latest" --zone ${GKE_ZONE}
done
rm ${antrea_image}.tar

Expand Down
6 changes: 3 additions & 3 deletions docs/kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ kind create cluster --config kind-config.yml

### Deploy Antrea to your Kind cluster

These instructions assume that you have built the `antrea/antrea-ubuntu` Docker
image locally (e.g. by running `make` from the root of the repository).
These instructions assume that you have built the Antrea Docker image locally
(e.g. by running `make` from the root of the repository).

```bash
# "fix" the host's veth interfaces (for the different Kind Nodes)
kind get nodes | xargs ./hack/kind-fix-networking.sh
# load the Antrea Docker image in the Nodes
kind load docker-image antrea/antrea-ubuntu:latest
kind load docker-image projects.registry.vmware.com/antrea/antrea-ubuntu:latest
# deploy Antrea
./hack/generate-manifest.sh --kind | kubectl apply -f -
```
Expand Down
2 changes: 1 addition & 1 deletion hack/generate-manifest-octant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ $KUSTOMIZE edit add base $BASE
find ../../patches/$MODE -name \*.yml -exec cp {} . \;

if [ "$MODE" == "dev" ]; then
$KUSTOMIZE edit set image octant-antrea=antrea/octant-antrea-ubuntu:latest
$KUSTOMIZE edit set image octant-antrea=projects.registry.vmware.com/antrea/octant-antrea-ubuntu:latest
$KUSTOMIZE edit add patch imagePullPolicy.yml
fi

Expand Down
Loading

0 comments on commit 9744fd4

Please sign in to comment.