猫小白

猫小白

使用 daocloud 源

1. vim /etc/rancher/k3s/registries.yaml

mirrors:
  docker.io:
    endpoint:
      - "https://docker.m.daocloud.io/"
  quay.io:
    endpoint:
      - "https://quay.m.daocloud.io/"
  registry.k8s.io:
    endpoint:
      - "https://k8s.m.daocloud.io/"
  gcr.io:
    endpoint:
      - "https://gcr.m.daocloud.io/"
  k8s.gcr.io:
    endpoint:
      - "http://k8s-gcr.m.daocloud.io/"
  ghcr.io:
    endpoint:
      - "https://ghcr.m.daocloud.io/"

2. systemctl restart k3s (worker 节点重启的是 k3s-agent 服务)

自建源

需要一台 HK 地区或者国外的云主机,并安装好 docker 引擎

1. vim docker-compose.yaml

version: '3'
services:
  crproxy:
    image: ghcr.io/daocloud/crproxy/crproxy:v0.8.0
    container_name: crproxy
    restart: unless-stopped
    ports:
    - 80:8080
    - 443:8080
    command: |
      --acme-cache-dir=/tmp/acme
      --acme-hosts=*
      --default-registry=docker.io
    tmpfs:
      - /tmp/acme

2. docker-compose up -d

BlogKubernetes