Skip to content

Commit e230fc2

Browse files
committed
Add docs for embedded registry mirror
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
1 parent 7ef4c30 commit e230fc2

28 files changed

+1421
-584
lines changed

docs/cli/agent.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Options are documented on this page as CLI flags, but can also be passed as conf
7979
| `--rootless` | Run rootless |
8080
| `--docker` | Use cri-dockerd instead of containerd |
8181
| `--prefer-bundled-bin` | Prefer bundled userspace binaries over host binaries |
82+
| `--disable-default-registry-endpoint` | See "[Default Endpoint Fallback](../installation/private-registry.md#default-endpoint-fallback)"
8283

8384
### Deprecated
8485

docs/cli/server.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The following options must be set to the same value on all servers in the cluste
2424
* `--disable-network-policy`
2525
* `--disable=servicelb` *note: other packaged components may be disabled on a per-server basis*
2626
* `--egress-selector-mode`
27+
* `--embedded-registry`
2728
* `--flannel-backend`
2829
* `--flannel-external-ip`
2930
* `--flannel-ipv6-masq`
@@ -170,6 +171,7 @@ The following options must be set to the same value on all servers in the cluste
170171
| `--docker` | Use cri-dockerd instead of containerd |
171172
| `--prefer-bundled-bin` | Prefer bundled userspace binaries over host binaries |
172173
| `--disable-agent` | See "[Running Agentless Servers (Experimental)](../advanced.md#running-agentless-servers-experimental)" |
174+
| `--embedded-registry` | See "[Embedded Registry Mirror](../installation/registry-mirror.md)" |
173175

174176

175177
### Deprecated Options

docs/installation/airgap.md

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,54 @@ weight: 60
55

66
You can install K3s in an air-gapped environment using two different methods. An air-gapped environment is any environment that is not directly connected to the Internet. You can either deploy a private registry and mirror docker.io, or you can manually deploy images such as for small clusters.
77

8-
## Private Registry Method
8+
## Load Images
99

10-
This document assumes you have already created your nodes in your air-gap environment and have a Docker private registry on your bastion host.
10+
### Private Registry Method
1111

