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,371 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
1 answer

How would you configure Jenkins to build and deploy an application to AWS, Azure, or GCP? Can you share sample code or a Jenkinsfile for deploying with Terraform or CloudFormation?

Set up Jenkins for application building and deployment onto AWS, Azure, or GCP by integrating it with ...READ MORE

answered Nov 14 in DevOps Tools by Gagana
• 6,530 points
69 views
0 votes
1 answer

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

Docker is fully compatible with Kubernetes as the runtime for containers and is itself orchestrated and managed across a cluster of ...READ MORE

answered Nov 7 in DevOps Tools by Gagana
• 6,530 points
63 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,577 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,063 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