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

duplicate cluster name #137

Closed
artarik opened this issue Jun 1, 2023 · 4 comments · Fixed by #139
Closed

duplicate cluster name #137

artarik opened this issue Jun 1, 2023 · 4 comments · Fixed by #139
Labels
bug Something isn't working

Comments

@artarik
Copy link

artarik commented Jun 1, 2023

when i applied my config from previous issue via command

kubitect apply --config local_k8s.yaml --local 

i got a duplicated cluster name while i tried to get any commands e.g.

~: kubitect ls clusters
Clusters:
  - local-k8s (active)
  - local-k8s (active, local)

~: kubitect export config --cluster local-k8s
 Error: multiple clusters (2) have been found with the name 'local-k8s'

but in clusters dir i see one folder

~: ls -l .kubitect/clusters
итого 4
drwxr-xr-x 5 user user 4096 июн  1 22:19 local-k8s
~: kubitect --version
kubitect version v3.1.0
@MusicDin
Copy link
Owner

MusicDin commented Jun 1, 2023

Hi @artarik,

based on the provided output, one of the clusters is located in the current directory.

Clusters:
  - local-k8s (active).       # ~/.kubitect/clusters/local-k8s
  - local-k8s (active, local) # ./.kubitect/clusters/local-k8s

With version 3.0.0 global clusters (those in ~/.kubitect directory) can no longer be created with local- prefix. This prefix is now reserved exclusively for clusters that are created using --local flag.

This means if the cluster named k8s is created using --local flag, the resulting name would be local-k8s. Note that local clusters are created in the current directory (./.kubitect/)

@artarik
Copy link
Author

artarik commented Jun 2, 2023

wow, thank you for explain this situation.
But i have the same error then trying to create cluster from preset example-multi-worker

~: kubitect ls clusters
Clusters:
  - k8s-cluster (active)
  - k8s-cluster (active, local)

~: kubitect export kubeconfig --cluster k8s-cluster
┌
│ Error: multiple clusters (2) have been found with the name 'k8s-cluster'
└

or, if i creating cluster via command kubitect apply --config example-config-multi-worker.yaml --local

~: kubitect ls clusters
Clusters:
  - local-k8s-cluster (active)
  - local-k8s-cluster (active, local)

@MusicDin
Copy link
Owner

MusicDin commented Jun 2, 2023

Yes, I haven't realized till now that local and global paths conflict in the home directory.
Will fix that asap.

In the mean time, you can workaround this problem by changing into any directory that is not home (~) and it should work.

@MusicDin MusicDin added the bug Something isn't working label Jun 2, 2023
@MusicDin MusicDin linked a pull request Jun 2, 2023 that will close this issue
@MusicDin
Copy link
Owner

MusicDin commented Jun 2, 2023

Thanks @artarik for opening this issue.

It has been fixed in v3.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants