Azure / draft-classic

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

Getting Started with Minikube:`draft up` fails on release #723

Closed matthewrudy closed 6 years ago

matthewrudy commented 6 years ago

So I've been trying to get the getting_started guide working. https://github.com/Azure/draft/blob/master/docs/getting-started.md

But I end up hitting an error when running draft up

error while releasing: could not upgrade release: rpc error: code = Unknown desc = Get http://localhost:8080/api/v1/namespaces/kube-system/configmaps?labelSelector=NAME%3Dexample-go%2COWNER%3DTILLER%2CSTATUS%3DDEPLOYED: dial tcp 127.0.0.1:8080: connect: connection refused

Steps to reproduce:

I have draft 0.14.1

➜  draft git:(master) ✗ draft version
&version.Version{SemVer:"v0.14.1", GitCommit:"fdc29c553a45600ac4f795f3485d4bb9a80c7862", GitTreeState:"clean"}

I'm running minikube

➜  draft git:(master) ✗ minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.
➜  draft git:(master) ✗ kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443
KubeDNS is running at https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

I've configured docker to use the minikube docker

➜  draft git:(master) ✗ eval $(minikube docker-env)
➜  draft git:(master) ✗ docker ps
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS               NAMES
4e0644d38501        e94d2f21bc0c                 "/dashboard --insecu…"   5 minutes ago       Up 5 minutes                            k8s_kubernetes-dashboard_kubernetes-dashboard-5498ccf677-5jj6b_kube-system_9ef77b7a-4f86-11e8-9345-080027061844_7
d5b3b5bb7e1b        4689081edb10                 "/storage-provisioner"   5 minutes ago       Up 5 minutes                            k8s_storage-provisioner_storage-provisioner_kube-system_9f1c4b4b-4f86-11e8-9345-080027061844_6
e11a1c1bdf9b        80cc5ea4b547                 "/kube-dns --domain=…"   6 minutes ago       Up 6 minutes                            k8s_kubedns_kube-dns-86f4d74b45-r4qm5_kube-system_9ced2a6a-4f86-11e8-9345-080027061844_4
...

I'm running kube 1.10.1

➜  draft git:(master) ✗ kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-13T22:27:55Z", GoVersion:"go1.9.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

Helm seems to be running

example-go git:(master) ✗ kubectl -n kube-system get deploy tiller-deploy --watch
NAME            DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
tiller-deploy   1         1         1            1           1h

Then I go into an example and configure it

➜  draft git:(master) ✗ cd examples/example-go
➜  example-go git:(master) ✗ draft create
--> Draft detected Go (100.000000%)
--> Ready to sail

Then try to run it

➜  example-go git:(master) ✗ draft up
Draft Up Started: 'example-go': 01CCNM9MFFP1GGX1T375XTGPZH
example-go: Building Docker Image: SUCCESS ⚓  (1.0003s)
example-go: Releasing Application: FAIL ❌  (0.0446s)
Inspect the logs with `draft logs 01CCNM9MFFP1GGX1T375XTGPZH`

it fails with the error

➜  example-go git:(master) ✗ draft logs 01CCNM9MFFP1GGX1T375XTGPZH
Step 1/3 : FROM golang:onbuild
# Executing 3 build triggers
 ---> Using cache
 ---> Using cache
 ---> Using cache
 ---> 6bdb6554338c
Step 2/3 : ENV PORT 8080
 ---> Using cache
 ---> a25805afd08c
Step 3/3 : EXPOSE 8080
 ---> Using cache
 ---> 62a3127f934f
Successfully built 62a3127f934f
Successfully tagged example-go:0a670488b6ff4ad29ee2dd33f9bf33ff86e50882
2018/05/04 14:08:41 error while releasing: could not upgrade release: rpc error: code = Unknown desc = Get http://localhost:8080/api/v1/namespaces/kube-system/configmaps?labelSelector=NAME%3Dexample-go%2COWNER%3DTILLER%2CSTATUS%3DDEPLOYED: dial tcp 127.0.0.1:8080: connect: connection refused

I guess there's either a bug, or some step missing from the getting started guide.

Thanks for your help.

matthewrudy commented 6 years ago

Seems to be a duplicate of https://github.com/Azure/draft/issues/714 Apologies.

matthewrudy commented 6 years ago

resolved for me with the following

➜  example-go git:(master) ✗ minikube stop
Stopping local Kubernetes cluster...
minikube Machine stopped.

➜  example-go git:(master) ✗ minikube delete
Deleting local Kubernetes cluster...
Machine deleted.

➜  example-go git:(master) ✗ minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.

➜  example-go git:(master) ✗ kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443
KubeDNS is running at https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

➜  example-go git:(master) ✗ helm init --service-account default
$HELM_HOME has been configured at /Users/matthew/.helm.

Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.

Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.
For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
Happy Helming!

➜  example-go git:(master) ✗ helm version
\Client: &version.Version{SemVer:"v2.9.0", GitCommit:"f6025bb9ee7daf9fee0026541c90a6f557a3e0bc", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.9.0", GitCommit:"f6025bb9ee7daf9fee0026541c90a6f557a3e0bc", GitTreeState:"clean"}

➜  example-go git:(master) ✗ eval $(minikube docker-env)

➜  example-go git:(master) ✗ draft up
Draft Up Started: 'example-go': 01CCNN5S3TCG8Q5RNC0GAS4Y9M
example-go: Building Docker Image: SUCCESS ⚓  (52.0167s)
example-go: Releasing Application: SUCCESS ⚓  (2.4844s)
Inspect the logs with `draft logs 01CCNN5S3TCG8Q5RNC0GAS4Y9M`

➜  example-go git:(master) ✗ draft connect
Connect to go:8080 on localhost:51024
[go]: + exec app

Nice!