Azure / draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
https://draft.sh
MIT License
3.92k stars 395 forks source link

Draft + Minikube (vm-driver=none) - cant connect to internal registry #542

Closed stephenpope closed 6 years ago

stephenpope commented 6 years ago

Hi all,

Loving the idea of draft but having trouble on the final part when building the dockerfile and pulling its dependant images into the internal registry.

From reading the docs it seems that all I should need to do is enable ingress and enable registry but maybe im missing something else.

Platform : Ubuntu 17.10 Minikube: 0.25 Helm: 2.8.1 Draft : 0.10.1

export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
export MINIKUBE_HOME=$HOME
export CHANGE_MINIKUBE_NONE_USER=true
mkdir $HOME/.kube || true
touch $HOME/.kube/config

export KUBECONFIG=$HOME/.kube/config
sudo -E ./minikube start --vm-driver=none
sudo -E ./minikube addons enable ingress
sudo -E ./minikube addons enable registry

curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
chmod +x get_helm.sh
./get_helm.sh
helm init

wget https://azuredraft.blob.core.windows.net/draft/draft-v0.10.1-linux-amd64.tar.gz
tar -xvzf draft-v0.10.1-linux-amd64.tar.gz
sudo mv linux-amd64/draft /usr/local/bin/
draft init --auto-accept
draft create
draft up

<ERROR>

draft logs

time="2018-02-16T16:41:50Z" level=info msg="server is now listening at 0.0.0.0:44135 (tls=false)"
Step 1/15 : FROM microsoft/dotnet-nightly:2.1-sdk AS builder
buildApp: buildImg error: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

My Dockerfile looks like this (its making a simple app made with dotnet new web --name Example

FROM microsoft/dotnet-nightly:2.1-sdk AS builder                                                         
WORKDIR /app                                                                                             

# caches restore result by copying csproj file separately                                                
COPY *.csproj .                                                                                          
COPY nuget.config .                                                                                      
RUN dotnet restore                                                                                       

COPY . .                                                                                                 
RUN dotnet publish --output /app/ --configuration Release                                                
RUN sed -n 's:.*<AssemblyName>\(.*\)</AssemblyName>.*:\1:p' *.csproj > __assemblyname                    
RUN if [ ! -s __assemblyname ]; then filename=$(ls *.csproj); echo ${filename%.*} > __assemblyname; fi   

# Stage 2                                                                                                                                                                          
FROM microsoft/dotnet-nightly:2.1-runtime                                                                
WORKDIR /app                                                                                             
COPY --from=builder /app .                                                                               

ENV PORT 80                                                                                              
EXPOSE 80                                                                                                

ENTRYPOINT dotnet $(cat /app/__assemblyname).dll

Other info:

./minikube service list
|-------------|----------------------|----------------------------|
|  NAMESPACE  |         NAME         |            URL             |
|-------------|----------------------|----------------------------|
| default     | hello-minikube       | http://10.111.111.51:32598 |
| default     | kubernetes           | No node port               |
| kube-system | default-http-backend | http://10.111.111.51:30001 |
| kube-system | draftd               | No node port               |
| kube-system | kube-dns             | No node port               |
| kube-system | kubernetes-dashboard | http://10.111.111.51:30000 |
| kube-system | registry             | No node port               |
| kube-system | tiller-deploy        | No node port               |
|-------------|----------------------|----------------------------|
stephenpope commented 6 years ago

Issue was with DNS in Ubuntu. Fixed.