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

registry: registry.k8s.io #461

Merged
merged 1 commit into from
Feb 15, 2024
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
5 changes: 5 additions & 0 deletions caddy/Caddyfile.siyuan
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ https://mirror.sjtu.edu.cn {
not path /git/qemu.git/*
not path /linuxliteos/*
not path /download.flutter.io/*
not path /k8s.gcr.io/*
not path /google-fonts/*
not path /CPAN/*
not path /CRAN/*
Expand Down Expand Up @@ -994,6 +995,10 @@ https://mirror.sjtu.edu.cn {
handle_path /download.flutter.io/* {
redir * https://mirrors.tuna.tsinghua.edu.cn/flutter/download.flutter.io/{uri} 302
}
redir /k8s.gcr.io /k8s.gcr.io/ 301
handle_path /k8s.gcr.io/* {
redir * https://mirrors.sjtug.sjtu.edu.cn/registry.k8s.io{uri} 302
}
redir /google-fonts /google-fonts/ 301
handle_path /google-fonts/* {
redir * https://fonts.googleapis.com{uri} 302
Expand Down
18 changes: 16 additions & 2 deletions caddy/Caddyfile.zhiyuan
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ k8s-gcr-io.mirrors.sjtug.sjtu.edu.cn {
output stdout
format transform "{common_log}" # log in v1 style, caddyserver/transform-encoder required
}
reverse_proxy gcr-registry:80 {
redir * https://mirrors.sjtug.sjtu.edu.cn/registry.k8s.io{uri} 302
header * x-sjtug-mirror-id zhiyuan
}

registry-k8s-io.mirrors.sjtug.sjtu.edu.cn {
log {
output stdout
format transform "{common_log}" # log in v1 style, caddyserver/transform-encoder required
}
reverse_proxy k8s-registry:80 {
header_up Host {http.reverse_proxy.upstream.hostport}
}
header * x-sjtug-mirror-id zhiyuan
Expand Down Expand Up @@ -176,6 +185,7 @@ https://mirrors.sjtug.sjtu.edu.cn {
not path /git/qemu.git/*
not path /download.flutter.io/*
not path /k8s.gcr.io/*
not path /registry.k8s.io/*
not path /docker-registry/*
not path /google-fonts/*
not path /anaconda/*
Expand Down Expand Up @@ -519,7 +529,11 @@ https://mirrors.sjtug.sjtu.edu.cn {
}
redir /k8s.gcr.io /k8s.gcr.io/ 301
handle_path /k8s.gcr.io/* {
reverse_proxy gcr-registry:80 {
redir * https://mirrors.sjtug.sjtu.edu.cn/registry.k8s.io{uri} 302
}
redir /registry.k8s.io /registry.k8s.io/ 301
handle_path /registry.k8s.io/* {
reverse_proxy k8s-registry:80 {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}
Expand Down
8 changes: 7 additions & 1 deletion config.zhiyuan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,14 @@ repos:
disabled: true
- type: external
name: k8s.gcr.io
proxy_to: gcr-registry:80
subdomain: k8s-gcr-io.mirrors.sjtug.sjtu.edu.cn
serve_mode: redir
target: https://mirrors.sjtug.sjtu.edu.cn/registry.k8s.io
disabled: true
- type: external
name: registry.k8s.io
subdomain: registry-k8s-io.mirrors.sjtug.sjtu.edu.cn
proxy_to: k8s-registry:80
unified: disable
serve_mode: proxy
- type: external
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.zhiyuan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ services:
memswap_limit: 1G


gcr-registry:
container_name: zhiyuan-gcr-registry
k8s-registry:
container_name: zhiyuan-k8s-registry
restart: unless-stopped
image: registry:2.8
networks:
Expand All @@ -105,7 +105,7 @@ services:
- 80
- 5001
volumes:
- "./secrets/gcr-registry.yml:/etc/docker/registry/config.yml"
- "./secrets/k8s-registry.yml:/etc/docker/registry/config.yml"
environment:
http_proxy: http://clash:8080
https_proxy: http://clash:8080
Expand Down
Loading