Azure / draft-classic

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

Minimum K8s version? #926

Closed GavinOsborn closed 5 years ago

GavinOsborn commented 5 years ago

Hello,

Is there a minimum supported version of k8s for draft? I'm using k8s v1.8.1 on minikube (OSX/hyperkit).

When I draft up the container is built and the templates all appear to be successfully deployed but the process exits with an error.

$> 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: 'hello-world': 01D4RSMQE44FWASXAE77K2C21Q
hello-world: Building Docker Image: SUCCESS ⚓  (59.0166s)
hello-world: Releasing Application: FAIL ❌  (2.2553s)
Inspect the logs with `draft logs 01D4RSMQE44FWASXAE77K2C21Q`

The logs shows a successful build and then ends with a release error:

$> draft logs 01D4RSMQE44FWASXAE77K2C21Q
Step 1/9 : FROM node:8
8: Pulling from library/node
741437d97401: Pulling fs layer
34d8874714d7: Pulling fs layer
0a108aa26679: Pulling fs layer
7f0334c36886: Pulling fs layer
65c95cb8b3be: Pulling fs layer
a36b708560f8: Pulling fs layer
81a7e69fab67: Pulling fs layer
a88b577be604: Pulling fs layer
7f0334c36886: Waiting
65c95cb8b3be: Waiting
a36b708560f8: Waiting
81a7e69fab67: Waiting
a88b577be604: Waiting
0a108aa26679: Verifying Checksum
0a108aa26679: Download complete
34d8874714d7: Verifying Checksum
34d8874714d7: Download complete
7f0334c36886: Verifying Checksum
7f0334c36886: Download complete
741437d97401: Verifying Checksum
741437d97401: Download complete
a36b708560f8: Verifying Checksum
a36b708560f8: Download complete
a88b577be604: Verifying Checksum
a88b577be604: Download complete
741437d97401: Pull complete
81a7e69fab67: Verifying Checksum
34d8874714d7: Pull complete
0a108aa26679: Pull complete
7f0334c36886: Pull complete
65c95cb8b3be: Download complete
65c95cb8b3be: Pull complete
a36b708560f8: Pull complete
81a7e69fab67: Pull complete
a88b577be604: Pull complete
Digest: sha256:a8a9d8eaab36bbd188612375a54fb7f57418458812dabd50769ddd3598bc24fc
Status: Downloaded newer image for node:8
 ---> 4f01e5319662
Step 2/9 : ENV PORT 8125
 ---> Running in 1a31d0849170
 ---> a3bc5f336676
Step 3/9 : EXPOSE 8125
 ---> Running in 66f8d408a16b
 ---> 5bd9e922328f
Step 4/9 : RUN mkdir -p /usr/src/app
 ---> Running in ef73cdcce118
 ---> b1944b8cd7a8
Step 5/9 : WORKDIR /usr/src/app
 ---> Running in 582b1ec07c79
 ---> 44c05619e1a2
Step 6/9 : COPY package.json .
 ---> 978ae6064213
Step 7/9 : RUN npm install
 ---> Running in fbd8486d84d5
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN hello-world@1.0.0 No description
npm WARN hello-world@1.0.0 No repository field.

up to date in 1.316s
found 0 vulnerabilities

 ---> d06b6d12b362
Step 8/9 : COPY index.js .
 ---> 7993756829b1
Step 9/9 : CMD ["node", "index"]
 ---> Running in afd12239647b
 ---> bd5ef43671bb
Successfully built bd5ef43671bb
Successfully tagged hello-world:b19615fa9ddb3a035172bd71834a2e7c53ff40a8
2019/02/28 11:57:35 error while releasing: could not install release: rpc error: code = Unknown desc = release hello-world failed: the server could not find the requested resource

A quick kubectl get all shows everything deployed as expected:

$> kubectl get all
NAME                             DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/hello-world-hello-world   1         1         1            1           6m

NAME                                    DESIRED   CURRENT   READY     AGE
rs/hello-world-hello-world-7d8757597b   1         1         1         6m

NAME                             DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/hello-world-hello-world   1         1         1            1           6m

NAME                                    DESIRED   CURRENT   READY     AGE
rs/hello-world-hello-world-7d8757597b   1         1         1         6m

NAME                                          READY     STATUS    RESTARTS   AGE
po/hello-world-hello-world-7d8757597b-rkcjj   1/1       Running   0          6m

NAME                          TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
svc/hello-world-hello-world   ClusterIP   10.106.171.10   <none>        8080/TCP   6m
svc/kubernetes                ClusterIP   10.96.0.1       <none>        443/TCP    8m

I did a quick check for direct helm support:

$> draft delete
app 'hello-world' deleted
$> helm install charts/hello-world/
NAME:   elevated-rattlesnake
LAST DEPLOYED: Thu Feb 28 12:12:32 2019
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/Service
NAME                              TYPE       CLUSTER-IP     EXTERNAL-IP  PORT(S)   AGE
elevated-rattlesnake-hello-world  ClusterIP  10.98.158.150  <none>       8080/TCP  0s

==> v1beta1/Deployment
NAME                              DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
elevated-rattlesnake-hello-world  1        0        0           0          0s

==> v1/Pod(related)
NAME                                               READY  STATUS   RESTARTS  AGE
elevated-rattlesnake-hello-world-6f865bb89c-6ghvw  0/1    Pending  0         0s

NOTES:

  http://elevated-rattlesnake. to access your application

This installed fine so I don't think there's an issue with helm.

More information about my environment:

$> kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.1", GitCommit:"f38e43b221d08850172a9a4ea785a86a3ffa3b3a", GitTreeState:"clean", BuildDate:"2017-10-12T00:44:37Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.1", GitCommit:"f38e43b221d08850172a9a4ea785a86a3ffa3b3a", GitTreeState:"clean", BuildDate:"2017-10-11T23:16:41Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
$> 
$> minikube version
minikube version: v0.34.1
$> helm version
Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
$> draft version
&version.Version{SemVer:"v0.16.0", GitCommit:"5433afea1421810ae9d828631d8651de913b347a", GitTreeState:"dirty"}
GavinOsborn commented 5 years ago

I forgot to mention that the same steps worked fine when I re-created my minikube vm with k8s v1.12.0

GavinOsborn commented 5 years ago

I thought I'd dig further. k8s 1.8.1 -> 1.8.15 all fail with the same error. k8s 1.9.0 works fine.

squillace commented 5 years ago

Hi @GavinOsborn, what helm version do you have? helm version

GavinOsborn commented 5 years ago

As mentioned above:

$> helm version
Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
bacongobbler commented 5 years ago

At this point I don't believe we have made any compatibility guarantees for what versions Draft will work against. Given that the project is still in its infancy stages, I'd recommend the latest version of Helm and Kubernetes when playing with Draft.

Nice to see that you got it working on a 1.9 cluster! I think 1.9 was the release when Kubernetes introduced the apps/v1 GroupKind, which as I recall is what the default Draft packs bootstrap your charts with. That would explain why it won't work on anything earlier than 1.9; that GroupKind didn't exist yet.

GavinOsborn commented 5 years ago

Thanks, and understood. We are due an upgrade soon anyhow so I'm not overly concerned.

bacongobbler commented 5 years ago

Closing this as I believe that answers your question, but please feel free to reopen if that didn't answer your question. Thanks!