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

Demo master does not work on v0.14.1 mac deployment #714

Closed pranasblk closed 6 years ago

pranasblk commented 6 years ago
$ draft version
&version.Version{SemVer:"v0.14.1", GitCommit:"fdc29c553a45600ac4f795f3485d4bb9a80c7862", GitTreeState:"clean"}

Imin:example-python pranas$ draft create
--> Draft detected Python (97.267760%)
--> Ready to sail
Imin:example-python pranas$ cat draft.toml
[environments]
  [environments.development]
    name = "example-python"
    namespace = "default"
    wait = true
    watch = false
    watch-delay = 2
    auto-connect = false
    dockerfile = ""
    chart = ""
Imin:example-python pranas$
Imin:example-python pranas$ draft up
WARNING: no registry has been set, therefore Draft will not push to a container registry. This can be fixed by running `draft config set registry docker.io/myusername`
Hint: this warning can be disabled by running `draft config set disable-push-warning 1`
Draft Up Started: 'example-python': 01CCAP4ECBCSZ7Z9S4VVDW51AX
example-python: Building Docker Image: SUCCESS ⚓  (1.0010s)
example-python: Releasing Application: FAIL ❌  (0.0330s)
Inspect the logs with `draft logs 01CCAP4ECBCSZ7Z9S4VVDW51AX`
Imin:example-python pranas$ draft logs 01CCAP4ECBCSZ7Z9S4VVDW51AX
Step 1/5 : FROM python:onbuild
# Executing 3 build triggers
 ---> Using cache
 ---> Using cache
 ---> Using cache
 ---> a105a5bda477
Step 2/5 : ENV PORT 8080
 ---> Using cache
 ---> 21bf9325206f
Step 3/5 : EXPOSE 8080
 ---> Using cache
 ---> e663a9e8da21
Step 4/5 : ENTRYPOINT ["python"]
 ---> Using cache
 ---> ab14fffb6c64
Step 5/5 : CMD ["app.py"]
 ---> Using cache
 ---> 32d61840e43d
Successfully built 32d61840e43d
Successfully tagged example-python:03d92c8b067c19d3a18267d0eba29a117ce4ead1
2018/04/30 17:09:09 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-python%2COWNER%3DTILLER%2CSTATUS%3DDEPLOYED: dial tcp 127.0.0.1:8080: connect: connection refused

Note: my IPv4 8080 port is not taken by any other server process

squillace commented 6 years ago

And are you working against minikube, or docker for Mac, or a cloud cluster?

pranasblk commented 6 years ago

minikube as per installation instructions.

On Mon, Apr 30, 2018 at 7:17 PM, Ralph Squillace notifications@github.com wrote:

And are you working against minikube, or docker for Mac, or a cloud cluster?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Azure/draft/issues/714#issuecomment-385348118, or mute the thread https://github.com/notifications/unsubscribe-auth/ADicciaVgQlV86tLTXuwkny0-sxDzBjOks5ttta-gaJpZM4TsMzc .

radu-matei commented 6 years ago

Does everything else work as intended with Minikube? Are you able to create deployments with kubectl?

bacongobbler commented 6 years ago

Try helm init --service-account default when bootstrapping helm onto your cluster. It's a known issue in 2.9.0.

pranasblk commented 6 years ago

Tried suggested approaches:

Imin:example-python pranas$  eval $(minikube docker-env)
Imin:example-python pranas$ draft up
WARNING: no registry has been set, therefore Draft will not push to a container registry. This can be fixed by running `draft config set registry docker.io/myusername`
Hint: this warning can be disabled by running `draft config set disable-push-warning 1`
Draft Up Started: 'example-python': 01CCCVSE4D2QEH347C4GSWAB9Z
example-python: Building Docker Image: SUCCESS ⚓  (1.0012s)
example-python: Releasing Application: FAIL ❌  (30.0548s)
Inspect the logs with `draft logs 01CCCVSE4D2QEH347C4GSWAB9Z`
Imin:example-python pranas$ draft logs 01CCCVSE4D2QEH347C4GSWAB9Z
Step 1/5 : FROM python:onbuild
# Executing 3 build triggers
 ---> Using cache
 ---> Using cache
 ---> Using cache
 ---> a105a5bda477
Step 2/5 : ENV PORT 8080
 ---> Using cache
 ---> 21bf9325206f
Step 3/5 : EXPOSE 8080
 ---> Using cache
 ---> e663a9e8da21
Step 4/5 : ENTRYPOINT ["python"]
 ---> Using cache
 ---> ab14fffb6c64
Step 5/5 : CMD ["app.py"]
 ---> Using cache
 ---> 32d61840e43d
Successfully built 32d61840e43d
Successfully tagged example-python:03d92c8b067c19d3a18267d0eba29a117ce4ead1
2018/05/01 13:26:59 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-python%2COWNER%3DTILLER%2CSTATUS%3DDEPLOYED: dial tcp 127.0.0.1:8080: connect: connection refused
Imin:example-python pranas$ kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080
deployment.apps "hello-minikube" created
Imin:example-python pranas$  kubectl expose deployment hello-minikube --type=NodePort
service "hello-minikube" exposed
Imin:example-python pranas$ kubectl get pod
NAME                             READY     STATUS              RESTARTS   AGE
hello-minikube-6c47c66d8-9bnlx   0/1       ContainerCreating   0          1s
Imin:example-python pranas$ kubectl get pod
NAME                             READY     STATUS              RESTARTS   AGE
hello-minikube-6c47c66d8-9bnlx   0/1       ContainerCreating   0          7s
Imin:example-python pranas$ kubectl get pod
NAME                             READY     STATUS    RESTARTS   AGE
hello-minikube-6c47c66d8-9bnlx   1/1       Running   0          15s
Imin:example-python pranas$ kubectl get pod
NAME                             READY     STATUS    RESTARTS   AGE
hello-minikube-6c47c66d8-9bnlx   1/1       Running   0          16s
Imin:example-python pranas$ curl $(minikube service hello-minikube --url)
CLIENT VALUES:
client_address=172.17.0.1
command=GET
real path=/
query=nil
request_version=1.1
request_uri=http://192.168.99.100:8080/

