Skip to content

Commit

Permalink
versioned
Browse files Browse the repository at this point in the history
  • Loading branch information
poneding committed Nov 7, 2023
1 parent bead52b commit be7a6c0
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@
2. **安装 registry-proxy**

```bash
kubectl apply -f https://raw.githubusercontent.com/ketches/registry-proxy/master/deploy/manifests.yaml
export LATEST=$(basename $(curl -s -w %{redirect_url} https://github.com/ketches/registry-proxy/releases/latest))

kubectl apply -f https://raw.githubusercontent.com/ketches/registry-proxy/$LATEST/deploy/manifests.yaml

# 代理地址
kubectl apply -f https://ghproxy.com/https://raw.githubusercontent.com/ketches/registry-proxy/master/deploy/manifests.yaml
kubectl apply -f https://ghproxy.com/https://raw.githubusercontent.com/ketches/registry-proxy/$LATEST/deploy/manifests.yaml
```

## 配置
Expand Down Expand Up @@ -97,10 +99,10 @@ data:
使用 Docker 镜像 nginx 创建一个 Pod:

```bash
kubectl apply -f https://raw.githubusercontent.com/ketches/registry-proxy/master/examples/dockerhub-nginx.yaml
kubectl apply -f https://raw.githubusercontent.com/ketches/registry-proxy/$LATEST/examples/dockerhub-nginx.yaml
# 代理地址
kubectl apply -f https://ghproxy.com/https://raw.githubusercontent.com/ketches/registry-proxy/master/examples/dockerhub-nginx.yaml
kubectl apply -f https://ghproxy.com/https://raw.githubusercontent.com/ketches/registry-proxy/$LATEST/examples/dockerhub-nginx.yaml
```

示例中的 Pod 镜像为 `nginx:latest`,经过 registry-proxy 自动代理后,容器镜像变为 `docker.ketches.cn/library/nginx:latest`。
Expand All @@ -116,19 +118,20 @@ kubectl get pod dockerhub-nginx -o=jsonpath='{.spec.containers[*].image}'
**卸载 registry-proxy**

```bash
kubectl delete -f https://raw.githubusercontent.com/ketches/registry-proxy/master/deploy/manifests.yaml
export LATEST=$(basename $(curl -s -w %{redirect_url} https://github.com/ketches/registry-proxy/releases/latest))
kubectl delete -f https://raw.githubusercontent.com/ketches/registry-proxy/$LATEST/deploy/manifests.yaml
# 代理地址
kubectl delete -f https://ghproxy.com/https://raw.githubusercontent.com/ketches/registry-proxy/master/deploy/manifests.yaml
kubectl delete -f https://ghproxy.com/https://raw.githubusercontent.com/ketches/registry-proxy/$LATEST/deploy/manifests.yaml
```

**清理示例**

```bash
kubectl delete -f https://raw.githubusercontent.com/ketches/registry-proxy/master/examples/dockerhub-nginx.yaml
kubectl delete -f https://raw.githubusercontent.com/ketches/registry-proxy/$LATEST/examples/dockerhub-nginx.yaml
# 代理地址
kubectl delete -f https://ghproxy.com/https://raw.githubusercontent.com/ketches/registry-proxy/master/examples/dockerhub-nginx.yaml
kubectl delete -f https://ghproxy.com/https://raw.githubusercontent.com/ketches/registry-proxy/$LATEST/examples/dockerhub-nginx.yaml
```

## 代理参考
Expand Down

0 comments on commit be7a6c0

Please sign in to comment.