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)
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 -
- Helm release name consists of upper-case (ex -
helm install demoChart helloworld
) - Helm release name consists of blank spaces (ex -
helm install demo Chart helloworld
) - 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 -
- No upper-case
- No blank spaces
- 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
- 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. - Helm Templates - Also check helm's
Chart.yaml
for the name attribute, it should not havename
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 -
Read More -
- Helm chart - How to Add/Install plugins
- Getting started with Helm Chart
- Helm chart - WordPress Installation with MariaDB on Kubernetes
- Helm chart - Build you first helm chart with Spring Boot
- Helm Chart - Convert Kubernetes YAML into Helm Chart YAML
- Helm Chart - Pass environment variables
- Helm Chart - Plugin
- Helm Chart - Dry Run Install
- Helm Chart - How to create multiple values files inside helm chart?
- Helmfile - How to use Helmfile for managing helm chart?
Posts in this Series
- How to use Helmfile for managing helm chart?
- How to create multiple values files inside helm chart?
- Pass environment variables into Helm Chart?
- How to fix - Helm install unknown flag --name/Error must either provide a name or specify --generate-name?
- Understanding Helm dry run for template debugging
- 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)
- Convert Kubernetes deployment YAML into Helm Chart YAML
- Helm chart - Wordpress Installation with MariaDB on Kubernetes
- Helm chart - How to Add/Install plugins
- Getting Started with Helm Chart
- Building first Helm Chart with Spring Boot Microservices