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,230 points
8,798 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,440 points

Related Questions In DevOps Tools

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
594 views
0 votes
1 answer

What is the need of database in devops?

DevOps is the convergence of development and ...READ MORE

answered Feb 11, 2020 in DevOps Tools by Sirajul
• 59,230 points
674 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
14,587 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,360 points

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