kuma icon indicating copy to clipboard operation
kuma copied to clipboard

Validate zone name is valid on control-plane install (and startup)

Open Dh0ren opened this issue 3 years ago • 12 comments

Summary

I followed the documentation : https://kuma.io/docs/1.2.1/deployments/multi-zone/#set-up-a-multi-zone-deployment And in the "verify control plane connectivity" step, I couldn't see any zone connected. Finally the zone was not connected to the global control plane because special characters are not accepted in the zone name.

I named my zone 'cluster_k8s_1' --> it was the issue I renamed my zone 'clusterk8s1 --> issue resolved, I verified control plane connectivity

Steps To Reproduce

  1. Follow kuma documentation https://kuma.io/docs/1.2.1/deployments/multi-zone/#multi-zone-mode
  2. At step "Zone control plane"
 kumactl install control-plane \
  --mode=zone \
  --zone=<zone name> \
  --ingress-enabled \
  --kds-global-address grpcs://`<global-kds-address>` | kubectl apply -f -

choose a name with charactere as '_' example : 'cluster_k8s_1'

  1. verify log from the global control plane you will something like Error logs provide below

Additional Details & Logs

  • Version : Kuma 1.2.3
  • Error logs :
2021-08-25T12:21:58.515Z        INFO    kds-global      new session created     {"peer-id": "cluster_k8s_1"}
2021-08-25T12:21:58.516Z        INFO    kds-global      creating Zone   {"name": "cluster_k8s_1"}
2021-08-25T12:21:58.524Z        ERROR   kds-global      Global CP could not create a zone       {"peer-id": "cluster_k8s_1", "error": "failed to create k8s resource: Zone.kuma.io \"cluster_k8s_1\" is invalid: metadata.name: Invalid value: \"cluster_k8s_1\": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')", "errorVerbose": "Zone.kuma.io \"cluster_k8s_1\" is invalid: metadata.name: Invalid value: \"cluster_k8s_1\": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'
  • Configuration : default
  • Platform and Operating System : 2 VMs : K8S cluster
  • Installation Method (Helm, kumactl, AWS CloudFormation, etc.) : Minikube, and kuma 1.2.3

Dh0ren avatar Aug 25 '21 14:08 Dh0ren

Seems like we should had validation on the zone name in kumactl install control-plane

lahabana avatar Aug 25 '21 14:08 lahabana

I was trying to create with a zone like "CamelCase" and the same issue happened. It may also be possible to add tips in the deployment doc to let users know that they should conform to the RFC 1123 standard.

hanxiaop avatar Oct 28 '21 09:10 hanxiaop

Good idea! If you want to contribute here's the file you'll want to modify: https://github.com/kumahq/kuma-website/blob/master/docs/docs/1.3.1/deployments/multi-zone.md

Thanks!

lahabana avatar Oct 29 '21 08:10 lahabana

@lahabana Does the zone name need to have such a restrictive character set?

jpeach avatar Nov 03 '21 23:11 jpeach

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

github-actions[bot] avatar Dec 24 '21 08:12 github-actions[bot]

I think in the end they end up as the name of a k8s resource which is why it's restrictive.

lahabana avatar Jan 05 '22 13:01 lahabana

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

github-actions[bot] avatar Feb 05 '22 08:02 github-actions[bot]

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

github-actions[bot] avatar Mar 10 '22 08:03 github-actions[bot]

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

github-actions[bot] avatar Jun 23 '22 08:06 github-actions[bot]

We've also noticed something with 100 chars limits on zone names.

lahabana avatar Jun 27 '22 08:06 lahabana

This is tricky to have entity names limited to 100 characters as they end up being something like: <zone>_<podName>_<namespace> for example

We've discussed that maybe having good names like this wasn't required.

lahabana avatar Jun 27 '22 08:06 lahabana

This issue was inactive for 30 days it will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant please comment on it promptly or attend the next triage meeting.

github-actions[bot] avatar Jul 28 '22 08:07 github-actions[bot]

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] avatar Oct 27 '22 08:10 github-actions[bot]

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] avatar Jan 26 '23 08:01 github-actions[bot]

This issue was inactive for 90 days. It will be reviewed in the next triage meeting and might be closed. If you think this issue is still relevant, please comment on it or attend the next triage meeting.

github-actions[bot] avatar Apr 27 '23 07:04 github-actions[bot]