Skip to content
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

ImagePullPolicy is always set to Never #6133

Closed
realtimetodie opened this issue Jun 4, 2023 · 2 comments · Fixed by #6277
Closed

ImagePullPolicy is always set to Never #6133

realtimetodie opened this issue Jun 4, 2023 · 2 comments · Fixed by #6277
Labels
bug Something isn't working

Comments

@realtimetodie
Copy link

Expected Behavior

The ImagePullPolicy should never be set to Never

Current Behavior

The ImagePullPolicy is always set to Never

Steps to Reproduce

When using minikube with the registry addon enabled, the ImagePullPolicy is always set to Never when using custom builds with Bazel remote execution, where the image is pushed to the minikube registry without docker using rules_oci.

if r.dkc.WillBuildToKubeContext(k8s.KubeContext(r.k8sClient.APIConfig().CurrentContext)) {
policy = v1.PullNever
}

Tiltfile

custom_build(
    ...
    skips_local_docker=True,

Error

Error: ErrImageNeverPull

Context

tilt doctor Output

$ tilt doctor
Tilt: v0.32.4, built 2023-05-24
System: linux-amd64
---
Docker (cluster)
- Host: tcp://192.168.49.2:2376
- Server Version: 23.0.2
- API Version: 1.42
- Builder: 2
---
Docker (local)
- Host: unix:///var/run/docker.sock
- Server Version: 24.0.2
- Version: 1.43
- Builder: 2
- Compose Version: v2.18.1
---
Kubernetes
- Env: minikube
- Context: minikube
- Cluster Name: minikube
- Namespace: default
- Container Runtime: docker
- Version: v1.26.5
- Cluster Local Registry: none
---
Thanks for seeing the Tilt Doctor!
Please send the info above when filing bug reports. 💗

The info below helps us understand how you're using Tilt so we can improve,
but is not required to ask for help.
---
Analytics Settings
--> (These results reflect your personal opt in/out status and may be overridden by an `analytics_settings` call in your Tiltfile)
- User Mode: opt-in
- Machine: 347b8107501235dc490b664d4356fcb9
- Repo:
...
@nicks
Copy link
Member

nicks commented Jun 5, 2023

thanks for the report!

The way most people use Minikube with the Docker socket is that they build directly to the runtime, like this:
https://minikube.sigs.k8s.io/docs/commands/docker-env/
This is how Tilt's docker_build interacts with Minikube. In that case, most people want to set ImagePullPolicy: Never, to ensure you always get the locally built image.

In your case, you're NOT building to the runtime, you're using skips_local_docker to build to a registry. We probably need to thread that through the system, so that it knows you specifically configured your builder to build somewhere else.

Probably the simple workaround for you right now is to start minikube with --container-runtime=containerd, so that tilt knows you're not trying to build to the docker runtime.

@realtimetodie
Copy link
Author

Another workaround is to explicitly pull the image from the local registry using docker after running Bazel.

nicks added a commit to nicks/tilt that referenced this issue Dec 8, 2023
i verified this works correctly on all modern container engines,
no reason to use Never anymore.

Fixes tilt-dev#6133

Signed-off-by: Nick Santos <[email protected]>
nicks added a commit to nicks/tilt that referenced this issue Dec 8, 2023
i verified this works correctly on all modern container engines,
no reason to use Never anymore.

Fixes tilt-dev#6133

Signed-off-by: Nick Santos <[email protected]>
nicks added a commit to nicks/tilt that referenced this issue Dec 8, 2023
i verified this works correctly on all modern container engines,
no reason to use Never anymore.

Fixes tilt-dev#6133

Signed-off-by: Nick Santos <[email protected]>
nicks added a commit that referenced this issue Dec 8, 2023
i verified this works correctly on all modern container engines,
no reason to use Never anymore.

Fixes #6133

Signed-off-by: Nick Santos <[email protected]>
nicks added a commit to nicks/tilt that referenced this issue Dec 8, 2023
i verified this works correctly on all modern container engines,
no reason to use Never anymore.

Fixes tilt-dev#6133

Signed-off-by: Nick Santos <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants