Skip to content

Sync images to Aliyun #1620

Sync images to Aliyun

Sync images to Aliyun #1620

name: Sync images to Aliyun
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
push:
paths:
- 'example/variables.yaml'
jobs:
dockerhub-to-aliyun:
runs-on: ubuntu-latest
container: setzero/registry-manager
env:
TO_USERNAME: ${{ secrets.TO_USERNAME }}
TO_PASSWORD: ${{ secrets.TO_PASSWORD }}
steps:
- name: Dockerhub to Aliyun
run: |
cat << EOF >config.yaml
registries:
aliyuncs:
registry: https://registry.aliyuncs.com
username: $TO_USERNAME
password: $TO_PASSWORD
dockerhub:
registry: https://registry-1.docker.io
repositories:
- calico/typha
- calico/cni
- calico/node
- calico/kube-controllers
- calico/pod2daemon-flexvol
- calico/ctl
- jettech/kube-webhook-certgen
- kubernetesui/dashboard
- kubernetesui/metrics-scraper
- flannel/flannel
- flannel/flannel-cni-plugin
sync-policy:
from: dockerhub
to: aliyuncs
dry-run: false
replace:
- old: calico/
new: kubeadm-ha/calico_
- old: jettech/
new: kubeadm-ha/jettech_
- old: kubernetesui/
new: kubeadm-ha/kubernetesui_
- old: flannel/
new: kubeadm-ha/flannel_
filters:
- flannel
- ^[Vv]?\d+\.\d+(\.\d+)?(-\d+)?$
EOF
registry-manager sync -c config.yaml
- name: Dockerhub to Aliyun force
run: |
cat << EOF >config.yaml
registries:
aliyuncs:
registry: https://registry.aliyuncs.com
username: $TO_USERNAME
password: $TO_PASSWORD
dockerhub:
registry: https://registry-1.docker.io
repositories:
- library/nginx:1.25-alpine
- library/haproxy:2.8-alpine
- library/traefik:v3.0.0
- osixia/keepalived:2.0.20
sync-policy:
from: dockerhub
to: aliyuncs
dry-run: false
force: true
replace:
- old: osixia/
new: kubeadm-ha/osixia_
- old: library
new: kubeadm-ha
filters:
- ^[Vv]?\d+\.\d+(\.\d+)?(-\d+)?$
EOF
registry-manager sync -c config.yaml
quay-to-aliyun:
runs-on: ubuntu-latest
container: setzero/registry-manager
env:
TO_USERNAME: ${{ secrets.TO_USERNAME }}
TO_PASSWORD: ${{ secrets.TO_PASSWORD }}
steps:
- name: Quay to Aliyun
run: |
cat << EOF >config.yaml
registries:
aliyuncs:
registry: https://registry.aliyuncs.com
username: ${{ secrets.TO_USERNAME }}
password: ${{ secrets.TO_PASSWORD }}
quay:
registry: https://quay.io
repositories:
- jetstack/cert-manager-cainjector
- jetstack/cert-manager-webhook
- jetstack/cert-manager-controller
- jetstack/cert-manager-acmesolver
sync-policy:
from: quay
to: aliyuncs
dry-run: false
replace:
- old: coreos/
new: kubeadm-ha/coreos_
- old: jetstack/
new: kubeadm-ha/jetstack_
filters:
- ^[Vv]?\d+\.\d+(\.\d+)?(-\d+)?$
EOF
registry-manager sync -c config.yaml
gcr-to-aliyun:
runs-on: ubuntu-latest
container: setzero/registry-manager
env:
TO_USERNAME: ${{ secrets.TO_USERNAME }}
TO_PASSWORD: ${{ secrets.TO_PASSWORD }}
steps:
- name: Gcr to Aliyun
run: |
cat << EOF >config.yaml
registries:
aliyuncs:
registry: https://registry.aliyuncs.com
username: ${{ secrets.TO_USERNAME }}
password: ${{ secrets.TO_PASSWORD }}
gcr:
registry: https://k8s.gcr.io
repositories:
- kube-apiserver
- kube-controller-manager
- kube-scheduler
- kube-proxy
- pause
- etcd
- coredns
- coredns/coredns
- ingress-nginx/controller
- ingress-nginx/kube-webhook-certgen
- metrics-server/metrics-server
sync-policy:
from: gcr
to: aliyuncs
dry-run: false
replace:
- old: ingress-nginx/
new: kubeadm-ha/ingress-nginx_
- old: metrics-server/
new: kubeadm-ha/metrics-server_
- old: coredns/
new: kubeadm-ha/
- new: kubeadm-ha
filters:
- ^[Vv]?\d+\.\d+(\.\d+)?(-\d+)?$
EOF
registry-manager sync -c config.yaml
k8s-to-aliyun2:
runs-on: ubuntu-latest
container: setzero/registry-manager
env:
TO_USERNAME: ${{ secrets.TO_USERNAME }}
TO_PASSWORD: ${{ secrets.TO_PASSWORD }}
steps:
- name: k8s to Aliyun
run: |
cat << EOF >config.yaml
registries:
aliyuncs:
registry: https://registry.aliyuncs.com
username: ${{ secrets.TO_USERNAME }}
password: ${{ secrets.TO_PASSWORD }}
k8s:
registry: https://registry.k8s.io
repositories:
- ingress-nginx/kube-webhook-certgen
sync-policy:
from: k8s
to: aliyuncs
dry-run: false
replace:
- old: ingress-nginx/
new: kubeadm-ha/ingress-nginx_
filters:
- ^[Vv]
EOF
registry-manager sync -c config.yaml
k8s-to-aliyun:
runs-on: ubuntu-latest
container: setzero/registry-manager
env:
TO_USERNAME: ${{ secrets.TO_USERNAME }}
TO_PASSWORD: ${{ secrets.TO_PASSWORD }}
steps:
- name: k8s to Aliyun
run: |
cat << EOF >config.yaml
registries:
aliyuncs:
registry: https://registry.aliyuncs.com
username: ${{ secrets.TO_USERNAME }}
password: ${{ secrets.TO_PASSWORD }}
k8s:
registry: https://registry.k8s.io
repositories:
- kube-apiserver
- kube-controller-manager
- kube-scheduler
- kube-proxy
- pause
- etcd
- coredns
- coredns/coredns
- ingress-nginx/controller
- ingress-nginx/kube-webhook-certgen
- metrics-server/metrics-server
sync-policy:
from: k8s
to: aliyuncs
dry-run: false
replace:
- old: coredns/
new: kubeadm-ha/
- old: ingress-nginx/
new: kubeadm-ha/ingress-nginx_
- old: metrics-server/
new: kubeadm-ha/metrics-server_
- new: kubeadm-ha
filters:
- ^[Vv]?\d+\.\d+(\.\d+)?(-\d+)?$
EOF
registry-manager sync -c config.yaml