Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to find a Stack API version #4966

Closed
2 tasks done
ianplunkett opened this issue Oct 3, 2020 · 28 comments
Closed
2 tasks done

failed to find a Stack API version #4966

ianplunkett opened this issue Oct 3, 2020 · 28 comments

Comments

@ianplunkett
Copy link

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID:889BBF74-61A5-4289-87C7-884C42457605/20201003055504

Expected behavior

Docker should deploy on Kubernetes per the example here - https://docs.docker.com/docker-for-mac/kubernetes/

Actual behavior

docker stack deploy --compose-file ./docker-compose.yml words
failed to find a Stack API version

Information

  • macOS Version: 10.15.6

Diagnostic logs

Docker for Mac: version...
Client: Docker Engine - Community
 Cloud integration  0.1.18
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 16:58:31 2020
 OS/Arch:           darwin/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
 Kubernetes:
  Version:          v1.18.8
  StackAPI:         Unknown

Steps to reproduce the behavior

  1. run docker stack deploy --compose-file ./docker-compose.yml words
  2. receive error message failed to find a Stack API version
@aipirvu
Copy link

aipirvu commented Oct 6, 2020

I have the same problem on Docker Desktop (for Windows). I managed to use the stack command after I have disabled "Deploy Docker Stack to Kubernetes by default" setting under "Kubernetes" category in the docker desktop's settings. I haven't yet tried to enabled it back and see if I still have the error, but it is worth trying.

@ianplunkett
Copy link
Author

@aipirvu I'm also able to deploy the stack if I don't have Kubernetes as the default stack. But that deploys the stack using swarm as the orchestrator not Kubernetes.

@aipirvu
Copy link

aipirvu commented Oct 7, 2020

@aipirvu I'm also able to deploy the stack if I don't have Kubernetes as the default stack. But that deploys the stack using swarm as the orchestrator not Kubernetes.

Indeed. This workaround is only valid if you don't necessarily need to use Kubernetes as the orchestrator.

@lutogin
Copy link

lutogin commented Oct 7, 2020

I have the same problem, have not found solution?

@TimMensch
Copy link

TimMensch commented Oct 13, 2020

Same issue on Windows.

So far I've found that Compose on Kubernetes seems to be missing:

$ kubectl api-versions|grep compose
# no results

So somehow it's not being auto-installed?

Tried uninstalling (unchecking the checkbox) Kubernetes, and then re-installing. No good.

Tried running the compose on kubernetes installer. Now I'm seeing:

$ kubectl api-versions|grep compose
# nothing

$ kubectl get pods -n docker
NAME                           READY   STATUS             RESTARTS   AGE
compose-76678757f-lxtx5        1/1     Running            0          69s
compose-api-69d6cb9cd8-lnp4n   0/1     CrashLoopBackOff   3          69s

AND I'm noting that the latest alpha version in the installer on the compose-on-kubernetes page adds this relevant comment:

Added Kubernetes 1.16 support.

Considering that we're now on 1.18, and it's crashing, there may be a hint there.

Though, in the crash log for the compose-api run above, I'm seeing:

Error: --etcd-servers must be specified

... plus usage information for:

/go/src/github.com/docker/compose-on-kubernetes/cmd/api-server/main.go

So...something is just broken right now maybe?

Would be nice to see a comment from a Docker dev. Hint hint.

@mpoonuru
Copy link

I do have the same issue.

@digitaltechconsulting
Copy link

digitaltechconsulting commented Oct 20, 2020

I do have the same issue with docker stack deploy command but on windows.

OS: Windows 10 Pro

$ docker version
Client: Docker Engine - Community
 Cloud integration  0.1.18
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:00:27 2020
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
 Kubernetes:
  Version:          v1.18.8
  StackAPI:         Unknown

@ketanhdoshi
Copy link

Same problem, on Windows 10 Pro. Please help.

docker version
Client: Docker Engine - Community
Cloud integration 0.1.18
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:00:27 2020
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.13
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:07:04 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.3.7
GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683

@aleksod
Copy link

aleksod commented Oct 30, 2020

Same problem on Windows 10, version 1909, build 18363.1139:

$ docker version
Client: Docker Engine - Community
Cloud integration 0.1.18
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:00:27 2020
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.13
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:07:04 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.3.7
GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
Kubernetes:
Version: v1.18.8
StackAPI: Unknown

As a result, docker stack commands do not work:

$ docker stack ls
failed to find a Stack API version

@sedovserge
Copy link

same issue on win 10

@cclauss
Copy link

cclauss commented Nov 20, 2020