12-
If you have not yet set up a private Docker registry, refer to the official documentation [here](https://docs.docker.com/registry/deploying/#run-an-externally-accessible-registry).
12+
These steps assume you have already created nodes in your air-gap environment,
13+
are using the bundled containerd as the container runtime,
14+
and have a OCI-compliant private registry available in your environment.
1315

14-
### Create the Registry YAML
16+
If you have not yet set up a private Docker registry, refer to the [official Registry documentation](https://docs.docker.com/registry/deploying/#run-an-externally-accessible-registry).
1517

16-
Follow the [Private Registry Configuration](private-registry.md) guide to create and configure the registry.yaml file.
18+
#### Create the Registry YAML and Push Images
1719

18-
Once you have completed this, you may now go to the [Install K3s](#install-k3s) section below.
20+
1. Obtain the images archive for your architecture from the [releases](https://github.com/k3s-io/k3s/releases) page for the version of K3s you will be running.
21+
2. Use `docker image load k3s-airgap-images-amd64.tar.zst` to import images from the tar file into docker.
22+
3. Use `docker tag` and `docker push` to retag and push the loaded images to your private registry.
23+
4. Follow the [Private Registry Configuration](private-registry.md) guide to create and configure the `registries.yaml` file.
24+
5. Proceed to the [Install K3s](#install-k3s) section below.
1925

26+
### Manually Deploy Images Method
2027

21-
## Manually Deploy Images Method
28+
These steps assume you have already created nodes in your air-gap environment,
29+
are using the bundled containerd as the container runtime,
30+
and cannot or do not want to use a private registry.
2231

23-
We are assuming you have created your nodes in your air-gap environment and use containerd as container runtime.
24-
This method requires you to manually deploy the necessary images to each node and is appropriate for edge deployments where running a private registry is not practical.
32+
This method requires you to manually deploy the necessary images to each node, and is appropriate for edge deployments where running a private registry is not practical.
2533

26-
### Prepare the Images Directory and K3s Binary
27-
Obtain the images tar file for your architecture from the [releases](https://github.com/k3s-io/k3s/releases) page for the version of K3s you will be running.
34+
#### Prepare the Images Directory and Airgap Image Tarball
2835

29-
Place the tar file in the `images` directory, for example:
36+
1. Obtain the images archive for your architecture from the [releases](https://github.com/k3s-io/k3s/releases) page for the version of K3s you will be running.
37+
2. Download the imagess archive to the agent's images directory, for example:
38+
```bash
39+
sudo mkdir -p /var/lib/rancher/k3s/agent/images/
40+
sudo curl -L -O /var/lib/rancher/k3s/agent/images/k3s-airgap-images-amd64.tar.zst https://github.com/k3s-io/k3s/releases/download/v1.29.1-rc2%2Bk3s1/k3s-airgap-images-amd64.tar.zst
41+
```
42+
3. Proceed to the [Install K3s](#install-k3s) section below.
3043

31-
```bash
32-
sudo mkdir -p /var/lib/rancher/k3s/agent/images/
33-
sudo cp ./k3s-airgap-images-$ARCH.tar /var/lib/rancher/k3s/agent/images/
34-
```
44+
### Embedded Registry Mirror
45+
46+
:::info Version Gate
47+
The Embedded Registry Mirror is available as an experimental feature as of January 2024 releases: v1.26.13+k3s1, v1.27.10+k3s1, v1.28.6+k3s1, v1.29.1+k3s1
48+
:::
49+
50+
K3s includes an embedded distributed OCI-compliant registry mirror.
51+
When enabled and properly configured, images available in the containerd image store on any node
52+
can be pulled by other cluster members without access to an external image registry.
3553

36-
Once you have completed this, you may now go to the [Install K3s](#install-k3s) section below.
54+
The mirrored images may be sourced from an upstream registry, registry mirror, or airgap image tarball.
55+
For more information on enabling the embedded distributed registry mirror, see the [Embedded Registry Mirror](./registry-mirror.md) documentation.
3756

3857
## Install K3s
3958

@@ -119,7 +138,7 @@ K3S_DATASTORE_ENDPOINT='mysql://username:password@tcp(hostname:3306)/database-na
119138
</Tabs>
120139

121140
:::note
122-
K3s additionally provides a `--resolv-conf` flag for kubelets, which may help with configuring DNS in air-gap networks.
141+
K3s's `--resolv-conf` flag is passed through to the kubelet, which may help with configuring pod DNS resolution in air-gap networks where the host does not have upstream nameservers configured.
123142
:::
124143

125144
## Upgrading

docs/installation/installation.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ This section contains instructions for installing K3s in various environments. P
99

1010
[Network Options](network-options.md) provides guidance on the networking options available in k3s.
1111

12-
[Air-Gap Installation](airgap.md) details how to set up K3s in environments that do not have direct access to the Internet.
12+
[Private Registry Configuration](private-registry.md) covers use of `registries.yaml` to configure container image registry mirrors.
13+
14+
[Embedded Mirror](registry-mirror.md) shows how to enable the embedded distributed image registry mirror.
15+
16+
[Air-Gap Install](airgap.md) details how to set up K3s in environments that do not have direct access to the Internet.
1317

1418
[Managing Server Roles](server-roles.md) details how to set up K3s with dedicated `control-plane` or `etcd` servers.
1519

1620
[Managing Packaged Components](packaged-components.md) details how to disable packaged components, or install your own using auto-deploying manifests.
21+
22+
[Uninstalling K3s](uninstall.md) details how to remove K3s from a host.

docs/installation/network-options.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ K3s no longer includes strongSwan `swanctl` and `charon` binaries starting with
3535

3636
:::
3737

38-
#### Migrating from `wireguard` or `ipsec` to `wireguard-native`
38+
### Migrating from `wireguard` or `ipsec` to `wireguard-native`
3939

40-
The legacy `wireguard` backend requires installation of the `wg` tool on the host. This backend will be removed in K3s v1.26, in favor of `wireguard-native` backend, which directly interfaces with the kernel.
40+
The legacy `wireguard` backend requires installation of the `wg` tool on the host. This backend is not available in K3s v1.26 and higher, in favor of `wireguard-native` backend, which directly interfaces with the kernel.
4141

42-
The legacy `ipsec` backend requires installation of the `swanctl` and `charon` binaries on the host. This backend will be removed in K3s v1.27, in favor of the `wireguard-native` backend.
42+
The legacy `ipsec` backend requires installation of the `swanctl` and `charon` binaries on the host. This backend is not available in K3s v1.27 and higher, in favor of the `wireguard-native` backend.
4343

4444
We recommend that users migrate to the new backend as soon as possible. The migration requires a short period of downtime while nodes come up with the new configuration. You should follow these two steps:
4545

@@ -120,14 +120,16 @@ K3s agents and servers maintain websocket tunnels between nodes that are used to
120120
This allows agents to operate without exposing the kubelet and container runtime streaming ports to incoming connections, and for the control-plane to connect to cluster services when operating with the agent disabled.
121121
This functionality is equivalent to the [Konnectivity](https://kubernetes.io/docs/tasks/extend-kubernetes/setup-konnectivity/) service commonly used on other Kubernetes distributions, and is managed via the apiserver's egress selector configuration.
122122

123+
The default mode is `agent`. `pod` or `cluster` modes are recommended when running [agentless servers](../advanced.md#running-agentless-servers-experimental), in order to provide the apiserver with access to cluster service endpoints in the absence of flannel and kube-proxy.
124+
123125
The egress selector mode may be configured on servers via the `--egress-selector-mode` flag, and offers four modes:
124126
* `disabled`: The apiserver does not use agent tunnels to communicate with kubelets or cluster endpoints.
125127
This mode requires that servers run the kubelet, CNI, and kube-proxy, and have direct connectivity to agents, or the apiserver will not be able to access service endpoints or perform `kubectl exec` and `kubectl logs`.
126128
* `agent` (default): The apiserver uses agent tunnels to communicate with kubelets.
127129
This mode requires that the servers also run the kubelet, CNI, and kube-proxy, or the apiserver will not be able to access service endpoints.
128-
* `pod`: The apiserver uses agent tunnels to communicate with kubelets and service endpoints, routing endpoint connections to the correct agent by watching Nodes.
129-
**NOTE**: This will not work when using a CNI that uses its own IPAM and does not respect the node's PodCIDR allocation. `cluster` or `agent` should be used with these CNIs instead.
130-
* `cluster`: The apiserver uses agent tunnels to communicate with kubelets and service endpoints, routing endpoint connections to the correct agent by watching Endpoints.
130+
* `pod`: The apiserver uses agent tunnels to communicate with kubelets and service endpoints, routing endpoint connections to the correct agent by watching Nodes and Endpoints.
131+
**NOTE**: This mode will not work when using a CNI that uses its own IPAM and does not respect the node's PodCIDR allocation. `cluster` or `agent` mode should be used with these CNIs instead.
132+
* `cluster`: The apiserver uses agent tunnels to communicate with kubelets and service endpoints, routing endpoint connections to the correct agent by watching Pods and Endpoints. This mode has the highest portability across different cluster configurations, at the cost of increased overhead.
131133

132134
## Dual-stack (IPv4 + IPv6) Networking
133135

0 commit comments

Comments
 (0)