SERVER VALUES:
server_version=nginx: 1.10.0 - lua: 10001

HEADERS RECEIVED:
accept=*/*
host=192.168.99.100:30763
user-agent=curl/7.58.0
BODY:
-no body in request-Imin:example-python pranas$ kubectl delete services hello-minikube
service "hello-minikube" deleted
Imin:example-python pranas$ kubectl delete deployment hello-minikube
deployment.extensions "hello-minikube" deleted
Imin:example-python pranas$ minikube stop
Stopping local Kubernetes cluster...
Machine stopped.
Imin:example-python pranas$ 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.
Imin:example-python pranas$ kubectl get pod
No resources found.
Imin:example-python pranas$ helm init --service-account default
$HELM_HOME has been configured at /Users/pranas/.helm.
Warning: Tiller is already installed in the cluster.
(Use --client-only to suppress this message, or --upgrade to upgrade Tiller to the current version.)
Happy Helming!
Imin:example-python pranas$ ls
Dockerfile      app.py          charts          draft.toml      requirements.txt
Imin:example-python pranas$ rm -rf Dockerfile charts/ draft.toml
Imin:example-python pranas$ draft init
Installing default plugins...
Installation of default plugins complete
Installing default pack repositories...
Installation of default pack repositories complete
$DRAFT_HOME has been configured at /Users/pranas/.draft.
Happy Sailing!
Imin:example-python pranas$ draft up
Error: failed loading build context with env "development": failed to unmarshal draft.toml from "/Users/pranas/tmp/draft/examples/example-python": open /Users/pranas/tmp/draft/examples/example-python/draft.toml: no such file or directory
Imin:example-python pranas$ eval $(minikube docker-env)
Imin:example-python pranas$ draft create
--> Draft detected Python (74.789916%)
--> Ready to sail
Imin:example-python pranas$ draft up
WARNING: no registry has been set, therefore Draft will not push to a container registry. This can be fixed by running `draft config set registry docker.io/myusername`
Hint: this warning can be disabled by running `draft config set disable-push-warning 1`
Draft Up Started: 'example-python': 01CCCW3X3X1C7KK8R6Z2HSSPY2
example-python: Building Docker Image: SUCCESS ⚓  (1.0047s)
example-python: Releasing Application: FAIL ❌  (0.0689s)
Inspect the logs with `draft logs 01CCCW3X3X1C7KK8R6Z2HSSPY2`
Imin:example-python pranas$ draft logs 01CCCW3X3X1C7KK8R6Z2HSSPY2
Step 1/5 : FROM python:onbuild
# Executing 3 build triggers
 ---> Using cache
 ---> Using cache
 ---> Using cache
 ---> a105a5bda477
Step 2/5 : ENV PORT 8080
 ---> Using cache
 ---> 21bf9325206f
Step 3/5 : EXPOSE 8080
 ---> Using cache
 ---> e663a9e8da21
Step 4/5 : ENTRYPOINT ["python"]
 ---> Using cache
 ---> ab14fffb6c64
Step 5/5 : CMD ["app.py"]
 ---> Using cache
 ---> 32d61840e43d
Successfully built 32d61840e43d
Successfully tagged example-python:b66deff7ab6a5ef78f6b75866c3de348b8e4b7e8
2018/05/01 13:32:12 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-python%2COWNER%3DTILLER%2CSTATUS%3DDEPLOYED: dial tcp 127.0.0.1:8080: connect: connection refused

Maybe you have issues supporting Anaconda with Python 3.6?

$ conda info

     active environment : None
       user config file : /Users/pranas/.condarc
 populated config files : /Users/pranas/.condarc
          conda version : 4.5.1
    conda-build version : 3.4.1
         python version : 3.6.4.final.0
       base environment : /Users/pranas/anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/intel/osx-64
                          https://conda.anaconda.org/intel/noarch
                          https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/free/osx-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/osx-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/osx-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /Users/pranas/anaconda3/pkgs
                          /Users/pranas/.conda/pkgs
       envs directories : /Users/pranas/anaconda3/envs
                          /Users/pranas/.conda/envs
               platform : osx-64
             user-agent : conda/4.5.1 requests/2.18.4 CPython/3.6.4 Darwin/17.5.0 OSX/10.13.4
                UID:GID : 1026:20
             netrc file : None
           offline mode : False

and new version of Docker

Docker 18.03.1-ce-mac65 is currently the newest version available.

$ minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100

Kubernetes v1.10.0

pranasblk commented 6 years ago

Looks like my minikube deployment issue ... thanks for the tips.

Arm1stice commented 6 years ago

@pranasblk Can you clarify what type of deployment issue? I am getting this as well

Arm1stice commented 6 years ago

@pranasblk Nevermind, I got it. Had to delete minikube cluster and recreate it before installing Helm the way that @bacongobbler suggested.

bacongobbler commented 6 years ago

Sounds like we can go ahead and close this issue now that we have workarounds for Helm 2.9.0. Helm 2.9.1 will address this issue, so it's just a short-lived issue that we'll eventually fix by the end of the week. Closing! :)

disha94 commented 6 years ago

Facing the same issue, even after upgrading helm to 2.9.1. I tried with both minikube and Kubernetes cluster, but getting the same error. Any fix for the same?