Error from server BadRequest error when creating secret yml Secret in version v1 cannot be handled as a Secret

0 votes

Hi Guys,

I have my pod in minikube cluster. I used the concept of secret key for username and password. For that I have created one yml file as given below.

apiVersion: v1
kind: Secret
metadata:
  name: secret
data:
  rootpass: abc
  userpass: abc

But it gave me the below error, when I tried to create this file.

$ kubectl create -f secret.yml
Error from server (BadRequest): error when creating "secret.yml": Secret in version "v1" cannot be handled as a Secret: v1.Secret.Data: decode base64: illegal base64 data at input byte 0, error found in #10 byte of ...|ass":"abc","userpass|..., bigger context ...|{"apiVersion":"v1","data":{"rootpass":"abc","userpass":"abc"},"kind":"Secret","metadata":{"na|..
May 22, 2020 in Kubernetes by akhtar
• 38,260 points
10,023 views

1 answer to this question.

0 votes

Hi@akhtar,

In your secret you can't give data directly. You have to encode your data in base64 format. In your code, you have passed abc as rootpass and userpass. So encode abc in base64 format and try once.

answered May 22, 2020 by MD
• 95,460 points

Related Questions In Kubernetes

0 votes
1 answer

image can't be pulled error when I try to pull a docker image - kubernetes

I think the image is being pulled ...READ MORE

answered Sep 4, 2018 in Kubernetes by Kalgi
• 52,350 points
6,206 views
0 votes
2 answers
+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
0 votes
1 answer
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