Tilt: Can't build images from private GCR repository

Created on 30 Jan 2019  路  10Comments  路  Source: tilt-dev/tilt

Very cool tool! I'm excited to get it working for the dev team at my company.

I was able to run the example from the tutorial but am running into an issue running tilt up with a Tiltfile that references my company's private image repository on GCR. Here's my Titlefile (with registry name details redacted):

# -*- mode: Python -*-

docker_build('us.gcr.io/company_repo/test_app:latest', '../../testing')
k8s_resource('tilt_testing', './production/test-deployment.yaml', port_forwards=3002)

And here's what happens when I run tilt up:

image

I've followed the instructions from the error message (https://cloud.google.com/container-registry/docs/advanced-authentication) and all of the configurations completed successfully, but they didn't help the issue. I have no issues pulling/pushing to that repository with other docker commands outside of Tilt.

Thanks in advance for your assistance!

All 10 comments

Sorry to hear you're having trouble.

Can you run kubectl config current-context and let us know the output to help us diagnose the problem?

I wonder if it's trying to build in-cluster, and the cluster you're using doesn't have permissions to pull the image.

Sure thing. Here's the log from starting minikube:

$ minikube start
Starting local Kubernetes v1.12.4 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Stopping extra container runtimes...
Machine exists, restarting cluster components...
Verifying kubelet health ...
Verifying apiserver health ....Kubectl is now configured to use the cluster.
Loading cached images from config file.

Everything looks great. Please enjoy minikube!

And here's the output you requested:

$ kubectl config current-context
minikube

Oh! That explains it. Minikube doesn't have access to your private GCR registry, because Minikube has its own Docker instance separate from your normal Docker instance. We need to surface this error better, explain what's going on, and give some pointers on how to fix this. let me research this a bit.

I think if you run minikube addons configure registry-creds and minikube addons enable registry-creds, that will fix the problem? Try that and see if it works for you? Will also add info on this to the error message + faq

more info here:
https://github.com/kubernetes/minikube/blob/703f76d35a42e4d2e966844f80c4497c19ddab2e/docs/insecure_registry.md#private-container-registries

nevermind, i've been playing around a bit with it. it's a little more complicated than enabling the registry creds, but i haven't quite put the pieces together yet.

Thanks for looking into it! I spent a little time trying to get the registry-creds addon to work but no luck. I could configure the addon with no errors, but minikube still couldn't talk to GCR.

Lemme know if there's anything I can do to help.

ok, I lied! this is totally a Tilt bug. We aren't juggling auth credentials quite right in this case. Fix on the way.

:tada: Thanks @nicks. When do you expect this change to get released?

@ryderstorm soon! i think @jazzdan is working on a release

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DblK picture DblK  路  5Comments

jazzdan picture jazzdan  路  4Comments

damoon picture damoon  路  3Comments

jazzdan picture jazzdan  路  3Comments

jazzdan picture jazzdan  路  3Comments