The Secret secret name is invalid secret name a DNS-1123 subdomain must consist of lower case alphanumeric characters - or and must start and end with an alphanumeric character

0 votes

Hi Guys,

I am trying to create a secret in the Openshift cluster. But it is showing me the below error.

$ oc create secret generic secret_name --from-literal key1=secret1 --from-literal key2=secret2 -n myproj
The Secret "secret_name" is invalid: metadata.name: Invalid value: "secret_name": 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])?)*') 

How can I solve this error?

Aug 18, 2020 in DevOps Tools by akhtar
• 38,260 points
9,327 views

1 answer to this question.

0 votes

Hi@akhtar,

You are using the wrong syntax in your command. You can not use underscore in your command. Openshift will not allow underscores in the commands. So you need to modify your command as shown below.

$ oc create secret generic secret-name --from-literal key1=secret1 --from-literal key2=secret2 -n myproj

I hope this will solve your error.

answered Aug 18, 2020 by MD
• 95,460 points

Related Questions In DevOps Tools

0 votes
0 answers

How does Docker integrate with Kubernetes, and what are the benefits of using both?

How does Docker integrate with Kubernetes, and ...READ MORE

Nov 5 in DevOps Tools by Anila
• 3,390 points
31 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,476 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,035 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP