Skip to content

Commit 66d9eb7

Browse files
authored
Merge pull request #29946 from neolit123/1.23-update-docs-about-image-repository
kubeadm: add more details about air-gapped and custom images
2 parents 286db40 + a7badad commit 66d9eb7

File tree

2 files changed

+44
-19
lines changed

2 files changed

+44
-19
lines changed

content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,22 @@ For information about enabling IPVS mode with kubeadm see:
142142
For information about passing flags to control plane components see:
143143
- [control-plane-flags](/docs/setup/production-environment/tools/kubeadm/control-plane-flags/)
144144

145+
### Running kubeadm without an Internet connection {#without-internet-connection}
146+
147+
For running kubeadm without an Internet connection you have to pre-pull the required control-plane images.
148+
149+
You can list and pull the images using the `kubeadm config images` sub-command:
150+
151+
```shell
152+
kubeadm config images list
153+
kubeadm config images pull
154+
```
155+
156+
You can pass `--config` to the above commands with a [kubeadm configuration file](#config-file)
157+
to control the `kubernetesVersion` and `imageRepository` fields.
158+
159+
All default `k8s.gcr.io` images that kubeadm requires support multiple architectures.
160+
145161
### Using custom images {#custom-images}
146162

147163
By default, kubeadm pulls images from `k8s.gcr.io`. If the
@@ -151,13 +167,24 @@ requested Kubernetes version is a CI label (such as `ci/latest`)
151167
You can override this behavior by using [kubeadm with a configuration file](#config-file).
152168
Allowed customization are:
153169

170+
* To provide `kubernetesVersion` which affects the version of the images.
154171
* To provide an alternative `imageRepository` to be used instead of
155172
`k8s.gcr.io`.
156-
* To set `useHyperKubeImage` to `true` to use the HyperKube image.
157-
* To provide a specific `imageRepository` and `imageTag` for etcd or DNS add-on.
173+
* To provide a specific `imageRepository` and `imageTag` for etcd or CoreDNS.
174+
175+
Image paths between the default `k8s.gcr.io` and a custom repository specified using
176+
`imageRepository` may differ for backwards compatibility reasons. For example,
177+
one image might have a subpath at `k8s.gcr.io/subpath/image`, but be defaulted
178+
to `my.customrepository.io/image` when using a custom repository.
158179

159-
Please note that the configuration field `kubernetesVersion` or the command line flag
160-
`--kubernetes-version` affect the version of the images.
180+
To ensure you push the images to your custom repository in paths that kubeadm
181+
can consume, you must:
182+
183+
* Pull images from the defaults paths at `k8s.gcr.io` using `kubeadm config images {list|pull}`.
184+
* Push images to the paths from `kubeadm config images list --config=config.yaml`,
185+
where `config.yaml` contains the custom `imageRepository`, and/or `imageTag`
186+
for etcd and CoreDNS.
187+
* Pass the same `config.yaml` to `kubeadm init`.
161188

162189
### Uploading control-plane certificates to the cluster
163190

@@ -209,19 +236,6 @@ value to the kubelet.
209236

210237
Be aware that overriding the hostname can [interfere with cloud providers](https://github.com/kubernetes/website/pull/8873).
211238

212-
### Running kubeadm without an internet connection
213-
214-
For running kubeadm without an internet connection you have to pre-pull the required control-plane images.
215-
216-
You can list and pull the images using the `kubeadm config images` sub-command:
217-
218-
```shell
219-
kubeadm config images list
220-
kubeadm config images pull
221-
```
222-
223-
All images that kubeadm requires such as `k8s.gcr.io/kube-*`, `k8s.gcr.io/etcd` and `k8s.gcr.io/pause` support multiple architectures.
224-
225239
### Automating kubeadm
226240

227241
Rather than copying the token you obtained from `kubeadm init` to each node, as

content/en/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ kubeadm to tell it what to do. This crashloop is expected and normal.
8383
After you initialize your control-plane, the kubelet runs normally.
8484
{{< /note >}}
8585

86+
### Preparing the required container images
87+
88+
This step is optional and only applies in case you wish `kubeadm init` and `kubeadm join`
89+
to not download the default container images which are hosted at `k8s.gcr.io`.
90+
91+
Kubeadm has commands that can help you pre-pull the required images
92+
when creating a cluster without an internet connection on its nodes.
93+
See [Running kubeadm without an internet connection](/docs/reference/setup-tools/kubeadm/kubeadm-init#without-internet-connection) for more details.
94+
95+
Kubeadm allows you to use a custom image repository for the required images.
96+
See [Using custom images](docs/reference/setup-tools/kubeadm/kubeadm-init#custom-images)
97+
for more details.
98+
8699
### Initializing your control-plane node
87100

88101
The control-plane node is the machine where the control plane components run, including
@@ -108,8 +121,6 @@ with the default gateway to set the advertise address for this particular contro
108121
To use a different network interface, specify the `--apiserver-advertise-address=<ip-address>` argument
109122
to `kubeadm init`. To deploy an IPv6 Kubernetes cluster using IPv6 addressing, you
110123
must specify an IPv6 address, for example `--apiserver-advertise-address=fd00::101`
111-
1. (Optional) Run `kubeadm config images pull` prior to `kubeadm init` to verify
112-
connectivity to the gcr.io container image registry.
113124

114125
To initialize the control-plane node run:
115126

0 commit comments

Comments
 (0)