pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.22k stars 493 forks source link

AWS EKS: helm release tidb-cluster gets "a DNS-1123 subdomain must consist of lower case alphanumeric characters" #580

Closed george24601 closed 5 years ago

george24601 commented 5 years ago

Bug Report

What version of Kubernetes are you using? AWS EKS 1.12 on us-east-2

What version of TiDB Operator are you using? TiDB Operator Version: version.Info{TiDBVersion:"2.1.0", GitVersion:"v1.0.0-beta.3", GitCommit:"6257dfaad68f55f745f20f6f5d19b10bea2b0bea", GitTreeState:"clean", BuildDate:"2019-06-06T09:51:04Z", GoVersion:"go1.12", Compiler:"gc", Platform:"linux/amd64"}

What storage classes exist in the Kubernetes cluster and what are used for PD/TiKV pods? N/A

What's the status of the TiDB cluster pods? N/A

What did you do?

  1. fresh clone. Go to deploy/aws/main.tf and comment out resource "helm_release" "tidb-cluster", resource "null_resource" "wait-tidb-ready", and data/output that depend on these two resources
  2. run terraform apply -var-file=aws-tutorial.tfvars to provision everything but the helm release
  3. VPC/EKS/tidb-operator successfully provisioned
  4. uncomment the resources commented in step 1 and run terraform apply -var-file=aws-tutorial.tfvars again

What did you expect to see? Tidb cluster successfully released by helm

What did you see instead?

 helm_release.tidb-cluster: rpc error: code = Unknown desc = release tidb-cluster-george_test failed: Secret "tidb-cluster-george_test-monitor" is invalid: metadata.name: Invalid value: "tidb-cluster-george_test-monitor": a DNS-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])?)*')

Note that the only thing i changed in the tfvar file is the cluster name

tennix commented 5 years ago

We use cluster name as the resource name prefix, however k8s has some limitations on resource names: upper case letter and underscore is not allowed. We should address this in our documents. Thank you for reporting this!

george24601 commented 5 years ago

The tutorial cluster name uses underscore too. Probably want to change this too.

tennix commented 5 years ago

Yes, you are right.

weekface commented 5 years ago

Is anyone working on this? @gregwebs @tennix

aylei commented 5 years ago

@weekface This has been addressed in #616