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,303 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

5 days ago in DevOps Tools by Anila
• 2,230 points
21 views
0 votes
2 answers
0 votes
1 answer

How to get the current status of a local repository in Git?

Using 'git status' command in the repository ...READ MORE

answered Nov 26, 2019 in DevOps Tools by Sirajul
• 59,230 points
723 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,441 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,350 points

reshown Apr 12, 2019 by Kalgi 7,077 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