-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
containerd config is overwritten on minikube restart #180
Comments
I found this by cat'ing the containerd config after repeated problems from linux users of our local dev environment. It will be working and then we'll start getting ImagePullBackoff errors from Kubernetes. Usually this occurs after a reboot or cluster stop and start, but I've had it happen seemingly out of the blue as well. Using this command to cat
After
Here are my environment details: |
to be clear - users are running This might not be something we can possibly fix. Once the cluster is set up, no ctlptl code is running, and if you run a command that borks your cluster, there's not much we can do about that.... We might have to file a bug upstream with minikube? i don't what sorts of guarantees |
Good point, it may be worth switching them to using For now I have them using part of the old Tilt minikube-local script to re-patch the config: #!/bin/bash
reg_host="ctlptl-registry"
reg_port="5002"
# Below code is lifted from https://github.com/tilt-dev/minikube-local
# patch the container runtime
# this is the most annoying sed expression i've ever had to write
minikube ssh sudo sed "\-i" "s,\\\[plugins.cri.registry.mirrors\\\],[plugins.cri.registry.mirrors]\\\n\ \ \ \ \ \ \ \ [plugins.cri.registry.mirrors.\\\"localhost:${reg_port}\\\"]\\\n\ \ \ \ \ \ \ \ \ \ endpoint\ =\ [\\\"http://${reg_host}:5000\\\"]," /etc/containerd/config.toml
# restart the container runtime
minikube ssh sudo systemctl restart containerd
``` |
Was thinking about it over the weekend, and one option is simply to stop using registry mirroring. Mirroring makes it so that the image has the same URL both inside and outside the cluster. (e.g., But you don't need it. Without mirroring, you push your image to Tilt supports this mode and will do the URL correction automatically. Most clusters support mirroring because this can look very alarming/confusing to users. But it will work OK. |
I'm not sure if this is what you were suggesting, but I've tried adding the following and it seems to have no effect in correcting the ability of the minikube cluster to reach the ctlptl-registry: default_registry(
"localhost:5002",
host_from_cluster="ctlptl-registry:5000",
) I've testing localhost:5002 as working locally, and ctlptl-registry:5000 as working via |
it's hard to say from here why you couldn't get it to work, but i would expect tilt to ignore |
I found this SO which may be relevant to this issue- setting the mirror on |
nah, minikube's start CRI registry mirrors are very different, they're really more like "alternate hosts" |
Fixes #180 This changes the local-registry-hosting config so that, instead of pushing and pulling from the same URL (localhost:5000), we'll push to localhost:5000 and pull from [registry-name]:5000. To maximize compatibility, we'll still add the registry mirroring to the containerd.toml. But because minikube doesn't do a good job preserving the toml across stop/start, the local-registry-hosting config will tell tilt not to use this feature.
Fixes #180 This changes the local-registry-hosting config so that, instead of pushing and pulling from the same URL (localhost:5000), we'll push to localhost:5000 and pull from [registry-name]:5000. To maximize compatibility, we'll still add the registry mirroring to the containerd.toml. But because minikube doesn't do a good job preserving the toml across stop/start, the local-registry-hosting config will tell tilt not to use this feature.
ctlptl is possibly doing something unsupported to configure the
containerd
config, which minikube overrides on restart.Reported on Slack: https://kubernetes.slack.com/archives/CESBL84MV/p1642175814004400
I'm having an issue with minikube wiping out the config patch that ctlptl applies to connect to the registry after stopping and starting the cluster. Here is what my /etc/containerd/config.toml looks like after restarting minikube:
The text was updated successfully, but these errors were encountered: