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
  name: secret
  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,210 points

1 answer to this question.

0 votes


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,320 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,370 points
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
+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,370 points

reshown Apr 12, 2019 by Kalgi 3,623 views
0 votes
1 answer