When I try to run a container in the cluster, I get a message "deployment test created
" but when I look at the dashboard I can see that its in an error state (Failed to pull image...
, it was not able to pull the image from the local minikube docker env due to authorization issues
My steps were:
--insecure-registry
switch to 10.0.0.0/8, also tried 0.0.0.0/0 - Kubernetes version 1.9.0 also tried 1.8.0docker env
to the minikube docker via minikube docker-env | Invoke-Expression
kubectl run test --image test-service --port 1101
This is the result:
What am I missing?
As discussed in the comments, openfaas/faas-netes
issue 135 illustrates a similar issue, and mention as a possible solution:
imagePullPolicy
if not mentioned should have defaulted toNever
instead ofAlways
.
The OP Tim Jarvis realized then:
I realized it was not an auth issue, but that it was always wanting to pull from an external repo.
The fix for me was to use theimagePullPolicy
ofIfNotPresent
.
This also happened with me, it is important to check the policy to send retrieve your image, there are some ways as described in some forums, you can start your minikube by setting a registry of your preference as below, being a path.
$ minikube start --cpus 2 --disk-size 50g --memory 5000 --insecure-registry your.registry.com:5000
another way is at the beginning of your minikube to present the environment variables through the docker-env, as follows and generate build of your image after the command.
$ eval $(minikube docker-env)
another alternative is to import the image to existing through the docker load.
Set the following property within the container definition:
imagePullPolicy: IfNotPresent
Example:
...
containers:
- name: podhealthexample
image: podhealth-pod-a:latest
ports:
- containerPort: 80
imagePullPolicy: IfNotPresent
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With