Azure / aks-devx-tools

Create deployment files and configure GitHub Actions workflows to deploy applications to Azure Kubernetes Service (AKS).
MIT License
17 stars 17 forks source link

Failed to list namespaces: Error: connect ECONNREFUSED 127.0.0.1:6443 #83

Open lgmorand opened 1 year ago

lgmorand commented 1 year ago

Does this occur consistently? Yes Repro steps:

  1. Create a dummy project and use Draft to create the Dockerfile
  2. Use the command "AKS create deployment and service
  3. Specify the output folder, the name of the deployment and the exposed pod
  4. Boom error

from source code, it seems it wants to connect to some cluster. What if I can't access it from my dev machine ? What if I don't want to specify a namespace right now and just want to generate manifests ?

Action: aks-draft-extension.runDraftDeployment Error type: Error Error Message: Failed to list namespaces: Error: connect ECONNREFUSED redacted:id

Version: 0.1.1 OS: win32 OS Release: 10.0.22621 Product: Visual Studio Code Product Version: 1.75.1 Language: en

Call Stack ``` getAysncResult extension.js:2:4425587 extension.js:2:4404175extension.js:2:4404175 ```
sabbour commented 1 year ago

Thanks for reporting this @lgmorand. At the moment, the extension tries to list the namespaces on your active cluster from your kubeconfig so that it includes that in the generated manifests. However, it shouldn't be strictly necessary. As an alternative, the extension can try to list and if it fails, it should prompt you to enter your desired namespace manually.

lgmorand commented 1 year ago

Hello Ahmed :)

Exactly what I thought, especially because the command is already there (new PromptNewNamespace()) and the algorythm is almost ready but it does not take into account the case when the cluster is unreachable

OliverMKing commented 1 year ago

Reopening. PR closed it but this isn't closed until we make a release.