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 in Kubernetes by akhtar
• 11,250 points
56 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 by MD
• 24,500 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
• 51,850 points
1,430 views
0 votes
2 answers
0 votes
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
6,640 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 11, 2019 in Kubernetes by Kalgi
• 51,850 points

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