These capabilities are not nearly as out-of-the-box as https://docs.docker.com/docker-for-mac/kubernetes would make you believe. I needed to brew install etcd helm kubernetes-cli and then install compose-on-kubernetes as described at https://github.com/docker/compose-on-kubernetes#install-compose-on-kubernetes-on-docker-desktop before I could get beyond the failed to find a Stack API version error. The docker stack commands are now working on my Mac.

Update: Upon rebooting my Mac, this all failed again and now the docker stack commands always fail.

% kubectl config use-context docker-desktop
Switched to context "docker-desktop".

% docker version
[ ... ]
  StackAPI:         Unknown

@spmsupun
Copy link

Same on Ubuntu

@cecilemuller
Copy link

So if I understand correctly, Docker Desktop provides a Kubernetes cluster, but doesn't ship with "Compose on Kubernetes" that Stack requires, hence this error.

Then why is there an option to make the cluster the default orchestrator if it doesn't ship with the necessary software that allows it to be? Perhaps they assumed people use a kubeconfig instead of a Compose config ? I suspect people using a kubeconfig would use the Kubernetes CLI directly, not Stack (but I might be wrong on that).

I think the option should at least mention that additional software needs to be installed if one wants to use a Compose config with Stack, to avoid confusion.

@cclauss
Copy link

cclauss commented Nov 22, 2020

Correct. docker/docs#11773 is a request that the official docs be updated.

@dchien234
Copy link

Same problem. Happened on macOS 10.15.7.

@cclauss
Copy link

cclauss commented Dec 3, 2020

Opened an issue in Docker Community but no solutions so far... https://forums.docker.com/t/docker-stack-ls-does-not-work-failed-to-find-a-stack-api-version/101206

@cclauss
Copy link

cclauss commented Jan 15, 2021

Are there any Docker contributors that would be willing to mentor me thru opening a PR to fix this issue?
There have been several Docker releases that have not fixed this issue.

@cclauss
Copy link

cclauss commented Mar 11, 2021

@nebuk89 Can you please review this issue?

@mxie1563
Copy link

mxie1563 commented Mar 12, 2021

These capabilities are not nearly as out-of-the-box as https://docs.docker.com/docker-for-mac/kubernetes would make you believe. I needed to brew install etcd helm kubernetes-cli and then install compose-on-kubernetes as described at https://github.com/docker/compose-on-kubernetes#install-compose-on-kubernetes-on-docker-desktop before I could get beyond the failed to find a Stack API version error. The docker stack commands are now working on my Mac.

Update: Upon rebooting my Mac, this all failed again and now the docker stack commands always fail.

% kubectl config use-context docker-desktop
Switched to context "docker-desktop".

% docker version
[ ... ]
  StackAPI:         Unknown

Yes, this solved my issue on MacOS.

To install helm:

% brew install helm
To create the namespace
% kubectl create namespace compose
To add the repo
% helm repo add stable https://charts.helm.sh/stable
To install etcd-operator
% helm install etcd-operator stable/etcd-operator --namespace compose
Create etcd yaml file

 % vi compose-etcd.yaml 
apiVersion: "etcd.database.coreos.com/v1beta2"
kind: "EtcdCluster"
metadata:
  name: "compose-etcd"
  namespace: "compose"
spec:
  size: 3
  version: "3.3.15"
  pod:
    affinity:
      podAntiAffinity:
        preferredDuringSchedulingIgnoredDuringExecution:
        - weight: 100
          podAffinityTerm:
            labelSelector:
              matchExpressions:
              - key: etcd_cluster
                operator: In
                values:
                - compose-etcd
            topologyKey: kubernetes.io/hostname`

Run kubectl apply -f compose-etcd.yaml
Download the Compose on Kubernetes installer.
Run it: installer-darwin -namespace=compose -etcd-servers=http://compose-etcd-client:2379
Check: kubectl api-versions | grep compose

compose.docker.com/v1alpha3
compose.docker.com/v1beta1
compose.docker.com/v1beta2

@Aspie96
Copy link

Aspie96 commented Mar 14, 2021

I am trying to deploy on Kubernetes.
I have the same problem and now https://github.com/docker/compose-on-kubernetes is archived and no longer mantained.
This is not well documented at all. From the documentation one would think that this would work out of the box

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@aleksod
Copy link

aleksod commented Jun 14, 2021

/remove-lifecycle stale

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@aleksod
Copy link

aleksod commented Sep 13, 2021

/remove-lifecycle stale

@younthu
Copy link

younthu commented Sep 16, 2021

/remove-lifecycle stale

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@aleksod
Copy link

aleksod commented Dec 15, 2021 via email

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests