Skip to content

一摸 k3s: 安装历程 #195

@Bpazy

Description

@Bpazy

安装

1. 安装 k3s

curl -sfL https://get.k3s.io | sh -

国内用户使用以下方法加速安装:

curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn sh -

2. 更改 k3s 中 containerd 默认镜像地址

因为 k3s 默认不使用 docker, 所以修改 docker 的 mirror 是没用的,这里我们需要修改 containerd mirror 地址:

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

输入:

mirrors:
  docker.io:
    endpoint:
      - "https://*****.mirror.aliyuncs.com"

注意:

  1. 这里的 docker.io 不应该被替换为其他关键词;
  2. 阿里云加速器地址在这里获取: https://cr.console.aliyun.com/cn-shanghai/instances/mirrors

重启 k3s:

sudo systemctl restart k3s

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions