cilium / cilium-cli

CLI to install, manage & troubleshoot Kubernetes clusters running Cilium
https://cilium.io
Apache License 2.0
413 stars 208 forks source link

Error: Unable to install Cilium: invalid cluster name #797

Open akoserwal opened 2 years ago

akoserwal commented 2 years ago

Is there an existing issue for this?

What happened?

~ cilium install ℹ️ using Cilium version "v1.11.3" 🔮 Auto-detected cluster name: api-mk-c9cm59nafa3h-dlin-s1-devshift-org:6443 🔮 Auto-detected IPAM mode: cluster-pool ❌ Cluster name "api-mk-c9cm59nafa3h-dlin-s1-devshift-org:6443" is not valid, must match regular expression: ^[a-z0-9]()$

Cilium Version

cilium-cli: v0.11.1 compiled with go1.18.1 on darwin/amd64 cilium image (default): v1.11.3 cilium image (stable): v1.11.3 cilium image (running): unknown. Unable to obtain cilium version, no cilium pods found in namespace "kube-system"

Kernel Version

Darwin Kernel Version RELEASE_X86_64

Kubernetes Version

Openshift dedicated stable-4.10

Sysdump

No response

Relevant log output

No response

Anything else?

No response

Code of Conduct

alexander-demicev commented 2 years ago

I think the solution might require CLI to discover that cilium is being deployed to openshift

rolinh commented 2 years ago

The cluster name is invalid because it ends with :6443, which is invalid for a DNS sub-domain (see RFC1123). Try removing the port section from your domain name.

alexander-demicev commented 2 years ago

Never mind my previous comment, looks like the cluster name is being discovered from the current context of the kubeconfig.

contexts:
- context:
    cluster: mycluster
    user: myuser
  name: myuser
current-context: myuser

Issue might be resolved by checking that the cluster name contains a valid name in both contexts and clusters section of the kubeconfig.