How to fix - Error create failed to create Secret invalid metadata.name Invalid value 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)

Share on:


In this article we are going to see how to fix -

Error create failed to create Secret sh.helm.release.v1.demoChart.v1 is invalid metadata.name Invalid value sh.helm.release.v1.demoChart.v1 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])?)*)


Root Cause

The root cause behind this issue can be one of the following -

  1. Helm release name consists of upper-case (ex - helm install demoChart helloworld)
  2. Helm release name consists of blank spaces (ex - helm install demo Chart helloworld)
  3. Helm release name consists of special character (ex - helm install demoCh@rt helloworld)

Release Name Reason for failure
1 Release Name demoChart Release name contains Uppercase character
2 Release Name demo Chart Release name contains Blank space
3 Release Name demoCh@rt Release name contains Special Character

Note - All above combinations are not valid for Helm release command


How to Fix?

To fix this issue you should not put any of the following in the Helm Release name -

  1. No upper-case
  2. No blank spaces
  3. No special character

Here the example helm command -

1helm install demochart helloworld

Breakdown of the above command -

Release Name Description
1 Release Name demochart No upper-case
No blank spaces
No special characters

Side Notes

  1. Helm Lint - Helm Lint command will never throw this error and you will assume everything is okay with your Helm Chart but I would highly recommend you to use helm install demochart --debug --dry-run helloworld before you put your helm chart into Production environment.
  2. Helm Templates - Also check helm’s Chart.yaml for the name attribute, it should not have name tag in uppercase or should not have any blank spaces or any special characters in it.

Example -

1apiVersion: v2 
2name: demochart    #Note : - This tag should not contain any uppercase, blank spaces or special character
3description: A Helm chart for Kubernetes
4type: application
5version: 0.1.0 #mandatory
6appVersion: 1.16.0

References -

  1. GitHUb-#7191
  2. GitHUb-#3493

Read More -

  1. Helm chart - How to Add/Install plugins
  2. Getting started with Helm Chart
  3. Helm chart - WordPress Installation with MariaDB on Kubernetes
  4. Helm chart - Build you first helm chart with Spring Boot
  5. Helm Chart - Convert Kubernetes YAML into Helm Chart YAML
  6. Helm Chart - Pass environment variables
  7. Helm Chart - Plugin
  8. Helm Chart - Dry Run Install