Closed pierredup closed 7 months ago
The k3s scheduler requires a registry, full stop. K3s uses containers, which doesn't have access to your local docker images, so attempting to deploy without a configured registry will fail.
Thanks for clarifying @josegonzalez
I was able to get it to work by setting the following options:
docker login ....
dokku registry:set --global server $server
dokku registry:set --global image-repo-template "$namespace/{{ .AppName }}"
dokku registry:set --global push-on-release true
This wasn't clear in the docs and took some time to figure out all the steps to get it working. I'll see if I can maybe create a PR to update the k3s docs with this information in the following weeks.
Edit: I actually just found this tutorial: https://dokku.com/tutorials/other/deploying-to-k3s/. Might just add a link to this tutorial from the docs page
Also on a separate note, is there a way to link external services when using k3s? Like MySQL or Postgres?
Currently mysql:create
creates a container on the local docker instance, which the k3s pod then don't have access to. Is there an alternative way to use the k3s scheduler when creating services through plugins?
The scheduler plugins do not start services on k3s, and I don't have any current plans to enable that sort of functionality (as you can imagine, things get much more complicated when making something highly available).
I recommend looking at the official helm charts/operators for the datastores you're looking at. Bitnami also has some decent helm charts that might be useful to look into.
Description of problem
Switching the scheduler to k3s, doesn't deploy the app due to the image not being available. The pod status is stuck in
ImagePullBackOff
.Steps to reproduce
sudo dokku scheduler-k3s:initialize
dokku scheduler:set --global selected k3s
(ordokku scheduler:set $APP_NAME selected k3s
git push
dokku report $APP_NAME
Additional information
I have initialized k3s using
sudo dokku scheduler-k3s:initialize
and setting it as the default scheduler. I'm only running a single node.When running
git push
, the deployment gets stuck at the stepDeployment is not ready: default/test-app-web. 0 out of 1 expected pods are ready
. Here is the output of thegit push
At this point, if I look at the pods on the node with
k3s kubectl get pods
, this is the output:And doing a describe on the app with
k3s kubectl describe pod test-app-web-788798479-l2rpq
shows that it's not able to pull the image:The image is available on the local docker instance (
docker images
:)but k3s is trying to pull the image from the
docker.io
registryOutput of failing commands after running: dokku trace:off
No response
Output of failing commands after running: dokku trace:on
No response