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

Kind cluster creation ended with error: Failed to create kind cluster. No active cluster #2795

Closed
odockal opened this issue Jun 9, 2023 · 10 comments
Assignees
Labels

Comments

@odockal
Copy link
Contributor

odockal commented Jun 9, 2023

Bug description

Kind cluster creation on Mac os 1.1.0 ended up with a "Cannot create kind cluster: No Active cluster". Cluster was eventually created on the filesystem. Can be verified by kind binary. But podman desktop did not detected it.

Screenshot_20230609_182650

No kind cluster present:
Screenshot_20230609_182901

Cli output:
Screenshot_20230609_183017

Operating system

macOS 13 (Intel)

Version

1.1.0

Steps to reproduce

Create rootfull podman machine, download a kind and try to create kind cluster.

Relevant log output

No response

Additional context

I have seen the issue multiple time. I recall it was something unstable. I failed to find an issue reported, so here it is.

@jeffmaury
Copy link
Contributor

Looks like a sync issue on the kubeconfig file

@odockal
Copy link
Contributor Author

odockal commented Jun 9, 2023

I am betting that the issue was with a "wrong" connection that was used by the podman. It was not root connection but the default one for given machine. Probably caused by #2582

@jeffmaury
Copy link
Contributor

No I was able to reproduce seems to happen when you have no kubeconfig before you create the Kind cluster

@odockal
Copy link
Contributor Author

odockal commented Jun 19, 2023

Nice catch! Should we overcome this error (since error is there, but follow up actions will create proper kubeconfig) or keep this as know issue/feature coming from kind/kube context client?

@jeffmaury jeffmaury changed the title Kind cluster creation ended with error: Failed to create kind cluster. No active cluster (MacOS) Kind cluster creation ended with error: Failed to create kind cluster. No active cluster Jun 20, 2023
@JurrianFahner
Copy link

JurrianFahner commented Jul 18, 2023

No I was able to reproduce seems to happen when you have no kubeconfig before you create the Kind cluster

What @jeffmaury wrote, is exactly also the case for me. Solution would be:

  1. automatic install of kubectl (in case there ~.kube\config file does not exist)
  2. documentation to ask the user to install kubectl, on installation the ~.kube\config file will be automatically created.

The issue can be reproduced by removing the kind cluster and the .kube folder from the user folder.

@Blaimi
Copy link

Blaimi commented Oct 19, 2023

this happens, when no ~/.kube/config-file exists when podman Desktop starts and the ingress controller shall be installed. If the file is missing, the kube-context-plugin somehow disables itself. There is also no context or "no context" lower left. The problem does not occur if at least an empty ~/.kube/context-file exists before starting podman Desktop.

The kind command works as it should: creates the cluster and sets up the context in ~/.kube/context. But kubernetes-client#createResources(…) cannot create the resources for contour because the kube-context-plugin has already disabled itself.

As a workaround execute the following commands in bash respectively PowerShell

mkdir -p ~/.kube && touch ~/.kubeconfig
If(-Not (Test-Path ~\.kube)) {New-Item -Path ~\.kube -ItemType Directory}
If(-Not (Test-Path ~\.kube\config)) {New-Item -Path ~\.kube\config -ItemType File}

@jeffmaury
Copy link
Contributor

@odockal I cannot reproduce with 1.8.0 on Win11Pro. Is it MacOS specific ?

@Blaimi
Copy link

Blaimi commented Mar 22, 2024

cannot reproduce this with version 1.8.0 on fedora 39 either. The cluster gets created and contour gets installed. #6406 still occurs but I think this bug can be closed as fixed.

@nichjones1
Copy link
Contributor

@odockal can you retest this issue?

@odockal
Copy link
Contributor Author

odockal commented Mar 27, 2024

Seems like the issue was fixed. I got no error. @Blaimi seems about right, context was not updated as in mentioned issue. Still closing.

@odockal odockal closed this as completed Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants