@@ -9,13 +9,13 @@ draft: false
9
9
When you see these kinds of errors it means that Kubernetes cannot find your Docker image.
10
10
The most common causes are:
11
11
12
- * The ` image ` value is your domain resource is set incorrectly, meaning Kubernetes will be
12
+ * The ` image ` value in your domain resource is set incorrectly, meaning Kubernetes will be
13
13
trying to pull the wrong image
14
14
* The image requires authentication or permission in order to pull it and you have not
15
15
configured Kubernetes with the necessary credentials, for example in an ` imagePullSecret `
16
16
* You built the image on a machine that is not where your ` kubelet ` is running and Kubernetes
17
17
cannot see the image, meaning you need to copy the image to the worker nodes or put it in
18
- a Docker registry that is accessible the to worker nodes
18
+ a Docker registry that is accessible the to all of the worker nodes
19
19
20
20
Let's review what happens when Kubernetes starts a pod.
21
21
@@ -24,22 +24,22 @@ Let's review what happens when Kubernetes starts a pod.
24
24
The definition of the pod contains a list of container specifications. Each container
25
25
specificiation contains the name (and optionally tag) of the image that should be used
26
26
to run that container. In the example above, there is a container called ` c1 ` which is
27
- configured to use the docker image ` some.registry.com/owner/domain1:1.0 ` . This image
27
+ configured to use the Docker image ` some.registry.com/owner/domain1:1.0 ` . This image
28
28
name is in the format ` registry address / owner / name : tag ` , so in this case the
29
29
registry is ` some.registry.com ` , then owner is ` owner ` , the image name is ` domain `
30
30
and the tag is ` 1.0 ` . Tags are a lot like version numbers, but they are not required
31
31
to be numbers or to be in any particular sequence or format. If you omit the tag, it
32
32
is assumed to be ` latest ` .
33
33
34
34
{{% notice note %}}
35
- The docker tag ` latest ` is confusing - it does not actually mean the latest version of
35
+ The Docker tag ` latest ` is confusing - it does not actually mean the latest version of
36
36
the image that was created or published in the registry, it just literally means
37
37
whichever version the owner decided to call "latest". Docker and Kubernetes make
38
- some assumptions about latest, and it generally recommended to avoid using it and instead
38
+ some assumptions about latest, and it is generally recommended to avoid using it and instead
39
39
specify the actual version/tag that you really want.
40
40
{{% /notice %}}
41
41
42
- First, Kuberentes will check to see if the requested image is available in the local
42
+ First, Kubernetes will check to see if the requested image is available in the local
43
43
Docker image store on whichever worker node the pod was scheduled on. If it is there,
44
44
then it will use that image to start the container. If it is not there, then Kubernetes
45
45
will attempt to pull the image from a remote Docker registry.
@@ -57,32 +57,32 @@ store and start the container.
57
57
#### Images that require authentication
58
58
59
59
If the remote Docker registry requires authentication, then you will need to provide
60
- the authentication details in a Kubernetes ` docker -registry` secret and tell Kubernetes
60
+ the authentication details in a Kubernetes ` Docker -registry` secret and tell Kubernetes
61
61
to use that secret when pulling the image.
62
62
63
63
To create a secret, you can use the following command:
64
64
65
65
```
66
- kubectl create secret docker -registry secret1 \
67
- --docker -server=some.registry.com \
68
- --docker -username=bob \
69
- --docker -password=bigSecret \
70
-
66
+ kubectl create secret Docker -registry secret1 \
67
+ --Docker -server=some.registry.com \
68
+ --Docker -username=bob \
69
+ --Docker -password=bigSecret \
70
+
71
71
--namespace=default
72
72
```
73
73
74
- In this command, you would replace ` secret1 ` with the name of the secret; the ` docker -server`
75
- is set to the registry name, without the ` https:// ` prefix; the ` docker -username` , ` docker -password`
76
- and ` docker -email` are set to match the credentials you use the authenticate to the remote
74
+ In this command, you would replace ` secret1 ` with the name of the secret; the ` Docker -server`
75
+ is set to the registry name, without the ` https:// ` prefix; the ` Docker -username` , ` Docker -password`
76
+ and ` Docker -email` are set to match the credentials you use to authenticate to the remote
77
77
Docker registry; and the ` namespace ` must be set to the same namespace where you intend to
78
- use the image
78
+ use the image.
79
79
80
80
{{% notice note %}}
81
- Some registries may need a suffix making the ` docker -server` something like ` some.registry.com/v2 `
81
+ Some registries may need a suffix making the ` Docker -server` something like ` some.registry.com/v2 `
82
82
for example. You will need to check with your registry provider's documentation to see if this is needed.
83
83
{{% /notice %}}
84
84
85
- Once the secret is created, you need to tell Kubernetes to use it. This is done by adding
85
+ After the secret is created, you need to tell Kubernetes to use it. This is done by adding
86
86
an ` imagePullSecret ` to your Kubernetes YAML file. In the case of a WebLogic domain, you
87
87
add the secret name to the ` imagePullSecret ` in the domain custom resource YAML file.
88
88
@@ -127,25 +127,25 @@ remote Docker registries or if your images require different authentication cred
127
127
128
128
#### Manually copying the image to your worker nodes
129
129
130
- If you are not able to use a remote Docker registry, for example if you Kubernetes cluster is
130
+ If you are not able to use a remote Docker registry, for example if your Kubernetes cluster is
131
131
in a secure network with no external access, you can manually copy the Docker images to the
132
132
cluster instead.
133
133
134
134
On the machine where you created the image, export it into a tar file using this command:
135
135
136
136
```
137
- docker save domain1:1.0 > domain1.tar
137
+ Docker save domain1:1.0 > domain1.tar
138
138
```
139
139
140
140
Then copy that tar file to each worker node in your Kubernetes cluster and run this command
141
141
on each node:
142
142
143
143
```
144
- docker load < domain1.tar
144
+ Docker load < domain1.tar
145
145
```
146
146
147
147
#### Restart pods to clear the error
148
148
149
- After you have ensured the images are accessible on all worker nodes, you may need to restart
149
+ After you have ensured that the images are accessible on all worker nodes, you may need to restart
150
150
the pods so that Kubernetes will attempt to pull the images again. You can do this by
151
151
deleting the pods themselves, or deleting the domain resource and then recreating it.
0 commit comments