This message was deleted.
# rancher-desktop
a
This message was deleted.
r
It looks like you used
nerdctl build
to build the container image locally? if yes, then you need to pass the flag
--namespace <http://k8s.io|k8s.io>
to the
nerdctl build
command so that the images is available for kubernetes.
q
oh i was using docker to build as nerdctl is giving me some issues at the moment.. but i followed this: https://docs.rancherdesktop.io/tutorials/working-with-images/
i tried removing the option for 'imagePullPolicy: Never' but i still error: Failed to load logs: container "blog-scraper" in pod "blog-scraper-daily-manual-hc5s7-hn2jd" is waiting to start: image can't be pulled Reason: BadRequest (400)
r
f
Can you list the local images and verify that it exists under the same name? What does
docker images
show?
q
yes so the same image exists locally:
Copy code
blog_scraper                  v1.0      40ae76b832e3   2 days ago     417MB
Then i've tried the following in my config: containers: - name: blog-scraper image: blog_scraper:v1.0
I get this error:
Failed to load logs: container "blog-scraper" in pod "blog-scraper-daily-manual-sjppz-prf8s" is waiting to start: image can't be pulled
i can do a docker run blog_scraper:v1.0 and that works fine so the docker image is okay and available... just not available from rancher kube 😕... but if i did upload it to dockerhub then it would work... its just i want it to work locally...
feels like i may need my own registry perhaps
f
Note that the YAML above lists
blog_scraper:latest
and not
blog_scraper:v1.0
.
q
yes sorry i have changed yaml and tried again
Just to understand this better - it should work like this without needing anything extra right?
In which case its just an environmental issue for me - as long as i dont need anything extra - that validation will help
f
Yes, it should work just like that.
👍 1
The only potential issue is that once you are using more than 85% of the data volume, kubelet will start garbage collection and delete images that are not currently used by a pod.
So you need to keep pruning dangling images (and build cache, if you are building locally), otherwise newly built images may get deleted before your pods have started.
q
okay great thanks - will give that a go