pulumi-eks icon indicating copy to clipboard operation
pulumi-eks copied to clipboard

Cluster name with underscores

Open igorshapiro opened this issue 5 years ago • 1 comments

If the cluster has an underscore in its name:

return new eks.Cluster('eks-cluster', {...})

An error is thrown. Cluster name should be probably normalized internally

Plan apply failed: StorageClass.storage.k8s.io "eks_cluster-gp2-whmfn08q" is invalid: metadata.name: 
Invalid value: "eks_cluster-gp2-whmfn08q": 
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])?)*')

igorshapiro avatar Mar 11 '19 10:03 igorshapiro

After speaking to @roothorp on this, we suggest that the function that creates the storageClass:

createStorageClass(`${name.toLowerCase()}-${storageClasses}`, storageClass, {

just passes the name into the storageClass and then we can call a normalize function on the name here to be compliant as per above

stack72 avatar Jul 21 '22 12:07 stack72